fix(appointment): mark past-time slots as unavailable
is_available only checked whether a slot was booked, so on today's date slots whose start time had already passed (e.g. 10:00 when it is 12:00) still showed as bookable until the POST /appointment 422. Treat a slot with start < now as unavailable in getAllSlotsWithAvailability, and drop past slots in filterBookedSlots so getAvailableSlots agrees. Future days are unaffected. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -56,7 +56,7 @@ Get all appointment slots (available and booked) for a doctor on a specific date
|
||||
}
|
||||
```
|
||||
|
||||
> Returns **all** slots grouped by work shift. `is_available: false` means the slot has an active (pending/confirmed) appointment. Session boundaries match the doctor's `WeeklySchedule` or date override config.
|
||||
> Returns **all** slots grouped by work shift. `is_available: false` means the slot is either already booked (active pending/confirmed appointment) **or** its start time has already passed (for today's date). Session boundaries match the doctor's `WeeklySchedule` or date override config.
|
||||
|
||||
### Errors
|
||||
| Code | HTTP | Description |
|
||||
|
||||
Reference in New Issue
Block a user