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 fromget_available_products()
.location – An
AppointmentLocation
, as obtained fromget_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 thecurrent_products
.- Parameters
current_products – List of
AppointmentProduct
, as obtained from anotherget_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
andlocation
.- Parameters
products – List of
AppointmentProduct
, as obtained fromget_available_products()
.location – An
AppointmentLocation
, as obtained fromget_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 afterstart_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 fromget_available_products()
. :returns: List ofAppointmentLocation
- 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
andday
.- 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