fix(11-05): WR-02 add .max(10080) to reminderLeadMinutes in both Zod schemas

- eventFieldsSchema (events.ts): rejects reminderLeadMinutes > 10080 with 400
- outboxPayloadSchema (outboxWorker.ts): hard-fails row when value exceeds 1-week cap
- 10080 = 1 week in minutes; matches UI select maximum
This commit is contained in:
Lucas Berger
2026-06-14 08:22:13 -04:00
parent 30b8c9643a
commit 7d94afb2d8
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ const outboxPayloadSchema = z
// null — explicit "None" → clear the VALARM on write-back // null — explicit "None" → clear the VALARM on write-back
// 0 — same-day all-day reminder (fire 9 AM on event date); timed 0 = None (D-06) // 0 — same-day all-day reminder (fire 9 AM on event date); timed 0 = None (D-06)
// positive int — N minutes before event start (timed) or N/1440 days before (all-day) // positive int — N minutes before event start (timed) or N/1440 days before (all-day)
reminderLeadMinutes: z.number().int().min(0).nullable().optional(), reminderLeadMinutes: z.number().int().min(0).max(10080).nullable().optional(),
}) })
.passthrough(); .passthrough();
+1 -1
View File
@@ -122,7 +122,7 @@ const eventFieldsSchema = z.object({
// null — explicit "None" → clear the VALARM on write-back // null — explicit "None" → clear the VALARM on write-back
// 0 — same-day all-day reminder (9 AM on event date); timed 0 = None (D-06) // 0 — same-day all-day reminder (9 AM on event date); timed 0 = None (D-06)
// positive int — N minutes before event start (timed) or N/1440 days before (all-day) // positive int — N minutes before event start (timed) or N/1440 days before (all-day)
reminderLeadMinutes: z.number().int().min(0).nullable().optional(), reminderLeadMinutes: z.number().int().min(0).max(10080).nullable().optional(),
}); });
/** sync-status query params. */ /** sync-status query params. */