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:
@@ -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();
|
||||||
|
|
||||||
|
|||||||
@@ -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. */
|
||||||
|
|||||||
Reference in New Issue
Block a user