Skip to main content

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:

NameDescriptionRequired
ServiceThe service for which slots will be fetched. Selected from available services within the contract specified in the Integration Settings.Yes
Event TypeThe 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 displayOptional parameter limiting the number of slots displayed to the user. Leave blank to show all available slots.No
Empty optionText to display as the default empty option in the dropdown.No
RequiredWhether selection of a slot is required to continue.No
Help textAdditional information displayed to users about slot selection.No

Configuring a "Reserve Available Slots" Component

Component Inputs

The component requires specific inputs to successfully fetch a list of available slots:

InputDescriptionRequired
UPRNThe UPRN of the property, typically from an address lookup componentYes
Date FromThe start date of the search period for available slotsYes
Date ToThe end date of the search period for available slotsYes
Extended data fieldsInputs for each of the Extended Data fields defined by the Event Type that the component is configured forVaries

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.

Input mapping for "Reserve Available Slots" Component

Variables and integration with Connect

When a slot is selected, the component makes several values available as variables for use elsewhere in the form:

VariableDescription
Event GUIDA unique identifier generated for the event that persists throughout the booking process
Selected Slot StartThe start date/time of the selected slot
Selected Slot EndThe end date/time of the selected slot
Selected Reservation IDsA 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:

  1. When initialised, it generates a unique Event GUID for use throughout the process
  2. It constructs an appropriate request to Echo's ReserveAvailableSlotsForEvent endpoint based on the component settings and mapped input values
  3. Available slots are presented to the user in a dropdown format
  4. When a user selects a slot, the component stores the Task Reservation IDs, Event GUID, and scheduled time
  5. 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'