fix appointment cancellation

This commit is contained in:
2026-04-16 09:45:21 -06:00
parent 4e672859c3
commit 274986186f

View File

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