Dossier API – archiveEntity and unarchiveEntity

archiveEntity is used to archive an entity. unarchiveEntity is used to unarchive an entity.

interface DossierClient {
archiveEntity(
reference: EntityReference,
): PromiseResult<
EntityArchivePayload,
"BadRequest" | "NotFound" | "NotAuthorized" | "Generic"
>;

unarchiveEntity(
reference: EntityReference,
): PromiseResult<
EntityUnarchivePayload,
"BadRequest" | "NotFound" | "NotAuthorized" | "Generic"
>;
}

interface EntityReference {
id: string;
}

interface EntityArchivePayload {
id: string;
status: EntityStatus;
effect: "archived" | "none";
updatedAt: Date;
}

interface EntityUnarchivePayload {
id: string;
status: EntityStatus;
effect: "unarchived" | "none";
updatedAt: Date;
}

Archiving an entity generates an archiveEntity event. Unarchiving an entity generates an unarchiveEntity event.