Skip to content

Room Booking Workflow

Radch-enko edited this page Jul 24, 2025 · 2 revisions

Room Booking Workflow

This document describes the end-to-end process for booking meeting rooms within the Effective Office system, covering both the tablet client interface and backend Google Calendar integration. The workflow encompasses room selection, time scheduling, conflict validation, and calendar event creation.

For information about real-time availability updates and push notifications, see Real-time Availability System. For details about the quick reservation feature, see Fast Booking Feature.

Overview

The room booking workflow enables users to reserve meeting rooms through a tablet interface. The system validates availability, checks for conflicts, and synchronizes bookings with Google Calendar. The process supports both new booking creation and modification of existing bookings, with comprehensive validation and error handling throughout.

High-Level Booking Flow

high-level-booking-flow.svg

Technical Component Architecture

technical-component-architecture.svg

Booking Editor State Management

The BookingEditorComponent manages complex state transitions during the booking process:

State Field Purpose Validation
duration Meeting duration in minutes Must be positive
date Selected date and time Cannot be in the past
selectOrganizer Chosen meeting organizer Must exist in system
isBusyEvent Indicates scheduling conflicts Blocks booking creation
enableUpdateButton Controls action button state Based on all validations
isTimeInPastError Past time validation flag Shows snackbar error

Validation and Conflict Detection

validation-and-conflict-detection.svg

The conflict detection algorithm checks for time overlap using:

newEventStart < existingEventEnd && newEventEnd > existingEventStart

Backend Google Calendar Integration

The GoogleCalendarProvider handles the core booking operations:

Booking Creation Flow

booking-creation-flow.svg

Key Backend Methods

Method Purpose Returns
createEvent() Creates new Google Calendar event Booking with assigned ID
updateEvent() Modifies existing calendar event Updated Booking
deleteEvent() Removes calendar event Unit
checkBookingAvailability() Validates time slot availability Boolean
findEventsByWorkspace() Retrieves room's existing bookings List<Booking>

Error Handling and User Feedback

The booking workflow implements comprehensive error handling:

Client-Side Error States

Error Type Trigger User Feedback
isTimeInPastError Selected time is in the past Snackbar with localized message
isInputError Invalid organizer selection Form field validation highlight
isBusyEvent Room unavailable at selected time Disabled booking button
isErrorCreate Backend booking creation failed Button shows "Error creating event"
isErrorUpdate Backend booking update failed Button shows "Error"
isErrorDelete Backend booking deletion failed Button shows "Error deleting event"

Backend Exception Handling

The GoogleCalendarProvider throws specific exceptions:

  • OverlappingBookingException for scheduling conflicts
  • GoogleJsonResponseException for Google API errors
  • NullPointerException for failed event creation

Domain Model Transformations

The system performs several data transformations throughout the booking workflow:

Client Domain Models

  • EventInfo - Client-side representation of a booking event
  • Organizer - User who organizes the meeting
  • RoomInfo - Meeting room details

Backend Domain Models

  • Booking - Core domain model for room reservations
  • User - System user with email and role information
  • Workspace - Physical meeting room or space

API Data Transfer Objects

  • BookingRequestDTO - Client booking creation request
  • BookingResponseDTO - Server booking response
  • UserDTO - User information in API responses
Clone this wiki locally