GRO-1169: Schema & Migration — Buffer Time Data Model #395

Closed
groombook-engineer[bot] wants to merge 1 commits from flea-flicker/gro-1162-pet-buffer-time into dev

1 Commits

Author SHA1 Message Date
Chris Farhood 1d8a086fad feat(api): cascade delay prevention for overrunning appointments
- New lib/cascade.ts: detect when PATCH extends endTime beyond original,
  query same-groomer downstream active appointments, and shift them
  forward by (overrunEnd + buffer − downstreamStart). Propagates
  through the chain until no more conflicts.

- Cascade result (shifted[], flaggedForReview[], cascadeLog[]) included
  in the PATCH response when a shift occurs. Clients receive reschedule
  email notification. Out-of-business-hours shifts are flagged rather
  than auto-applied.

- Added cascadeDelay() and cascadeOnStatusOverrun() helpers.
- Cascade wired into the this_only PATCH path in appointments.ts.

Tests: cascade.test.ts
UAT: apps/api/UAT_PLAYBOOK.md §2

Refs: GRO-1175, GRO-1162-G

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-05-16 16:27:22 +00:00