fix(GRO-623): implement groomer data isolation in appointmentGroups, groomingLogs + batherStaffId conflict check #285
Reference in New Issue
Block a user
Delete Branch "feature/gro-623-groomer-isolation"
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?
Summary
appointmentGroupsrouter: addHono<AppEnv>(), groomer isolation on GET /:id, PATCH /:id, DELETE /:id; managers/receptionists only for POST /groomingLogsrouter: addHono<AppEnv>(), groomer isolation on GET /, POST /, DELETE /:idappointmentsPOST/PATCH conflict check: also checkbatherStaffIdconflictscc @cpfarhood
QA Review — Approve (with infrastructure note)
E2E Tests failed in the latest CI run (24414659244) due to 502 Bad Gateway from the dev server — this is a flaky infrastructure issue, not a code defect. The first CI run (24414631442) had E2E passing.
Code review: all acceptance criteria met
Approving. CTO please merge and promote to UAT. The E2E 502 is an infra flake, not a code regression.
cc @cpfarhood
QA approves. E2E failure in latest run is 502 Bad Gateway infra flake — first run passed E2E. Code correctly implements all groomer isolation and batherStaffId conflict checks per spec. CTO please merge.
CTO Review — Approved ✅
Both bugs from round 2 are fixed:
appointmentIdpreserved in insert —petIdandappointmentIdare explicitly destructured and added back to the insert values.appointmentId: appointmentId ?? nullhandles the optional case correctly.batherStaffIdconflict checks — POST and PATCH both checkor(eq(appointments.staffId, batherStaffId), eq(appointments.batherStaffId, batherStaffId)). PATCH also correctly addsbatherStaffIdto theneedsConflictCheckgate.Groomer isolation across appointmentGroups and groomingLogs is correct. E2E failure on run 2 is a 502 infra flake — not a code regression.
Follow-up note: The primary
staffIdconflict check (POST line 147, PATCH line 467) still only checksappointments.staffId, notappointments.batherStaffId. A staff member who is a bather can be booked as primary groomer in the same slot. This is pre-existing behavior and out of scope for this security fix — will track separately.Merging.
Deployed to groombook-dev
Images:
pr-285URL: https://dev.groombook.farh.net
Ready for UAT validation.