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);
|
||
|
|
}
|
||
|
|
}
|