- Changed asset status label from "status" to "technicalStatus" in AssetForm component. - Added help text for technical status in AssetForm. - Updated test cases to reflect changes in asset status from "available" to "operational". - Enhanced workstation form to utilize new asset status checks and display appropriate messages. - Refactored asset context to replace "available" with "notRetired" across various application policies and repositories. - Introduced new utility functions for asset status management, including technical status determination and assignment validation. - Added integration tests for asset state verification and unlinking assets from workstations.
35 lines
1.3 KiB
TypeScript
35 lines
1.3 KiB
TypeScript
import type { UniqueID } from "@repo/rdx-ddd";
|
|
import type { Result } from "@repo/rdx-utils";
|
|
|
|
import type { MailConfiguration } from "../domain/mail-configuration.aggregate";
|
|
import type { MailConfigurationError } from "../domain/mail-configuration-values";
|
|
import type { WorkProfile } from "../domain/work-profile.aggregate";
|
|
|
|
import type { MailboxContext } from "./mailbox.repository";
|
|
|
|
export interface IMailInventoryService {
|
|
list(companyId: UniqueID): Promise<readonly Readonly<{ id: UniqueID; notRetired: boolean }>[]>;
|
|
}
|
|
|
|
export type MailContext = Readonly<{
|
|
configurations: readonly MailConfiguration[];
|
|
people: readonly Readonly<{ id: UniqueID; active: boolean }>[];
|
|
mailboxes: MailboxContext["mailboxes"];
|
|
uses: MailboxContext["uses"];
|
|
profiles: readonly WorkProfile[];
|
|
assets: readonly Readonly<{ id: UniqueID; notRetired: boolean }>[];
|
|
actors: ReadonlyMap<string, string>;
|
|
today: string;
|
|
}>;
|
|
|
|
export interface IMailConfigurationRepository {
|
|
remove(company: UniqueID, id: UniqueID): Promise<Result<void, MailConfigurationError>>;
|
|
get(companyId: UniqueID): Promise<Result<MailContext, MailConfigurationError>>;
|
|
save(
|
|
companyId: UniqueID,
|
|
action: (context: MailContext) => Result<MailConfiguration, MailConfigurationError>
|
|
): Promise<
|
|
Result<{ configuration: MailConfiguration; context: MailContext }, MailConfigurationError>
|
|
>;
|
|
}
|