Schedule Management
Define your weekly availability so patients can book the right slots.
The Schedule system allows doctors to define their weekly availability by configuring time slots for each day of the week. This availability data drives the slot picker in the patient booking flow — patients only see slots that the doctor has explicitly marked as available and which are not already booked.
Schedule Structure
The schedule is stored as an object on the Doctor document with keys for each weekday (0=Sunday through 6=Saturday). Each day contains an array of time slot strings in HH:MM format, plus a boolean indicating whether the doctor is available at all on that day.
{
"schedule": {
"0": { "available": false, "slots": [] },
"1": { "available": true, "slots": ["09:00","09:30","10:00","10:30","11:00"] },
"2": { "available": true, "slots": ["09:00","09:30","10:00"] },
"3": { "available": true, "slots": ["14:00","14:30","15:00","15:30"] },
"4": { "available": true, "slots": ["09:00","09:30","10:00","10:30"] },
"5": { "available": true, "slots": ["09:00","10:00","11:00"] },
"6": { "available": false, "slots": [] }
}
}Editing the Schedule
The schedule editor presents a weekly grid UI. Each day has a toggle to mark it available or unavailable. When a day is toggled available, the doctor can add time slots by clicking time chips or entering custom times. Changes are saved on submit via PUT /api/doctor/schedule. The schedule is not versioned — saving overwrites the current week pattern, and the new pattern takes effect immediately for all future bookings.
Impact on Booking
When a patient opens the slot picker for a specific doctor on a specific date, the system calls GET /api/doctor/schedule to get the available slots for that weekday, then cross-references against existing appointments on that exact date to filter out already-booked slots. Only the remaining open slots are shown to the patient.
Existing bookings not affected
Changing the schedule does not cancel or modify existing appointments. If a doctor removes a slot that already has a booked appointment, that appointment remains valid. The schedule change only affects future booking availability.