Skip to content

FrontDesk Module Documentation

Overview

The FrontDesk module is the operational heart of the OLOW Hotel ERP system. It manages the complete guest journey from reservation to checkout, including room management, bookings, folios (guest ledgers), check-in/check-out processes, and integration with all other hotel systems.

Key Features

  • Reservations & Bookings: Complete booking lifecycle management
  • Room Management: Room types, rates, availability tracking
  • Check-In/Check-Out: Streamlined guest arrival and departure workflows
  • Folios: Guest billing ledgers with charges and payments
  • Group Bookings: Manage multiple reservations together
  • Rate Management: Dynamic pricing, rate plans, seasonal rates
  • Room Blocks: Reserve rooms for events or groups
  • Guest Profiles: Preferences, notes, loyalty programs
  • Revenue Management: Occupancy-based pricing optimization
  • Loyalty Programs: Points-based rewards system

Architecture

Domain Layer (app/Domain/FrontDesk)

Models (27 Models)

Core Booking Models

Booking (Booking.php)

  • Central reservation record
  • Table: bookings
  • Key Fields:
    • booking_number: Unique booking reference
    • customer_id: Guest making reservation
    • check_in_date, check_out_date: Stay dates
    • status: CONFIRMED | CHECKED_IN | CHECKED_OUT | CANCELLED | NO_SHOW | EXPIRED
    • source: WALK_IN | WEBSITE | PHONE | OTA
    • total_adults, total_children: Guest count
    • booking_group_id: For group reservations (nullable)
    • use_master_folio: Group billing flag
  • Relationships:
    • customer(): Guest
    • rooms(): BookingRoom records
    • folio(): Guest billing ledger
    • bookingGroup(): Group if part of group booking
  • Computed Attributes:
    • total_amount: Sum of folio charges
    • total_paid: Sum of payments
    • balance_due: Amount outstanding
    • stay_nights: Number of nights
    • is_group_booking: Boolean
  • Traits: BelongsToProperty, SoftDeletes

BookingRoom (BookingRoom.php)

  • Pivot table linking bookings to rooms
  • Table: booking_rooms
  • Key Fields:
    • booking_id: Parent booking
    • room_type_id: Requested room type
    • room_id: Assigned physical room (nullable until check-in)
    • room_rate_plan_id: Rate plan used
    • nightly_rate: Locked-in rate
    • adults, children: Occupancy
    • booked_as_room_type_id: Original room type if upgraded
  • Relationships:
    • booking(): Parent booking
    • roomType(): Requested type
    • room(): Assigned room
    • ratePlan(): Rate plan
Room Models

Room (Room.php)

  • Physical room inventory
  • Table: rooms
  • Key Fields:
    • room_number: Unique room identifier
    • room_type_id: Room category
    • floor: Floor number
    • status: CLEAN | DIRTY | INSPECTED | OUT_OF_ORDER | MAINTENANCE
    • is_active: Active flag
  • Relationships:
    • type(): RoomType
    • bookingRooms(): Current and future bookings
    • housekeepingAssignment(): Assigned housekeeper
    • housekeepingTasks(): Cleaning tasks
    • maintenanceIssues(): Maintenance tickets
    • activeBlocks(): Room blocks
  • Scopes:
    • scopeAvailable($startDate, $endDate): Available rooms for period
  • Computed Attributes:
    • assigned_staff: Current housekeeper
    • is_blocked: Has active block
  • Traits: BelongsToProperty

RoomType (RoomType.php)

  • Room categories (Standard, Deluxe, Suite, etc.)
  • Table: room_types
  • Key Fields:
    • name: Type name
    • description: Full description
    • base_occupancy: Standard guest count
    • max_occupancy: Maximum guests
    • base_rate: Default nightly rate
    • sort_order: Display order
  • Relationships:
    • rooms(): Physical rooms of this type
    • images(): Room type photos
    • amenities(): Features (many-to-many)
    • rates(): Rate plans
  • Traits: BelongsToProperty

RoomRate (RoomRate.php)

  • Dated pricing for room types
  • Table: room_rates
  • Key Fields:
    • room_type_id: Room category
    • rate_date: Specific date
    • rate: Price for that date
    • occupancy_1_rate, occupancy_2_rate, etc.: Per-guest pricing
  • Traits: BelongsToProperty

