import type { UniqueID } from "@repo/rdx-ddd"; import type { Result } from "@repo/rdx-utils"; import type { AccessDefinition } from "../domain/access/access-definition"; import type { Mailbox } from "../domain/mailbox.aggregate"; import type { MailboxUse } from "../domain/mailbox-use.aggregate"; import type { MailboxError } from "../domain/mailbox-values"; export type MailboxContext = Readonly<{ mailboxes: readonly Mailbox[]; uses: readonly MailboxUse[]; people: readonly { id: UniqueID; active: boolean }[]; items: readonly { id: UniqueID; values: AccessDefinition }[]; actors: ReadonlyMap; today: string; }>; export interface IMailboxRepository { get(companyId: UniqueID): Promise>; save( companyId: UniqueID, action: (context: MailboxContext) => Result ): Promise>; }