import { z } from "zod/v4"; export const TeleworkAuthorizationInputSchema = z .strictObject({ personId: z.uuid(), active: z.boolean(), startsOn: z.iso.date().nullable(), expiresOn: z.iso.date().nullable(), notes: z.string().trim().max(4000).nullable(), }) .refine((value) => !(value.startsOn && value.expiresOn) || value.startsOn <= value.expiresOn, { path: ["expiresOn"], message: "INVALID_REQUEST", }); export type TeleworkAuthorizationInput = z.infer; export class TeleworkAuthorizationError extends Error { constructor(public readonly code: string) { super(code); } }