fix(housekeeping): complete people workflow fidelity
This commit is contained in:
1 parent
25b76437ff
commit
91c9efcbb4
29 files changed
+1365
-290
No files matched your search
@@ -17,12 +17,32 @@ export interface HousekeepingError {
|
||||
fieldErrors?: Readonly<Record<string, readonly string[]>>;
|
||||
}
|
||||
|
||||
export interface HousekeepingPartialCompletion {
|
||||
readonly status: "partial";
|
||||
readonly external: "not-required" | "completed" | "failed";
|
||||
readonly audit: "persisted" | "unavailable";
|
||||
}
|
||||
|
||||
export type HousekeepingResult<T> =
|
||||
| { ok: true; data: T; correlationId: string }
|
||||
| {
|
||||
ok: true;
|
||||
data: T;
|
||||
correlationId: string;
|
||||
completion?: HousekeepingPartialCompletion;
|
||||
}
|
||||
| { ok: false; error: HousekeepingError; correlationId: string };
|
||||
|
||||
export function ok<T>(data: T, correlationId: string): HousekeepingResult<T> {
|
||||
return { ok: true, data, correlationId };
|
||||
export function ok<T>(
|
||||
data: T,
|
||||
correlationId: string,
|
||||
completion?: HousekeepingPartialCompletion,
|
||||
): HousekeepingResult<T> {
|
||||
return {
|
||||
ok: true,
|
||||
data,
|
||||
correlationId,
|
||||
...(completion === undefined ? {} : { completion }),
|
||||
};
|
||||
}
|
||||
|
||||
export function fail(
|
||||
|
||||
Reference in new issue
Block a user