RoomRatePlan (RoomRatePlan.php)

  • Named rate plans (Standard, Corporate, AAA, etc.)
  • Table: room_rate_plans
  • Key Fields:
    • name: Plan name
    • code: Short code
    • discount_type: PERCENTAGE | FIXED
    • discount_value: Discount amount
    • is_public: Visible to guests
  • Traits: BelongsToProperty
Folio Models (Guest Billing)

Folio (Folio.php)

  • Guest billing ledger
  • Table: folios
  • Key Fields:
    • booking_id: Associated booking
    • customer_id: Bill-to party
    • status: OPEN | CLOSED | VOID
    • notes: Billing notes
  • Relationships:
    • booking(): Parent booking
    • customer(): Bill-to party
    • lines(): Charges
    • payments(): Payments
  • Computed Attributes:
    • total_charges: Sum of charges
    • total_payments: Sum of payments
    • balance: Amount due
  • Traits: BelongsToProperty

FolioLine (FolioLine.php)

  • Individual charges
  • Table: folio_lines
  • Key Fields:
    • folio_id: Parent folio
    • trans_date: Transaction date
    • type: ROOM | TAX | SERVICE | POS | GYM | HALL | MINIBAR | LAUNDRY | ADJUSTMENT | DISCOUNT
    • description: Charge description
    • amount: Amount (negative for discounts)
    • revenue_account_id: GL account mapping
    • relatable_type, relatable_id: Source record (polymorphic)
    • is_voided: Void flag
    • voided_by, voided_at, void_reason: Void tracking
  • Relationships:
    • folio(): Parent folio
    • revenueAccount(): GL account
    • relatable(): Source (BookingRoom, PosOrder, etc.)

FolioPayment (FolioPayment.php)

  • Guest payments
  • Table: folio_payments
  • Key Fields:
    • folio_id: Parent folio
    • trans_date: Payment date
    • amount: Payment amount (negative for refunds)
    • method: CASH | CARD | BANK | MOBILE | WALLET | DEPOSIT_APPLICATION
    • reference: Transaction reference
    • cash_account_id: GL account (Added via 2026_01_27 migration)
    • is_refund: Refund flag
    • original_payment_id: If refund, original payment
    • is_deposit: True if advance deposit
    • is_deposit_application: True if applying deposit to balance
  • Relationships:
    • folio(): Parent folio
    • cashAccount(): GL cash account
Advanced Features

BookingGroup (BookingGroup.php)

  • Group reservations
  • Table: booking_groups
  • Key Fields:
    • group_name: Group identifier
    • organization: Company/organization
    • total_rooms: Room count
    • master_folio_id: Consolidated billing
    • billing_contact, billing_email: Billing info
  • Relationships:
    • bookings(): Individual bookings
    • masterFolio(): Group billing folio
  • Traits: BelongsToProperty

RoomBlock (RoomBlock.php)

  • Reserved room inventory
  • Table: room_blocks
  • Key Fields:
    • block_name: Block identifier
    • room_type_id: Room category
    • quantity: Number of rooms
    • start_date, end_date: Block period
    • rate: Special rate (nullable)
    • is_active: Active flag
    • released_at: Release date
  • Scopes:
    • scopeActive(): Active blocks
    • scopeOverlapping($start, $end): Blocks in period
  • Traits: BelongsToProperty

LoyaltyAccount (LoyaltyAccount.php)

  • Guest loyalty program accounts
  • Table: loyalty_accounts
  • Key Fields:
    • customer_id: Guest
    • tier_id: Loyalty tier
    • points_balance: Current points
    • lifetime_points: Total earned
    • member_since: Join date
  • Relationships:
    • customer(): Guest
    • tier(): Loyalty tier
    • transactions(): Point transactions
  • Traits: BelongsToProperty

GuestPreference (GuestPreference.php)

  • Guest preferences and special requests
  • Table: guest_preferences
  • Key Fields:
    • customer_id: Guest
    • preference_type: ROOM_TYPE | FLOOR | BED_TYPE | AMENITIES | DIETARY | OTHER
    • preference_value: Preference details
    • notes: Additional notes
  • Traits: BelongsToProperty

