Files
prosapp-migration/backend
Lizandro GuarnizoandClaude Sonnet 4.6 c8b2c0c901 fix(services): add double-booking check and schedule validation on create
Before creating a service, now:
1. Checks if the requested slot (day + range1_hour1) is already occupied by
   a non-cancelled/denied service for that professional — rejects with 400
2. Validates the requested day has an enabled schedule for the professional;
   rejects if the professional does not work that weekday
3. Validates the requested hour falls within the configured hour ranges
   (continuous day: range1_hour1→range2_hour2; split day: morning + afternoon
   blocks) — rejects if outside configured hours

day_of_week conversion: JS Date.getDay() (0=Sun) → DB convention (0=Mon)
via (getDay()+6)%7

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-12 17:55:55 -05:00
..