- Added `useAssetPickerController` for managing asset selection logic. - Created `AssetSelectProps` type for defining asset selection properties. - Implemented `AssetPickerDialog` for displaying the asset selection interface. - Developed `AssetPickerList` for rendering the list of selectable assets. - Introduced `AssetSelect` component for integrating the asset picker into forms. - Created `AssetList` component for shared asset listing functionality. - Added tests for workstation creation logic to ensure proper validation. - Implemented workstation asset fields and association fields for managing workstation assets. - Developed workstation lifecycle dialog for managing work profile states. - Added form progress component for visualizing multi-step forms.
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import type { UniqueID } from "@repo/rdx-ddd";
|
|
import type { Result } from "@repo/rdx-utils";
|
|
|
|
import type { AccessDefinition } from "../domain/access/access-definition";
|
|
import type { WorkProfile } from "../domain/work-profile.aggregate";
|
|
import type { WorkProfileError } from "../domain/work-profile-values";
|
|
|
|
export interface IWorkProfileInventoryService {
|
|
list(
|
|
companyId: UniqueID
|
|
): Promise<readonly { id: UniqueID; notRetired: boolean; isProfileHost?: boolean }[]>;
|
|
}
|
|
|
|
export type WorkProfileContext = Readonly<{
|
|
profiles: readonly WorkProfile[];
|
|
people: readonly { id: UniqueID; active: boolean }[];
|
|
assets: readonly { id: UniqueID; notRetired: boolean; isProfileHost?: boolean }[];
|
|
items: readonly { id: UniqueID; values: AccessDefinition }[];
|
|
actors: ReadonlyMap<string, string>;
|
|
today: string;
|
|
}>;
|
|
|
|
export interface IWorkProfileRepository {
|
|
get(companyId: UniqueID): Promise<Result<WorkProfileContext, WorkProfileError>>;
|
|
remove(companyId: UniqueID, id: UniqueID): Promise<Result<void, WorkProfileError>>;
|
|
save(
|
|
companyId: UniqueID,
|
|
action: (context: WorkProfileContext) => Result<WorkProfile, WorkProfileError>
|
|
): Promise<Result<{ profile: WorkProfile; context: WorkProfileContext }, WorkProfileError>>;
|
|
}
|