Manage existing bookings, audit reschedules, process cancellations, and update statuses.
Appointments (appointments) transition through five defined statuses:
- pending: Slot tentatively reserved, awaiting staff review or deposit confirmation.
- confirmed: Appointment locked in the calendar; customer and staff notified.
- completed: Customer attended the appointment.
- cancelled: Appointment cancelled by customer or staff.
- no_show: Customer failed to arrive without prior cancellation.
Rescheduling can be initiated by customers via AI dialogue or manually by staff in the dashboard via rescheduleAppointmentAction:
1. The system verifies that the new target time slot is open and available.
2. The appointment start time is updated.
3. A record is added to appointment_reschedules tracking oldStartTime, newStartTime, reason, and requestedBy (customer vs staff).
4. An automated confirmation SMS/email is dispatched with the new time.
Cancellations executed via cancelAppointmentAction:
1. The appointment status changes to cancelled.
2. A record is written to appointment_cancellations storing reason and cancelledBy.
3. The time slot immediately re-opens on the calendar for other customers to book.
Every status change is logged in appointment_status_history:
- Tracks timestamp, old status, new status, and the user or system actor responsible.
- Guarantees transparency if disputes arise regarding who cancelled or modified a booking.