1) Shifts define the day
Weekly working windows per provider form the base availability.
09:00–12:00
13:00–17:00
2) Blackouts subtract time
Vacation days, half days, or slot‑level exceptions carve out time instantly.
10:00–11:00
14:00–15:00
3) Bookings remove overlaps
Existing appointments are removed so patients never see conflict slots.
4) Duration + gap stepping
Slots are stepped across free ranges: duration, plus a configurable buffer gap.
5) TZ-safe labels
Store in UTC, convert for display and reminders using the clinic timezone.
6) AI scope (optional)
Provider scope text helps match visit reasons—without weakening booking rules.