Core Booking System

The Core Booking System is the central reservation management engine of the Hotelaro hotel management platform. It provides real-time room availability tracking, interactive calendar interfaces, booking operations, and reservation management capabilities. This system handles the core business logic for room bookings, availability calculations, and reservation state management across multiple hotel properties.

For information about the public-facing booking interface, see Frontend Website. For room and accommodation setup, see Setup & Configuration. For restaurant and POS operations, see Restaurant & POS System.

System Architecture

The Core Booking System operates as a multi-tenant system with three primary subsystems working together: the Calendar interface for visual booking management, the Bookings system for reservation processing, and the Room management system for accommodation configuration.

Core Booking System Architecture

Multi-Tenant Data Isolation

The system implements tenant isolation through the admin_uid field across all core tables, ensuring each hotel property maintains separate data boundaries while sharing the same application infrastructure.

Multi-Tenant Data Isolation

Calendar Interface System

The Calendar interface serves as the primary visual booking management tool, providing an interactive grid where users can view room availability, create reservations, and manage booking operations through drag-and-drop functionality.

Calendar Data Flow and Operations

Calendar Data Flow and Operations

Room Status and Housekeeping Management

The system provides comprehensive room status tracking through a context menu interface that allows staff to update housekeeping status directly from the calendar view.

Status Type Color Code Database Value Description
Ready #DFFFE2 ready Room cleaned and available
Dirty #FFD6D6 dirty Room needs housekeeping
Maintenance #FFF9C4 maintenance Room under repair
Not for Sale #E0E0E0 not-for-sale Room temporarily unavailable
House Use #ffe0c8 house-use Room used by hotel staff

Booking Management System

The Booking Management System handles the complete lifecycle of reservations, from initial creation through check-in, payment processing, and final checkout. It provides comprehensive search, filtering, and administrative capabilities for managing all reservation records.

Booking Data Structure and Relationships

Booking Data Structure and Relationships

Booking Search and Management Operations

The booking system provides advanced search capabilities with real-time filtering and pagination for efficient reservation management.

Operation Endpoint Method Key Functions
List Bookings bookings/get GET Search, filter, paginate reservations
Booking Details bookings/edit/{id} GET View full reservation details
Quick Search bookings/bookingsearch GET Search by booking reference
Delete Booking bookings/deleteit POST Cancel/remove reservations
No-Show Mark bookings/markasnoshow POST Mark reservation as no-show

Room Configuration System

The Room Configuration System manages the physical and logical setup of accommodations, including room types, individual rooms, floors, and amenities. This system provides the foundation for availability calculations and booking operations.

Room Hierarchy and Configuration

Room Hierarchy and Configuration

Reservation Processing Engine

The reservation processing engine handles the complex business logic for creating, updating, and managing bookings, including conflict detection, pricing calculations, and multi-room reservations.

Reservation Creation Workflow

Reservation Creation Workflow

Gap Management and Availability Logic

The system implements sophisticated gap management to prevent booking conflicts and ensure optimal room utilization through helper functions that calculate available booking windows.

Function Purpose Location
getNextBlockedDate() Find next reservation for room frontjavascript.php:83-97
getPrevEndDate() Find previous checkout date frontjavascript.php:100-114
capEndByGap() Limit booking end by next reservation frontjavascript.php:117-123
capStartByPrevEnd() Prevent overlap with previous booking frontjavascript.php:126-132

Integration Points and APIs

The Core Booking System provides several key integration endpoints that connect with other system components and external services.

Key API Endpoints

Endpoint Method Purpose Response
/calendar/getRooms POST Fetch room availability data Room array + reservations
/calendar/reservationcreate POST Create new reservation Success/error status
/calendar/reservationmove POST Move existing reservation Updated reservation data
/calendar/getBookingByBookId POST Get booking by book_id Booking details array
/bookings/get GET List bookings with pagination Paginated booking list
/bookings/markasnoshow POST Mark booking as no-show Status confirmation

Real-Time Calendar Updates

The calendar interface maintains real-time synchronization through AJAX polling and event-driven updates, ensuring all users see current availability and booking status.

Real-Time Update Cycle

Real-Time Calendar Updates