fix(GRO-2235): return 409 on duplicate portal waitlist submit #189

Merged
Flea Flicker merged 2 commits from flea/gro-2235-waitlist-duplicate-409 into dev 2026-06-08 23:50:22 +00:00

2 Commits

Author SHA1 Message Date
Flea Flicker 7bdb96631f ci: re-trigger checks (transient Alpine CDN DNS flake in docker build)
CI / Test (pull_request) Successful in 26s
CI / Lint & Typecheck (pull_request) Successful in 32s
CI / Build & Push Docker Images (pull_request) Successful in 1m5s
2026-06-08 23:48:02 +00:00
Flea Flicker d06c3b8d31 fix(GRO-2235): return 409 on duplicate portal waitlist submit
CI / Test (pull_request) Successful in 26s
CI / Lint & Typecheck (pull_request) Successful in 31s
CI / Build & Push Docker Images (pull_request) Failing after 48s
An exact duplicate active waitlist entry (same client/pet/service/
preferred date+time) violates the partial unique index
idx_waitlist_active_unique, which postgres-js surfaces as SQLSTATE
23505. The POST /portal/waitlist handler did not catch it, so the
duplicate returned a generic 500. Catch 23505 specifically and return
409 with a friendly message; unrelated errors still surface as 500 and
the first insert still returns 201.

Adds integration coverage: 201 first insert, 409 duplicate, 500 unrelated.
2026-06-08 23:44:15 +00:00