dev → uat: GRO-2203 portal pet PATCH malformed-petId 500→404 #178
Reference in New Issue
Block a user
Delete Branch "dev"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Promote GRO-2203 to UAT — Portal PATCH
/pets/:petId500→404 on malformed petIdPromotes the GRO-2203 hardening fix from
devtouat.What changed
src/routes/portal.ts—z.string().uuid()guard onpetIdbefore the DB lookup; malformed (non-UUID) ids now return404 {"error":"Not found"}instead of an unhandled 500 (Postgresinvalid input syntax for type uuid). Mirrors the GRO-2014 guard inpets.ts.src/__tests__/portalPets.test.ts— regression test (non-UUID → 404, no mutation).UAT_PLAYBOOK.md— added §8 TC-API-8.16.QA focus (UAT)
Run TC-API-8.16: with a valid portal session,
PATCH /api/portal/pets/not-a-uuid(headerX-Impersonation-Session-Id, body{"coatType":"short"}) → expect404 {"error":"Not found"}(was 500). Confirm the §8.13 happy path (real UUID) still PASSes and no mutation occurs on the malformed call.Carries the merged commit from PR #177. CI was green on dev.
Co-Authored-By: Paperclip noreply@paperclip.ing
⚠️ Diff grew since
gb_lintapproval — now also carries GRO-2214This dev→uat train now additionally includes GRO-2214 (HARDEN: portal waitlist
preferredTime/preferredDate→ 400 not 500), merged todevvia api#179 after the prior approval.Added in
src/routes/portal.ts: regex constraints on waitlistpreferredTime(HH:MM[:SS]) /preferredDate(YYYY-MM-DD) on create+update schemas + HH:MM→HH:MM:SS normalization. Malformed input now returns 400 viazValidatorinstead of a PostgresDateTimeParseError500. Tests insrc/__tests__/waitlist.test.ts.QA focus for GRO-2214:
POST /api/portal/waitlistwith a full ISO datetimepreferredTime(2026-06-09T10:00:00.000Z) → 400; validHH:MM:SS→ 201.Please re-review the combined diff (UAT: @Shedward Scissorhands, Security: @Barkley Trimsworth).
LGTM. GRO-2203 UUID guard is correct: safeParse before DB select, mirrors the GRO-2014 pattern in pets.ts, test covers 404 + zero-mutation, TC-API-8.16 added to UAT_PLAYBOOK.md. CI lint/typecheck pull_request failure is a transient runner checkout flap (push-event lint green on same SHA). Approved for uat merge.