Package de.xima.fc.appointment
Class SubmittedAppointment
java.lang.Object
de.xima.fc.appointment.SubmittedAppointment
- All Implemented Interfaces:
Serializable
Represents the state of a submitted appointment form field. Used to determine which action to take, such as whether
to create or delete an appointment entity.
- Since:
- 6.5.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic SubmittedAppointment
forDeletedAppointment
(Appointment appointment) Creates a new appointment action for deleting an existing appointment.static List<SubmittedAppointment>
forFormData
(FieldName fieldName, UUID templateUuid, IFormDataAdapter formData, Map<UUID, Appointment> existingAppointmentsByUuid) Creates a new appointment action for a form submission.static List<SubmittedAppointment>
forFormData
(FieldName fieldName, UUID templateUuid, Map<String, List<String[]>> formValuesMap, Appointment appointment, AppointmentType appointmentType, int ordinalIndex) Creates a new appointment action for a form submission.int
getType()
Analyzes the submitted and existing data and decided which action needs to be taken.toString()
-
Method Details
-
getAppointmentUuid
- Returns:
- The submitted UUID of the appointment, if any.
-
getExistingAppointment
- Returns:
- The existing appointment for the form field, if any.
-
getFormValuesIndex
public int getFormValuesIndex()- Returns:
- The index in the form values array from which this appointment submission was created.
-1
for deleted appointments or when not created from a form value.
-
getExistingAppointmentType
- Returns:
- The
Appointment.getAppointmentType()
of thegetExistingAppointment()
, if any.
-
getFieldName
- Returns:
- The name of the form field with the appointment widget.
-
getSlotId
- Returns:
- The start time of the slot that the user want to book or change.
-
getTemplateUuid
- Returns:
- The UUID of the appointment template to which the slot belongs.
-
getType
Analyzes the submitted and existing data and decided which action needs to be taken.- Returns:
- The action to apply to the appointment.
-
getTypeUuid
- Returns:
- The submitted UUID of the appointment type for which an appointment should be booked or changed.
-
toString
-
forDeletedAppointment
Creates a new appointment action for deleting an existing appointment.- Parameters:
appointment
- The existing appointment that needs to be deleted.
-
forFormData
public static List<SubmittedAppointment> forFormData(FieldName fieldName, UUID templateUuid, IFormDataAdapter formData, Map<UUID, Appointment> existingAppointmentsByUuid) Creates a new appointment action for a form submission.- Parameters:
fieldName
- The name of the form field with the appointment widget.templateUuid
- The UUID of the corresponding appointment template.formData
- The form data that was submitted.existingAppointmentsByUuid
- A map between theAppointment.getUUID()
and the corresponding appointments. Must contain only the appointments for the current appointment template- Returns:
- The appointment submission descriptor.
-
forFormData
public static List<SubmittedAppointment> forFormData(FieldName fieldName, UUID templateUuid, Map<String, List<String[]>> formValuesMap, Appointment appointment, AppointmentType appointmentType, int ordinalIndex) Creates a new appointment action for a form submission.- Parameters:
fieldName
- The name of the form field with the appointment widget.templateUuid
- The UUID of the corresponding appointment template.formValuesMap
- The form data that was submitted.appointment
- An existing appointment, may benull
.appointmentType
- The appointment type of the given appointment.- Returns:
- The appointment submission descriptor.
-