Package de.xima.fc.api.entity
Class AppointmentAPI
- java.lang.Object
-
- de.xima.fc.api.ASubAPI
-
- de.xima.fc.api.entity.AEntityAPI<Appointment>
-
- de.xima.fc.api.entity.AppointmentAPI
-
public class AppointmentAPI extends AEntityAPI<Appointment>
API class for reading and writingAppointment
entities.- Since:
- 6.5.0
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from class de.xima.fc.api.entity.AEntityAPI
entityClass
-
-
Constructor Summary
Constructors Constructor Description AppointmentAPI()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cancelBookedAppointment(UserContext uc, IAppointmentDeleteBookingParams params)
Cancels the given appointment.Appointment
createBookedAppointment(UserContext uc, IAppointmentCreateBookingParams params)
Books the given appointment.List<Appointment>
getAllBy(UserContext uc, IAppointmentQueryParams queryParams)
Returns all appointments that match the given query parameters.Appointment
getByUUID(UserContext uc, String uuid)
Finds the appointment with the given UUID.Appointment
getByUUID(UserContext uc, UUID uuid)
Finds the appointment with the given UUID.Appointment
moveBookedAppointment(UserContext uc, IAppointmentMoveBookingParams params)
Moves an appointment to a different time and date.List<EAppointmentBookingError>
validateAppointments(UserContext uc, IAppointmentValidateParams params)
Validates whether the given appointments can be created or updated.-
Methods inherited from class de.xima.fc.api.entity.AEntityAPI
create, create, delete, delete, deleteAllBy, deleteById, deleteById, getAll, getAllBy, getAttributes, getAttributes, getBy, getById, getById, getEntityRefs, getSingleAttributes, getSingleAttributes, resultTotalCount, resultTotalCount, update, update
-
Methods inherited from class de.xima.fc.api.ASubAPI
getHandlerProvider
-
-
-
-
Method Detail
-
cancelBookedAppointment
public void cancelBookedAppointment(UserContext uc, IAppointmentDeleteBookingParams params) throws AppointmentBookingException
Cancels the given appointment. You should callvalidateAppointments(UserContext, IAppointmentValidateParams)
first if you have not done so yet.- Parameters:
uc
- Current user context for accessing the database.params
- Parameters with the appointment to cancel, must be a persisted entity.- Throws:
AppointmentBookingException
- When the booking could not be performed. SeeAppointmentBookingException.getBookingError()
for more details.
-
createBookedAppointment
public Appointment createBookedAppointment(UserContext uc, IAppointmentCreateBookingParams params) throws AppointmentBookingException
Books the given appointment. You should callvalidateAppointments(UserContext, IAppointmentValidateParams)
first if you have not done so yet.- Parameters:
uc
- Current user context for accessing the database.params
- Parameters with the appointment to book, must be a new (non-persisted) entity.- Returns:
- The persisted appointment.
- Throws:
AppointmentBookingException
- When the booking could not be performed. SeeAppointmentBookingException.getBookingError()
for more details.
-
getAllBy
public List<Appointment> getAllBy(UserContext uc, IAppointmentQueryParams queryParams)
Returns all appointments that match the given query parameters.- Parameters:
uc
- Current user context for accessing the database.queryParams
- Restrictions to apply the returned appointments.- Returns:
- All appointments that match the given query parameters.
-
getByUUID
public Appointment getByUUID(UserContext uc, String uuid)
Finds the appointment with the given UUID.- Parameters:
uc
- Current user context for accessing the database.uuid
- UUID of an appointment.- Returns:
- The appointment with the given UUID.
-
getByUUID
public Appointment getByUUID(UserContext uc, UUID uuid)
Finds the appointment with the given UUID.- Parameters:
uc
- Current user context for accessing the database.uuid
- UUID of an appointment.- Returns:
- The appointment with the given UUID.
-
moveBookedAppointment
public Appointment moveBookedAppointment(UserContext uc, IAppointmentMoveBookingParams params) throws AppointmentBookingException
Moves an appointment to a different time and date. You should callvalidateAppointments(UserContext, IAppointmentValidateParams)
first if you have not done so yet.- Parameters:
uc
- Current user context for accessing the database.params
- Parameters with the appointment to move.- Returns:
- The updated appointment from the database.
- Throws:
AppointmentBookingException
- When the booking could not be performed. SeeAppointmentBookingException.getBookingError()
for more details.
-
validateAppointments
public List<EAppointmentBookingError> validateAppointments(UserContext uc, IAppointmentValidateParams params)
Validates whether the given appointments can be created or updated.- Parameters:
uc
- Current user context for accessing the database.params
- Parameters with the appointments to validate.- Returns:
- The validation errors for each appointment.
-
-