feat(backend): auto-assign + transactional double-booking guard + working-hours slots

POST /book and POST /appointments now resolve the specialist via autoAssign (or isAvailable-guard a chosen one) inside BEGIN IMMEDIATE...COMMIT, returning 409 on conflict. Slots endpoint derives the day window from real working_hours and ranks the best specialist per slot. settings/employees expose + persist the new fields. Adds booking-e2e.mjs and adapts e2e-test.mjs fixtures to in-hours slots.
This commit is contained in:
AgendaPro Dev
2026-07-26 15:59:28 -06:00
parent 811d2a24b2
commit ed608656e0
7 changed files with 301 additions and 126 deletions
+2
View File
@@ -15,6 +15,8 @@
"seed": "tsx server/scripts/seed.ts",
"test:e2e": "node e2e-test.mjs",
"test:admin": "node admin-test.mjs",
"test:unit": "node --import tsx --test server/lib/scheduling.test.ts",
"test:booking": "node server/scripts/booking-e2e.mjs",
"audit:visual": "node visual-audit.mjs"
},
"dependencies": {