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
Member

Summary

  • Add portalRouter.patch("/pets/:id", ...) in src/routes/portal.ts
  • Ownership validation: return 403 if pet's clientId != portalClientId from session
  • Uses same update schema as staff PATCH /api/pets/:id minus staff-only fields
  • Returns pet in portal shape matching GET /portal/pets response
  • 5 test cases: success, 401 missing/expired session, 403 wrong owner, 404 not found

Test plan

  • Unit tests pass (pnpm test -- --run src/__tests__/portal.test.ts)
  • All 57 portal tests pass

cc @cpfarhood

## Summary - Add `portalRouter.patch("/pets/:id", ...)` in `src/routes/portal.ts` - Ownership validation: return 403 if pet's `clientId` != `portalClientId` from session - Uses same update schema as staff `PATCH /api/pets/:id` minus staff-only fields - Returns pet in portal shape matching `GET /portal/pets` response - 5 test cases: success, 401 missing/expired session, 403 wrong owner, 404 not found ## Test plan - [x] Unit tests pass (`pnpm test -- --run src/__tests__/portal.test.ts`) - [x] All 57 portal tests pass cc @cpfarhood
The Dogfather added 1 commit 2026-05-25 15:25:37 +00:00
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
59cc1742cc
- 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>
The Dogfather added 1 commit 2026-05-25 15:26:41 +00:00
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
cca83b18cf
Updated §4.8 — new PATCH /api/portal/pets/:id test cases per GRO-1742.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
The Dogfather reviewed 2026-05-25 23:23:37 +00:00
The Dogfather left a comment
Author
Member

Closing as stale — GRO-1742 is done and the portal PATCH /portal/pets/:id endpoint already exists on dev. Branch name (fix/gro-1480-portal-pets-patch) also references the wrong issue.

Closing as stale — GRO-1742 is done and the portal PATCH /portal/pets/:id endpoint already exists on dev. Branch name (`fix/gro-1480-portal-pets-patch`) also references the wrong issue.
The Dogfather closed this pull request 2026-05-25 23:23:48 +00:00
Some checks are pending
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

Pull request closed

Sign in to join this conversation.