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
+16
View File
@@ -52,6 +52,22 @@ class Appointment
self::STATUS_CONFIRMED,
];
/**
* Statuses that make a slot unavailable for a *new* booking, as seen by the
* public availability view (AppointmentRepository::isSlotTaken). Broader than
* SLOT_OCCUPYING_STATUSES: besides a live booking, a slot is also spoken for
* once the visit has been consumed (completed / in-progress / no_show). Only
* cancelled_* and expired truly release it. STATUS_PENDING is handled
* separately in the query because it blocks only while not yet expired.
*/
public const SLOT_BLOCKING_STATUSES = [
self::STATUS_CONFIRMED,
self::STATUS_COMPLETED,
self::STATUS_FOLLOWING_UP,
self::STATUS_SALON,
self::STATUS_NO_SHOW,
];
// Optimistic locking
#[ORM\Version]
#[ORM\Column(type: 'integer')]