Package de.xima.fc.appointment
Class AppointmentBookingExecutor
- java.lang.Object
-
- de.xima.fc.appointment.AppointmentBookingExecutor
-
public class AppointmentBookingExecutor extends Object
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
Constructors Constructor Description AppointmentBookingExecutor(IEntityContext ec)
Creates a new handler for handling booking of an appointment.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelBookedAppointment(IAppointmentDeleteBookingParams params, Instant now)
Deletes (cancels) an existing appointment.Appointment
createBookedAppointment(IAppointmentCreateBookingParams params, Instant now)
Creates (books) a new appointment at a given time slot.Appointment
moveBookedAppointment(IAppointmentMoveBookingParams params, Instant now)
Updates (moves) an appointment to a different time slot.List<EAppointmentBookingError>
validateAppointments(IAppointmentValidateParams params, Instant now)
Validates whether the given appointments can be created or updated.
-
-
-
Constructor Detail
-
AppointmentBookingExecutor
public AppointmentBookingExecutor(IEntityContext ec)
Creates a new handler for handling booking of an appointment.- Parameters:
ec
- Entity context for accessing the database.
-
-
Method Detail
-
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.
-
-