-
Notifications
You must be signed in to change notification settings - Fork 0
Fast Booking System
The Fast Booking Feature provides a streamlined interface for immediate room reservations in the Effective Office system. This feature enables users to quickly book available meeting rooms for a minimum duration without navigating through the full booking editor workflow. The system automatically finds the most suitable available room and creates an instant booking.
For information about the complete booking workflow including custom duration and organizer selection, see Room Booking Workflow. For details about the booking editor interface, see Booking Features.
The Fast Booking Feature follows a component-based architecture with clear separation between presentation, domain logic, and data management.
The FastBookingComponent
serves as the main coordinator for the fast booking feature, implementing the ModalWindow
interface and managing the entire booking lifecycle.
Property | Type | Purpose |
---|---|---|
minEventDuration |
Int |
Minimum booking duration in minutes |
selectedRoom |
RoomInfo |
Currently selected room for booking |
rooms |
List<RoomInfo> |
Available rooms for booking |
onCloseRequest |
() -> Unit |
Callback to close the modal |
The component uses a MutableStateFlow<State>
to manage the booking state:
The room selection logic is handled by SelectRoomUseCase
which implements intelligent room selection:
- Primary Selection: Attempts to book the currently selected room if available
- Fallback Selection: Finds alternative rooms from the provided list
- Availability Calculation: Determines the nearest available room and wait time
The booking creation process involves:
The system creates an EventInfo
object with the current time as start time and adds the minimum duration:
Field | Value |
---|---|
startTime |
currentLocalDateTime.cropSeconds() |
finishTime |
currentInstant.plus(minDuration.minutes).asLocalDateTime.cropSeconds() |
id |
Generated by external calendar service |
When a user requests to free a room, the system:
- Sets loading state
- Calls
DeleteBookingUseCase
with the current event - Waits for external service synchronization
- Closes the modal on success
The component maintains real-time updates using BootstrapperTimer
:
- Update Interval: 1 minute
-
Timer Use Case:
TimerUseCase
for time calculations -
Current Time Display: Updates state with
currentLocalDateTime
The system implements comprehensive error handling:
Error Type | Handling Strategy | User Feedback |
---|---|---|
Room Selection Failure | Log error, show failure modal | "No available rooms" message |
Booking Creation Failure | Restore previous state, show error | Generic error message |
Network Timeout | Retry logic in use cases | Loading state with timeout |
Calendar Sync Delay | Built-in delays for external sync | Loading indicators |
The system includes explicit delays to account for external service synchronization:
- Booking Creation: 2000ms delay after successful creation
- Booking Deletion: 3000ms delay after successful deletion
These delays ensure that external calendar services have time to process changes before the UI updates.