PricingRule (PricingRule.php)

  • Dynamic pricing rules
  • Table: pricing_rules
  • Key Fields:
    • rule_name: Rule identifier
    • room_type_id: Applicable room type (nullable for all)
    • condition_type: OCCUPANCY | DAY_OF_WEEK | SEASON | BOOKING_WINDOW
    • condition_value: Condition details (JSON)
    • adjustment_type: PERCENTAGE | FIXED
    • adjustment_value: Price adjustment
    • priority: Rule priority
    • is_active: Active flag
  • Traits: BelongsToProperty

Services (19 Services)

BookingService (BookingService.php)

Purpose: Core booking lifecycle management

Dependencies:

  • FolioService
  • InvoiceService
  • ReceiptService
  • SmsService
  • AccountingPoster
  • GuestJourneyService
  • RevenueManagementService

Key Methods:

createReservation(array $data): Booking

Creates a new reservation

php
$booking = $bookingService->createReservation([
    'customer_id' => $customer->id,
    'check_in_date' => '2026-02-01',
    'check_out_date' => '2026-02-05',
    'total_adults' => 2,
    'total_children' => 0,
    'rooms' => [
        [
            'room_type_id' => $roomType->id,
            'adults' => 2,
            'nightly_rate' => 150.00,
            'room_rate_plan_id' => $ratePlan->id,
        ]
    ],
    'source' => 'WEBSITE',
    'notes' => 'Anniversary celebration',
]);

Process:

  1. Validates availability
  2. Creates booking record
  3. Creates booking_rooms records
  4. Creates folio
  5. Sends confirmation SMS
  6. Returns booking
assignRoom(BookingRoom $bookingRoom, Room $room): void

Assigns physical room to booking

Features:

  • Pessimistic locking to prevent race conditions
  • Updates room status
  • Logs activity
checkIn(Booking $booking): void

Processes guest check-in

Process:

  1. Validates booking status
  2. Ensures rooms assigned
  3. Adds room charges to folio (if not already added)
  4. Changes status to CHECKED_IN
  5. Updates room status to OCCUPIED
  6. Sends welcome SMS
  7. Logs activity
checkOut(Booking $booking): void

Processes guest checkout

Process:

  1. Finalizes all charges
  2. Calculates final balance
  3. Checks balance paid (throws if outstanding)
  4. Generates AR invoice
  5. Closes folio
  6. Changes status to CHECKED_OUT
  7. Updates room status to DIRTY
  8. Logs activity
  9. Processes loyalty points
transitionStatus(Booking $booking, BookingStatusEnum $newStatus, ?string $notes = null): void

State machine for booking statuses

Valid Transitions:

CONFIRMED → CHECKED_IN
CONFIRMED → CANCELLED
CONFIRMED → NO_SHOW
CHECKED_IN → CHECKED_OUT
FolioService (FolioService.php)

Purpose: Guest billing ledger management

Dependencies:

  • AccountingPoster
  • TaxEngine
  • SmsService

Key Methods:

createFolioForBooking($booking): Folio

Creates folio for new booking

addCharge(Folio $folio, string $type, string $description, float $amount, ...): FolioLine

Adds charge to guest ledger

php
$folioService->addCharge(
    folio: $folio,
    type: 'ROOM',
    description: 'Deluxe Room - Night 1',
    amount: 150.00,
    revenueAccountId: $roomRevenueAccount->id,
    relatable: $bookingRoom,
    applyTax: true
);

Process:

  1. Creates folio line
  2. Calculates tax (if applicable)
  3. Creates tax folio line
  4. Posts to accounting (debit AR, credit Revenue)
  5. Sends SMS notification (if configured)
addPayment(Folio $folio, string $method, float $amount, ...): FolioPayment

Records guest payment

Process:

  1. Creates folio payment record
  2. Posts to accounting (debit Cash, credit AR)
  3. Updates folio balance
applyDiscount(Folio $folio, string $type, float $amount, string $reason, ...): FolioLine

Applies discount to folio

Types:

  • PERCENTAGE: Percentage off total
  • FIXED: Fixed amount off

Creates: Negative folio line

voidCharge(FolioLine $line, string $reason, ...): void

Voids a folio charge

Process:

  1. Marks original line as voided
  2. Creates reversal line
  3. Reverses accounting entry
  4. Logs activity
recordDeposit(Folio $folio, string $method, float $amount, ...): FolioPayment

Records advance deposit

Accounting:

Debit: Cash
Credit: Customer Deposits (Liability)
applyDepositsToBalance(Folio $folio): void

