- 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.
23 lines
722 B
TypeScript
23 lines
722 B
TypeScript
import { z } from "zod/v4";
|
|
export const MailboxInputSchema = z.strictObject({
|
|
address: z.email().max(254),
|
|
kind: z.enum(["corporate", "external"]),
|
|
context: z.string().trim().max(255).nullable(),
|
|
accountId: z.uuid().nullable(),
|
|
active: z.boolean(),
|
|
notes: z.string().trim().max(4000).nullable(),
|
|
});
|
|
export type MailboxInput = z.infer<typeof MailboxInputSchema>;
|
|
export const MailboxUseInputSchema = z.strictObject({
|
|
mailboxId: z.uuid(),
|
|
personId: z.uuid(),
|
|
startDate: z.iso.date(),
|
|
endDate: z.iso.date().nullable(),
|
|
});
|
|
export type MailboxUseInput = z.infer<typeof MailboxUseInputSchema>;
|
|
export class MailboxError extends Error {
|
|
constructor(public readonly code: string) {
|
|
super(code);
|
|
}
|
|
}
|