Appointment plugins

Appointment plugins should inherit from the base plugin.

Public Python API

Plugin base class

class openforms.appointments.base.BasePlugin(identifier: str)

Base Appointment plugin.

configuration_options

alias of openforms.appointments.base.EmptyOptions

abstract create_appointment(products: List[openforms.appointments.base.AppointmentProduct], location: openforms.appointments.base.AppointmentLocation, start_at: datetime.datetime, client: openforms.appointments.base.AppointmentClient, remarks: Optional[str] = None) str

Create an appointment.

Parameters
  • products – List of AppointmentProduct, as obtained from get_available_products().

  • location – An AppointmentLocation, as obtained from get_locations().

  • start_at – A datetime to start the appointment, as obtained from get_dates().

  • client – A AppointmentClient that holds client details.

  • remarks – A str for additional remarks, added to the appointment.

Returns

An appointment identifier as str.

Raises

AppointmentCreateFailed – If the appointment could not be created.

abstract delete_appointment(identifier: str) None

Delete an appointment.

Parameters

identifier – A string that represents the unique identification of the appointment.

Raises

AppointmentDeleteFailed – If the appointment could not be deleted.

abstract get_appointment_details(identifier: str) openforms.appointments.base.AppointmentDetails

Get appointment details.

Parameters

identifier – A string that represents the unique identification of the appointment.

Returns

AppointmentDetails.

abstract get_available_products(current_products: Optional[List[openforms.appointments.base.AppointmentProduct]] = None) List[openforms.appointments.base.AppointmentProduct]

Retrieve all available products and services to create an appointment for.

You can pass current_products to only retrieve available products in combination with the current_products.

Parameters

current_products – List of AppointmentProduct, as obtained from another get_available_products() call.

Returns

List of AppointmentProduct

abstract get_dates(products: List[openforms.appointments.base.AppointmentProduct], location: openforms.appointments.base.AppointmentLocation, start_at: Optional[datetime.date] = None, end_at: Optional[datetime.date] = None) List[datetime.date]

Retrieve all available dates for given products and location.

Parameters
  • products – List of AppointmentProduct, as obtained from get_available_products().

  • location – An AppointmentLocation, as obtained from get_locations().

  • start_at – The start date to retrieve available dates for. Default: date.today().

  • end_at – The end date to retrieve available dates for. Default: 14 days after start_date.

Returns

List of date

abstract get_locations(products: List[openforms.appointments.base.AppointmentProduct]) List[openforms.appointments.base.AppointmentLocation]

Retrieve all available locations for given products.

Parameters

products – List of AppointmentProduct, as obtained from get_available_products(). :returns: List of AppointmentLocation

abstract get_times(products: List[openforms.appointments.base.AppointmentProduct], location: openforms.appointments.base.AppointmentLocation, day: datetime.date) List[datetime.datetime]

Retrieve all available times for given products, location and day.

Parameters
  • products – List of AppointmentProduct, as obtained from get_available_products.

  • location – An AppointmentLocation, as obtained from get_locations.

  • day – A date to retrieve available times for.

Returns

List of available datetime.

Module documentation