Echo Reserve Available Slots Component
The Echo Reserve Available Slots Form Component allows users to select available time slots for services such as bulky waste collections by querying the Selected Interventions Echo API based on the property details and selected items.
Overview
This component performs the following key functions:
- Fetches available slots from Echo based on property information (UPRN), bulky items and a date range
- Displays available slots to users in a selectable list format
- Reserves the selected slot in Echo when the user makes a selection
- Handles slot re-reservation during form submission to manage expiration windows
When integrated with the Complex Datatype Logic component, it enables an end-to-end bulky collection booking process that correctly handles hierarchical data structures required by Echo.
Settings
When adding the component to a page template, the following settings need to be configured:
Name | Description | Required |
---|---|---|
Service | The service for which slots will be fetched. Selected from available services within the contract specified in the Integration Settings. | Yes |
Event Type | The event type for which slots will be fetched (e.g., Bulky Collection). Selected from available event types for the chosen service. | Yes |
Maximum number of slots to display | Optional parameter limiting the number of slots displayed to the user. Leave blank to show all available slots. | No |
Empty option | Text to display as the default empty option in the dropdown. | No |
Required | Whether selection of a slot is required to continue. | No |
Help text | Additional information displayed to users about slot selection. | No |
Component Inputs
The component requires specific inputs to successfully fetch a list of available slots:
Input | Description | Required |
---|---|---|
UPRN | The UPRN of the property, typically from an address lookup component | Yes |
Date From | The start date of the search period for available slots | Yes |
Date To | The end date of the search period for available slots | Yes |
Extended data fields | Inputs for each of the Extended Data fields defined by the Event Type that the component is configured for | Varies |
For Bulky Collection specifically, these inputs will include complex datatypes which hold the items to be collected, typically mapped from the Complex Datatype Logic component's output.
Variables and integration with Connect
When a slot is selected, the component makes several values available as variables for use elsewhere in the form:
Variable | Description |
---|---|
Event GUID | A unique identifier generated for the event that persists throughout the booking process |
Selected Slot Start | The start date/time of the selected slot |
Selected Slot End | The end date/time of the selected slot |
Selected Reservation IDs | A comma separated list of the reservation identifiers needed for pre-booking the collection. If pre-booking process failed, the reservation ids will be empty |
Slot Reservation Process
The component manages the reservation process as follows:
- When initialised, it generates a unique Event GUID for use throughout the process
- It constructs an appropriate request to Echo's ReserveAvailableSlotsForEvent endpoint based on the component settings and mapped input values
- Available slots are presented to the user in a dropdown format
- When a user selects a slot, the component stores the Task Reservation IDs, Event GUID, and scheduled time
- During form submission, the component will:
- Cancel the existing reservation
- Attempt to re-reserve the same slot with a fresh reservation window
- If successful, the new slot task reservation IDs will be made available through the variable
- If unsuccessful, the system will clear the existing task reservation IDs so that the event can be created without reserved slots
Working with Complex Datatypes
For services requiring complex data structures (like bulky waste collection), this component works in conjunction with the Complex Datatype Logic to properly handle the hierarchical data needed by Echo.
The Complex Datatype Logic produces a specially encoded string (Base64 with prefix JADUSIE:1:
) containing structured data that preserves the hierarchical relationship between parent and child elements and field type validations.
The Reserve Available Slots component can properly decode and process this structured data when fetching available slots, ensuring that all selected items (such as bulky waste items) are correctly included in the slot reservation process.
Error Handling
The component implements several error handling mechanisms:
- If Echo is unreachable or returns an error, an appropriate error message is displayed
- If re-booking fails because the slot is no longer available, the reservation IDs are cleared
Technical Considerations
- Reserved slots in Echo have a short (10 minute) expiration window
- If Echo's Extended Data field configuration changes while users have in-progress form submissions, this could cause failures during Event creation
- The component handles base64-encoded complex datatypes prefixed with
JADUSIE:1:
as generated by 'Selected Interventions Echo - Complex Datatype Logic'