fix(appointment): resolve issue with reserved slots incorrectly shown as available

This commit is contained in:
hamed
2026-07-15 19:13:27 +03:30
parent de6fe1bd56
commit d91867bd63
5 changed files with 227 additions and 3 deletions
@@ -96,10 +96,10 @@ class AppointmentRepository extends ServiceEntityRepository
->andWhere('a.slotStart < :slotEnd')
->andWhere('a.slotEnd > :slotStart')
->andWhere(
'a.status = :confirmed OR (a.status = :pending AND (a.expiresAt IS NULL OR a.expiresAt > :now))'
'a.status IN (:blocking) OR (a.status = :pending AND (a.expiresAt IS NULL OR a.expiresAt > :now))'
)
->setParameter('doctor', $doctor)
->setParameter('confirmed', Appointment::STATUS_CONFIRMED)
->setParameter('blocking', Appointment::SLOT_BLOCKING_STATUSES)
->setParameter('pending', Appointment::STATUS_PENDING)
->setParameter('now', time())
->setParameter('slotStart', $slotStart)