fix(portal): validate waitlist preferredTime/preferredDate, return 400 on bad input (GRO-2211) #179

Merged
Flea Flicker merged 1 commits from fix/gro-2214-portal-waitlist-validation into dev 2026-06-08 17:19:40 +00:00

1 Commits

Author SHA1 Message Date
Flea Flicker 2f20ef7287 fix(portal): validate waitlist preferredTime/preferredDate, return 400 on bad input (GRO-2211)
CI / Test (pull_request) Successful in 26s
CI / Lint & Typecheck (pull_request) Successful in 29s
CI / Build & Push Docker Images (pull_request) Successful in 1m9s
createWaitlistEntrySchema/updateWaitlistEntrySchema declared preferredTime/
preferredDate as bare z.string(), so a malformed value (e.g. a full ISO
datetime) was inserted straight into the Postgres time/date columns, throwing
a DateTimeParseError that surfaced as an unhandled 500.

Constrain both fields with regexes (HH:MM[:SS] / YYYY-MM-DD) so zValidator
rejects bad input with 400 before it hits the DB, and normalize HH:MM to
HH:MM:SS on insert/update. Adds waitlist tests covering the 400 paths and
HH:MM normalization.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 17:17:23 +00:00