- Add mailbox persistence mapper for domain object mapping. - Create Sequelize repository for mailbox data access. - Define common mailbox schemas and types for validation. - Implement mailbox API for frontend communication. - Develop mailbox form component for creating and editing mailboxes. - Add internationalization support for mailbox labels and messages. - Create mailbox use form for managing mailbox usage periods. - Build mailboxes page to display and manage mailboxes and their usage.
31 lines
1.3 KiB
TypeScript
31 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; available: 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; available: boolean }>[];
|
|
actors: ReadonlyMap<string, string>;
|
|
today: string;
|
|
}>;
|
|
export interface IMailConfigurationRepository {
|
|
get(companyId: UniqueID): Promise<Result<MailContext, MailConfigurationError>>;
|
|
save(
|
|
companyId: UniqueID,
|
|
action: (context: MailContext) => Result<MailConfiguration, MailConfigurationError>
|
|
): Promise<
|
|
Result<{ configuration: MailConfiguration; context: MailContext }, MailConfigurationError>
|
|
>;
|
|
}
|