-
Notifications
You must be signed in to change notification settings - Fork 9
Booking Management
This document provides comprehensive room and workspace reservation functionality for the Effective Office platform. This system handles booking creation, updates, deletion, and availability checking through a pluggable calendar provider architecture. The core functionality integrates with external calendar systems (primarily Google Calendar) to maintain synchronized booking data and enable real-time updates.
For information about workspace and room management, see [Workspace Management](Workspace Management). For real-time notifications and calendar synchronization, see [Notifications & Real-time Updates](Notifications and Real-time Updates). For complete booking workflows from the client perspective, see [Room Booking Workflow](Room Booking Workflow).
The booking system uses a pluggable calendar provider architecture that allows different calendar implementations to be used based on configuration.
The booking domain model represents workspace reservations with support for recurring bookings and external calendar integration.
The GoogleCalendarProvider implements comprehensive Google Calendar integration with availability checking, event conversion, and workspace calendar mapping. For detailed instructions on setting up Google Workspace and Google Calendar for your organization, see Google Workspace & Calendar Integration.
| Feature | Implementation | Description |
|---|---|---|
| Availability Checking | checkBookingAvailability() |
Prevents overlapping bookings by querying existing events |
| Event Conversion |
convertToGoogleEvent() / convertToBooking()
|
Bidirectional conversion between domain models and Google Calendar events |
| Workspace Mapping | getCalendarIdByWorkspace() |
Maps workspace IDs to Google Calendar IDs |
| User Management | findOrCreateUserByEmail() |
Automatically creates system users for external calendar events |
| Recurrence Support | RecurrenceRuleConverter |
Converts between domain recurrence rules and Google Calendar RRULE format |
WorkspaceDomainServiceGoogle Calendar API
The booking API provides comprehensive CRUD operations with filtering, validation, and error handling.
| Method | Endpoint | Controller Method | Description |
|---|---|---|---|
GET |
/v1/bookings/{id} |
getBookingById() |
Retrieve specific booking |
GET |
/v1/bookings |
getBookings() |
List bookings with filters |
POST |
/v1/bookings |
createBooking() |
Create new booking |
PUT |
/v1/bookings/{id} |
updateBooking() |
Update existing booking |
DELETE |
/v1/bookings/{id} |
deleteBooking() |
Delete booking |
The API provides comprehensive exception handling for booking-specific errors:
| Exception | HTTP Status | Error Code | Description |
|---|---|---|---|
BookingNotFoundException |
404 | Not Found | Booking does not exist |
UserNotFoundException |
404 | Not Found | Owner/participant not found |
WorkspaceNotFoundException |
404 | Not Found | Workspace does not exist |
InvalidTimeRangeException |
400 | Bad Request | Invalid booking time range |
OverlappingBookingException |
409 | Conflict | Booking conflicts with existing event |
The system uses layered DTOs for API communication, validation, and data transformation.
The system implements robust availability checking to prevent double-booking and ensure data consistency.
The overlap detection uses interval comparison logic:
- Two bookings overlap if:
startTime < existingEnd && existingStart < endTime - Self-updates are excluded by comparing booking IDs
- The system queries only the specific time range for efficiency
The tablet client integrates with the booking system through mapped domain models and reactive UI components.
The isEditable flag controls whether users can modify bookings from the tablet interface, distinguishing between system-created bookings and external calendar events.