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
pull from: flea-flicker/gro-1162-pet-buffer-time
merge into: groombook:dev
groombook:main
groombook:dev
groombook:flea/gro-1636-better-auth-seed
groombook:pr-434
groombook:uat
groombook:docs/GRO-1502-uat-mcp-migration
groombook:flea/gro-1496-e2e-err-connection-refused
groombook:flea-flicker/gro-1489-lint-fixes
groombook:cpfarhood/gro-1162-pet-buffer
groombook:flea-flicker/gro-1162-pet-buffer
groombook:fix/gro-1368-consent-ts
groombook:fix/ci-e2e-dind-networking-registry-auth
groombook:fix/gro-1369-types-sync
groombook:fix/ci-registry-auth-main
groombook:gitea/migrate-workflows
groombook:feat/GRO-106-portal-communication-real
groombook:archived-readme
groombook:feat/GRO-106-stop-help
groombook:fix/gro-1248-path-prefixes
groombook:fix/GRO-1212-portal-test-mock-imports
groombook:fix/GRO-1108-test-mocks
groombook:feat/GRO-106-stop-help-v2
groombook:docs/GRO-1099-uat-playbook-app
groombook:fleaflicker/deploy-telnyx-webhook-secret
groombook:fix/gro-1024-clean
groombook:fix/gro-1021-auth-rate-limit
groombook:fix/gro-1021-auth-rate-limit-v2
groombook:feat/GRO-984-outbound-sms-persistence
groombook:fix/GRO-980-indentation
groombook:docs/GRO-106-10dlc-runbook
groombook:fix/gro-898-demo-sso-env-vars
groombook:fix/gro-609-cherry-pick
groombook:fix/gro-866-uat-seed-personas
groombook:fix/gro-867-logo-proxy
groombook:fix/gro-816-portal-pets-crash
groombook:fix/gro-844-network-policy
groombook:fix/gro-820-e2e-invoices-mock
groombook:feature/gro-609-refund-payment-stats
groombook:fix/gro-765-portal-appointments-service
groombook:fix/gro-805-allow-groomer-invoices
groombook:fix/gro-720-gitignore-hardening
groombook:fix/gro-721-harden-gitignore
groombook:feature/gro-633-db-indexes-constraints
groombook:fix/gro-639-n-plus-one-reminder-scheduler
groombook:ci-dev-trigger2
groombook:fix/gro-624-input-validation
groombook:feature/gro-653-portal-session-middleware
groombook:fix/gro-640-n-plus-one-email
groombook:clean-gro-639
groombook:fix/gro-637-invoice-refund-fixes
groombook:fix/gro-665-staff-auto-link
groombook:fix/gro-636-input-validation-v3
groombook:fix-gro-624-input-validation
groombook:fix/gro-655-corepack-only
groombook:feature/gro-597-payment-admin
groombook:feature/gro-631-graceful-shutdown
groombook:fix/gro-660-uat-seed-manager-superuser
groombook:fix/gro-655-corepack-enoent
groombook:feature/gro-623-groomer-isolation
groombook:feature/gro-632-impersonation-session-hardening
groombook:feature/gro-607-payment-ui
groombook:feature/gro-597-payment-backend
groombook:feature/gro-597-payment-ui
groombook:feature/gro-597-stripe-webhooks
groombook:feature/gro-597-payment-api
groombook:GRO-574-rate-limit-migration
groombook:chore/gro-575-promote-gro-574-to-uat
groombook:fix/gro-566-skip-oobe
groombook:fix/gro-557-e2e-stability
groombook:chore/gro-558-agents-instructions
groombook:fix/gro-531-social-login
groombook:fix/gro-545-social-providers-config
groombook:fix/gro-540-prod-oidc-env-vars
groombook:feat/gro-526-seed-profile-param
No Reviewers
Labels
Clear labels
bug
documentation
duplicate
enhancement
feature
good first issue
help wanted
invalid
question
wontfix
Something isn't working
Improvements or additions to documentation
This issue or pull request already exists
New feature or request
New feature
Good for newcomers
Extra attention is needed
This doesn't seem right
Further information is requested
This will not be worked on
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
ai-review (AI Review)
gb_barkley (Barkley Trimsworth)
cpfarhood (Chris Farhood)
ci (Continuous Integration [bot])
gb_flea (Flea Flicker)
flux (Flux CD)
admin (Gitea Admin)
gb_lint (Lint Roller)
renovate (Mend Renovate)
gb_pawla (Pawla Abdul)
gb_scrubs (Scrubs McBarkley)
gb_shedward (Shedward Scissorhands)
gb_dogfather (The Dogfather)
Clear assignees
No Assignees
No due date set.
Dependencies
No dependencies set.
Reference: groombook/app#395
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "flea-flicker/gro-1162-pet-buffer-time"
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
GRO-1162 epic: buffer time integration across slot generation, public booking API, and admin appointment API.
GRO-1169 — Schema & Migration:
buffer_minuteson appointments,defaultBufferMinuteson services,bufferTimeRuleslookup tableGRO-1170 — Buffer calculation engine (
resolveBufferMinuteswith 6-tier priority fallback)GRO-1172 — Scheduling engine integration:
BookedSlot.bufferMinutes— existing appointment's buffer extends effective endnewBufferMinutesparam — new appointment's buffer checked against existing appointmentsGET /availability: acceptspetSizeCategory/petCoatType, resolves buffer, passes to slot generationPOST /book/appointments: storesbufferMinutes, uses effective end for conflict detectionPOST /appointments(admin): resolves + stores buffer, effective-end conflict checks for single and recurringTest plan
GET /availability?petSizeCategory=large&petCoatType=doublereturns buffer-aware slotsGET /availabilitywithout pet params usesnewBufferMinutes=0(backward compatible)POST /book/appointmentsstoresbufferMinuteson created appointmentPOST /appointmentsresolves and storesbufferMinutes🤖 Generated with Claude Code
GRO-1175 / GRO-1162-G: Cascade Delay Prevention — Merged
Added the cascade delay prevention implementation to this PR (commit
1d8a086):apps/api/src/lib/cascade.ts— core cascade logic:cascadeDelay(triggeringId, newEndTime, originalEndTime)— detects overrun, queries same-groomer downstreamscheduled/confirmedappointments, shifts each by(overrunEnd + buffer − downstreamStart), cascades through the chain, logs each shift.cascadeOnStatusOverrun(id)— convenience wrapper for status-transition overruns.apps/api/src/routes/appointments.ts— wiredcascadeDelayinto thethis_onlyPATCH path: capturesoriginalEndTimebefore update, triggers cascade whenendTimewas extended, returnscascade: { shifted[], flaggedForReview[], cascadeLog[] }in the response.apps/api/src/__tests__/cascade.test.ts— unit tests covering: no-shift when no overrun, no downstream, no groomer; single shift; chained cascade; business-hours guard; active-status filtering; stop condition; email notification.apps/api/UAT_PLAYBOOK.md— new §2 (Cascade Delay Prevention) with checkboxes for all acceptance criteria.Updated UAT_PLAYBOOK.md §2 — GRO-1175 cascade delay prevention test cases.
Ready for re-review. Thanks!
CTO Assessment
This PR adds buffer time schema/migration (
cascade.ts) to the monorepo. The standalonegroombook/apirepo now hasapi/#12(GRO-1172: Scheduling Engine Buffer Integration) covering the same buffer time feature space.Recommendation: Close this PR and consolidate buffer time work in the standalone
groombook/apirepo. Duplicating schema work across monorepo and standalone repos will cause conflicts.@cpfarhood — please confirm if this can be closed.