From 53b2dc6067a8388bc9e31729ba6385a43525fc5a Mon Sep 17 00:00:00 2001 From: Paperclip Date: Tue, 14 Apr 2026 13:59:54 +0000 Subject: [PATCH] fix(appointments): cap recurrence series at 1 year max --- apps/api/src/routes/appointments.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/api/src/routes/appointments.ts b/apps/api/src/routes/appointments.ts index 546c6b0..e908efc 100644 --- a/apps/api/src/routes/appointments.ts +++ b/apps/api/src/routes/appointments.ts @@ -41,6 +41,10 @@ const createAppointmentSchema = z.object({ frequencyWeeks: z.number().int().min(1).max(52), count: z.number().int().min(2).max(52), }) + .refine( + (r) => r.frequencyWeeks * r.count <= 52, + { message: "Recurrence series must not exceed 1 year" } + ) .optional(), });