Class AppointmentLoadOrCreateInput

java.lang.Object
overit.geocallapp.wfm.scheduling.appointment.event.AppointmentLoadOrCreateInput
All Implemented Interfaces:
Serializable

public class AppointmentLoadOrCreateInput extends Object implements Serializable
Input for the appointment load or create event. This event handles loading an existing OPEN appointment for a work order operation, or creating a new one if none exists. This replaces the legacy pattern of caricaOCreaAppuntamento used in DATSchedulazioneOdl.

The event logic:

  • Searches for the last appointment for the work order operation
  • If status is OPEN (APERTO), reuses it
  • If status is SCHEDULED (PIANIFICATO) and multiple assignment is disabled, throws error
  • If status is SCHEDULED and multiple assignment is enabled, creates new appointment
  • If no appointment exists, creates new appointment
  • Returns the appointment data as HashGetter for compatibility with legacy code
Since:
22.0
See Also:
  • Constructor Details

    • AppointmentLoadOrCreateInput

      public AppointmentLoadOrCreateInput()
  • Method Details

    • getWorkOrderOperationId

      public Long getWorkOrderOperationId()
      Gets the work order operation ID.
      Returns:
      the work order operation ID
    • setWorkOrderOperationId

      public void setWorkOrderOperationId(Long workOrderOperationId)
      Sets the work order operation ID.
      Parameters:
      workOrderOperationId - the work order operation ID to set
    • getWorkOrderOperationData

      public HashGetter getWorkOrderOperationData()
      Gets the work order operation data (optional). If provided, this HashGetter contains the complete work order operation data and will be used to create the appointment. If not provided, the data will be loaded from the database using the workOrderOperationId. This is typically used when the caller already has the operation data loaded (e.g., from a previous query) to avoid redundant database access.
      Returns:
      the work order operation data
    • setWorkOrderOperationData

      public void setWorkOrderOperationData(HashGetter workOrderOperationData)
      Sets the work order operation data.
      Parameters:
      workOrderOperationData - the work order operation data to set