fix appointment cancellation

This commit is contained in:
2026-04-16 09:45:21 -06:00
parent be4932661d
commit a6056c11e4

View File

@@ -196,8 +196,9 @@ public class AppointmentService {
throw new ResourceNotFoundException("Appointment not found"); throw new ResourceNotFoundException("Appointment not found");
} }
if (!"Booked".equalsIgnoreCase(appointment.getAppointmentStatus())) { String status = appointment.getAppointmentStatus();
throw new IllegalArgumentException("Only booked appointments can be cancelled"); if (!"Booked".equalsIgnoreCase(status) && !"Scheduled".equalsIgnoreCase(status)) {
throw new IllegalArgumentException("Only booked or scheduled appointments can be cancelled");
} }
appointment.setAppointmentStatus("Cancelled"); appointment.setAppointmentStatus("Cancelled");