Package de.xima.fc.appointment
Class AppointmentBookingExecutor
java.lang.Object
de.xima.fc.appointment.AppointmentBookingExecutor
Executor with the logic for booking appointments, canceling appointments, or moving appointments to another date.
- Since:
- 6.5.0
- Author:
- XIMA MEDIA GmbH
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new handler for handling booking of an appointment. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Deletes (cancels) an existing appointment.Creates (books) a new appointment at a given time slot.moveBookedAppointment
(IAppointmentMoveBookingParams params, Instant now) Updates (moves) an appointment to a different time slot.validateAppointments
(IAppointmentValidateParams params, Instant now) Validates whether the given appointments can be created or updated.
-
Constructor Details
-
AppointmentBookingExecutor
Creates a new handler for handling booking of an appointment.- Parameters:
ec
- Entity context for accessing the database.
-
-
Method Details
-
cancelBookedAppointment
public void cancelBookedAppointment(IAppointmentDeleteBookingParams params, Instant now) throws AppointmentBookingException Deletes (cancels) an existing appointment. You should callvalidateAppointments(IAppointmentValidateParams, Instant)
first if you have not done so yet.- Parameters:
params
- Parameters of the delete operation.now
- The current server time.- Throws:
AppointmentBookingException
- When the appointment could not be deleted.
-
createBookedAppointment
public Appointment createBookedAppointment(IAppointmentCreateBookingParams params, Instant now) throws AppointmentBookingException Creates (books) a new appointment at a given time slot. You should callvalidateAppointments(IAppointmentValidateParams, Instant)
first if you have not done so yet.- Parameters:
params
- Parameters of the book operation.now
- The current server time.- Returns:
- The newly created appointment.
- Throws:
AppointmentBookingException
- When the appointment could not be booked.
-
moveBookedAppointment
public Appointment moveBookedAppointment(IAppointmentMoveBookingParams params, Instant now) throws AppointmentBookingException Updates (moves) an appointment to a different time slot. You should callvalidateAppointments(IAppointmentValidateParams, Instant)
first if you have not done so yet.- Parameters:
params
- Parameters of the move operation.now
- The current server time.- Returns:
- The updated appointment.
- Throws:
AppointmentBookingException
- When the appointment could not be moved.
-
validateAppointments
public List<EAppointmentBookingError> validateAppointments(IAppointmentValidateParams params, Instant now) Validates whether the given appointments can be created or updated.- Parameters:
params
- Parameters with the appointments to validate.now
- The current server time.- Returns:
- The validation errors for each appointment.
-