NextGen FSM
2026 Wave Two 2026 Wave Three 2026 Wave One
2026 Wave Two 2026 Wave Three 2026 Wave One

Cancel Date Request

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

TEMPORARY


(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.

SCHEDULED (Future)


(e.g., User cancels a confirmed booking)

Checks the Cancellation Cut-off limit:


  • If Appt Date >= Cut-off (Valid): The appointment status is officially changed to CANCELLED. The system restores the availability of the Time Slot, allowing it to be booked by another customer.


  • If Appt Date < Cut-off (Too Late): The system aborts the cancellation to prevent last-minute schedule gaps, returning the error: "Attempted re-scheduling or cancellation exceeding time limit".

SCHEDULED (Past)


(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: "Expired appointment cannot be cancelled".

CANCELLED


(e.g., Duplicate API cancellation call)

Aborts execution. Returns the error: "Error: already cancelled appointment".