Applies deposits at checkout

Accounting:

Debit: Customer Deposits
Credit: Accounts Receivable
AvailabilityService (AvailabilityService.php)

Purpose: Room availability checking

Key Methods:

checkAvailability(RoomType $roomType, Carbon $checkIn, Carbon $checkOut, int $quantity = 1): bool

Checks if rooms available

Considers:

  • Existing bookings
  • Room blocks
  • Out of order rooms
  • Maintenance status
getAvailableRoomTypes(Carbon $checkIn, Carbon $checkOut): Collection

Returns all available room types for period

RateService (RateService.php)

Purpose: Rate calculation and management

Key Methods:

calculateRate(RoomType $roomType, Carbon $date, int $occupancy, ...): float

Calculates rate for specific date

Considers:

  • Base room rate
  • Seasonal rates
  • Pricing rules (occupancy-based, day-of-week, etc.)
  • Rate plan discounts
getRateForPeriod(RoomType $roomType, Carbon $checkIn, Carbon $checkOut, ...): float

Calculates total for date range

RevenueManagementService (RevenueManagementService.php)

Purpose: Dynamic pricing optimization

Key Methods:

calculateOptimalRate(RoomType $roomType, Carbon $date): float

Recommends rate based on occupancy forecasts

Factors:

  • Current occupancy
  • Historical occupancy
  • Forward bookings
  • Competitor rates (if integrated)
  • Demand patterns
BookingCancellationService (BookingCancellationService.php)

Purpose: Handles booking cancellations

Key Methods:

cancel(Booking $booking, string $reason, bool $applyPenalty = false): void

Cancels a booking

Process:

  1. Validates cancellation allowed
  2. Calculates cancellation penalty (if applicable)
  3. Processes refunds
  4. Voids folio charges
  5. Updates booking status
  6. Releases rooms
  7. Sends cancellation email/SMS
Additional Services
  • BookingDateChangeService: Modify reservation dates
  • RoomChangeService: Move guest to different room
  • BookingMergeService: Merge multiple bookings
  • GroupBookingService: Manage group reservations
  • RoomBlockService: Manage room blocks
  • LoyaltyService: Loyalty points and rewards
  • GuestProfileService: Guest preference management
  • GuestJourneyService: Track guest interactions
  • EarlyLateCheckService: Early check-in/late checkout
  • BookingInvoicePdfService: Generate invoices

Database Schema

Core Tables

