The CancelDate web service is invoked by an external system (e.g., Middleware, Customer Portal) to formally annul an existing appointment within the Booking module.
Depending on the current status of the appointment and the configured time constraints, this service safely handles the cancellation, releases the locked capacity back into the scheduling pool, or blocks the action if it violates business rules.
Input Validation
Before processing the cancellation, the Booking module performs a strict data match check.
-
ID Mismatch: The system cross-references the external request ID (
requestCode) with the internal Appointment ID (appointmentId). If they do not match, the system blocks the execution and returns the error:"Incorrect Appointment".
System Impact & Routing Logic
The system executes conditional logic based on the appointment's current status and its relation to the "Cancellation Cut-off" time limit.
|
Appointment Status |
System Logic & Execution Behavior |
|
(e.g., User abandons the booking flow manually) |
Immediate Deletion.
The system physically deletes the temporary appointment record from the database and instantly resets/restores the availability of the associated Time Slot. |
|
(e.g., User cancels a confirmed booking) |
Checks the Cancellation Cut-off limit:
|
|
(e.g., User tries to cancel a job that was already supposed to happen) |
Aborts execution. The system recognizes the time slot is in the past and returns the error: |
|
(e.g., Duplicate API cancellation call) |
Aborts execution. Returns the error: |