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
EmptyOptions
- abstract create_appointment(products: list[Product], location: Location, start_at: datetime, client: CustomerDetails[F] | Customer, remarks: str = '') str
Create an appointment.
- Parameters:
products – List of
Product
, as obtained fromget_available_products()
.location – An
Location
, as obtained fromget_locations()
.start_at – A datetime to start the appointment, as obtained from
get_dates()
.client – A
Customer
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) AppointmentDetails
Get appointment details.
- Parameters:
identifier – A string that represents the unique identification of the appointment.
- Returns:
AppointmentDetails
.
- abstract get_available_products(current_products: list[Product] | None = None, location_id: str = '') list[Product]
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
Product
, as obtained from anotherget_available_products()
call.location_id – ID of the location to filter products on - plugins may support this.
- Returns:
List of
Product
- abstract get_dates(products: list[Product], location: Location, start_at: date | None = None, end_at: date | None = None) list[date]
Retrieve all available dates for given
products
andlocation
.- Parameters:
products – List of
Product
, as obtained fromget_available_products()
.location – An
Location
, 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[Product] | None = None) list[Location]
Retrieve all available locations.
- Parameters:
products – List of
Product
, as obtained fromget_available_products()
. IfNone
or unspecified, all possible locations are returned. Otherwise, if the plugin supports it, locations are filtered given the products.- Returns:
List of
Location
- abstract get_required_customer_fields(products: list[Product]) list[Component]
Given a list of products, return the additional required customer fields.
The fields are returned as a Form.io components array, including possible useful autocomplete attributes. This should make it easy to render the fields using existing tooling.
- abstract get_times(products: list[Product], location: Location, day: date) list[datetime]
Retrieve all available times for given
products
,location
andday
.- Parameters:
products – List of
Product
, as obtained from get_available_products.location – An
Location
, as obtained from get_locations.day – A
date
to retrieve available times for.
- Returns:
List of available
datetime
.
Module documentation