mermaid
erDiagram
    BOOKING ||--o{ BOOKING_ROOM : contains
    BOOKING ||--|| FOLIO : "has ledger"
    BOOKING }o--|| CUSTOMER : "booked by"
    BOOKING }o--o| BOOKING_GROUP : "belongs to"

    BOOKING_ROOM }o--|| ROOM_TYPE : "requests"
    BOOKING_ROOM }o--o| ROOM : "assigned to"
    BOOKING_ROOM }o--o| ROOM_RATE_PLAN : "uses plan"

    ROOM }o--|| ROOM_TYPE : "is type"
    ROOM_TYPE ||--o{ ROOM_RATE : "has rates"

    FOLIO ||--o{ FOLIO_LINE : "has charges"
    FOLIO ||--o{ FOLIO_PAYMENT : "has payments"

    FOLIO_LINE }o--o| ACCOUNTING_ACCOUNT : "posts to"

Integration with Other Modules

Accounting Integration

Every folio transaction posts to the general ledger:

Room Charge:

php
// When charge added to folio
Debit: Accounts Receivable (Guest)
Credit: Room Revenue
Credit: Tax Payable (if applicable)

Guest Payment:

php
// When payment received
Debit: Cash / Bank
Credit: Accounts Receivable (Guest)

Checkout & Invoice:

php
// At checkout, folio becomes AR invoice
// Invoice automatically created from folio
// Already posted to GL via folio charges/payments

Housekeeping Integration

  • Room status synchronized
  • Cleaning tasks auto-created on checkout
  • Room ready notifications

Maintenance Integration

  • Out of order rooms excluded from availability
  • Maintenance tickets linked to rooms

SMS Integration

  • Booking confirmations
  • Pre-arrival messages
  • Folio charge notifications
  • Checkout summaries

Loyalty Integration

  • Points earned on checkout
  • Tier-based benefits
  • Automatic upgrades

Common Workflows

1. Create a Reservation

User: Front Desk Staff

  1. Navigate to FrontDesk > Reservations
  2. Click + New Reservation
  3. Select guest (or create new guest)
  4. Enter check-in and check-out dates
  5. Select room type and quantity
  6. Review rate calculation
  7. Add any special requests or notes
  8. Confirm reservation
  9. System creates booking and folio
  10. Confirmation sent to guest

2. Check-In a Guest

User: Front Desk Staff

  1. Navigate to FrontDesk > Check-In
  2. Find booking (by confirmation #, name, or date)
  3. Verify guest information
  4. Assign physical room(s) if not pre-assigned
  5. Collect payment or authorize card
  6. Review room charges
  7. Complete check-in
  8. Print room keys/cards
  9. Room status changes to OCCUPIED

3. Add Charges to Stay

User: Various Staff

Via Folio:

  1. Open booking > View Folio
  2. Click + Add Charge
  3. Select charge type (SERVICE, MINIBAR, etc.)
  4. Enter amount and description
  5. Save charge
  6. Charge posts to GL immediately

Via Integrated Modules:

  • POS charges auto-post to folio
  • Gym day pass charges auto-post
  • Hall event charges auto-post

4. Check-Out a Guest

User: Front Desk Staff

  1. Navigate to booking
  2. Click Check Out
  3. Review final folio
  4. Process final payment if balance due
  5. System:
    • Closes folio
    • Generates AR invoice
    • Changes booking status
    • Sets room to DIRTY
    • Sends receipt email/SMS
    • Awards loyalty points
  6. Print receipt

5. Handle Group Booking

User: Front Desk Manager

  1. Navigate to FrontDesk > Group Bookings
  2. Click + New Group
  3. Enter group details (name, organization, contact)
  4. Add individual reservations
  5. Choose billing method:
    • Individual Folios: Each guest pays separately
    • Master Folio: Group pays together
  6. Save group
  7. Individual bookings created
  8. Master folio created (if selected)

Configuration

Room Types Setup

  1. Navigate to FrontDesk > Room Types
  2. Create categories (Standard, Deluxe, Suite, etc.)
  3. Set base occupancy and max occupancy
  4. Set base rate
  5. Upload photos
  6. Assign amenities

Rate Plans Setup

  1. Navigate to FrontDesk > Rate Plans
  2. Create plans (Standard, Corporate, AAA, Government, etc.)
  3. Set discount type and value
  4. Set public visibility
  5. Assign to room types

Seasonal Rates

  1. Navigate to FrontDesk > Rate Management
  2. Select date range
  3. Override rates for specific dates
  4. System uses override rates in calculations

Known Issues (from Audit)

Issues Found

MAJOR

MAJ-FD-001: Folio Payment Missing cash_account_id Field

  • Location: folio_payments table
  • Status: [FIXED]
  • Description: Added cash_account_id field via migration 2026_01_27_000001.
  • Priority: P1

MAJ-FD-002: Missing Deposit Tracking Fields

  • Location: folio_payments table
  • Status: [FIXED]
  • Description: Added is_deposit, is_deposit_application, original_payment_id via migration 2026_01_27_000001.
  • Priority: P1

MINOR

MIN-FD-001: Booking Status ENUM Limitation

  • Location: Booking migration, uses string instead of enum
  • Description: Status stored as string, no database-level constraint
  • Impact: Potential for invalid status values
  • Fix: Consider using ENUM or CHECK constraint
  • Priority: P3

MIN-FD-002: Missing folio_type Field

  • Location: folios table
  • Description: No way to distinguish guest folios from master folios
  • Impact: Querying group vs individual folios requires joins
  • Fix: Add folio_type enum field
  • Priority: P3

Best Practices

For Developers

  1. Always use services: Don't create bookings/folios directly
  2. Use transactions: Booking creation is multi-step
  3. Check availability: Before confirming bookings
  4. Log activities: Use BookingActivity for audit trail
  5. Send notifications: Use SmsService for guest communications

For Users

  1. Assign rooms early: Better housekeeping planning
  2. Review folios: Before checkout
  3. Document discounts: Always include reason
  4. Void vs delete: Void charges, never delete
  5. Use rate plans: For consistent pricing

Module Status: Production Last Reviewed: January 26, 2026 Documentation Version: 1.0