fix(appointments): cap recurrence series at 1 year max

This commit is contained in:
Paperclip
2026-04-14 13:59:54 +00:00
parent 1bdfa9f3d2
commit 53b2dc6067
+4
View File
@@ -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(),
});