# Model: DoctorSchedule

**Table**: `clinic_doctor_schedules` (new)

## Purpose

The recurring weekly availability for one doctor-branch pairing. Multiple rows per
`clinic_doctor_branch` (e.g. "Sunday 10:00–14:00" and "Tuesday 16:00–20:00" are two separate
rows for the same doctor at the same branch). `BookingService::availableSlots()` combines this
with `clinic_doctor_branch.slot_duration_minutes` and existing `clinic_bookings` to compute
bookable slots for a given date.

## Fields

| Column | Type | Constraints | Notes |
|---|---|---|---|
| `id` | bigint | PK | |
| `doctor_branch_id` | bigint | `foreignId('doctor_branch_id')->constrained('clinic_doctor_branch')->cascadeOnDelete()` | |
| `day_of_week` | unsignedTinyInteger | 0=Sunday … 6=Saturday | matches the brief's day-based examples ("Sunday and Tuesday") |
| `start_time` | time | | |
| `end_time` | time | | |
| `is_active` | boolean | default true | lets a Clinic Admin pause one day without deleting the row |
| `created_at` / `updated_at` | timestamp | | |

## Relationships

| Relation | Type | Target |
|---|---|---|
| `doctorBranch()` | `belongsTo` | `DoctorClinic` |

## Decisions

- Recurring weekly pattern only for v1 (no per-date overrides/holidays) — matches the scope of
  the source brief, which doesn't describe holiday/exception handling. Flag as a likely Phase 2+
  follow-up once real usage surfaces the need (e.g. a doctor's one-off day off).
