fix(GRO-1742): add portal PATCH /portal/pets/:id endpoint #68

Closed
The Dogfather wants to merge 2 commits from fix/gro-1480-portal-pets-patch into dev

2 Commits

Author SHA1 Message Date
Flea Flicker cca83b18cf docs(UAT_PLAYBOOK.md): add TC-API-8.8/8.9/8.10 for portal pet update
CI / Test (pull_request) Successful in 10s
CI / Lint & Typecheck (pull_request) Successful in 12s
CI / Build & Push Docker Images (pull_request) Successful in 18s
Updated §4.8 — new PATCH /api/portal/pets/:id test cases per GRO-1742.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-25 15:26:38 +00:00
Flea Flicker 59cc1742cc fix(GRO-1742): add portal PATCH /portal/pets/:id endpoint
CI / Test (pull_request) Successful in 9s
CI / Lint & Typecheck (pull_request) Successful in 10s
CI / Build & Push Docker Images (pull_request) Successful in 47s
- Add portalRouter.patch("/pets/:id", ...) handler in src/routes/portal.ts
- Ownership validation: return 403 if pet's clientId != portalClientId
- Uses same update schema as staff PATCH /api/pets/:id minus staff-only fields
- Returns pet in portal shape matching GET /portal/pets response
- Add 5 test cases covering: success, 401 missing/expired session, 403 wrong owner, 404 not found
- Fix mock to support pets table + insert for impersonationAuditLogs

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-25 15:24:58 +00:00