Skip to content

Guest / Customer Module Documentation

Overview

The Guest Module (Customer) manages profiles, preferences, and the "Guest Journey" automation. It acts as the CRM of the hotel. It includes a Self-Service Portal for guests to view invoices and make payments.

Architecture

Domain Layer (app/Domain/FrontDesk)

Models (4 Models)

Customer (Customer.php)
  • Table: customers
  • Description: Extends Party.
  • Key Fields: vip_status, credit_limit.
ScheduledNotification (ScheduledNotification.php)
  • Table: scheduled_notifications
  • Description: Queue for future SMS.
  • Triggers: T-24h (Checkin), T+1h (Welcome), T-12h (Checkout).

Services

GuestJourneyService (GuestJourneyService.php)

Purpose: Automates the timelines of communication.

Key Methods:

createJourneyForBooking(booking)

Schedules the default message cadence.

  • Logic:
    1. Loads templates matching names like %Pre-Arrival%.
    2. Calculates send times based on Check-in/Check-out timestamps.
    3. Inserts ScheduledNotification records.
processScheduledNotifications()

Cron runner.

  • Logic:
    1. Finds due notifications.
    2. Compiles context (Guest Name, Hotel Name).
    3. Sends via SmsService.
    4. Marks as SENT.

Audit Findings & Improvements

Strengths

  • Automated Hospitality: The system ensures every guest gets a "Welcome" and "Thank You" text without manual staff intervention, improving review scores.
  • Resilience: The queue-based approach (ScheduledNotification table) is better than "Delayed Job" queues because it allows easy cancellation (e.g. if the guest cancels the booking, we just delete the rows).

Issues Identified

Major

  • Fragile Template Lookup: The code finds templates by searching string name like '%Pre-Arrival%'. If a manager changes the template name to "Check-in Instructions", the entire automation fails silently.
    • Fix: Add a slug or journey_stage column to sms_templates table.
  • Timezone Assumptions: subHours(24) assumes the server time is the same as the hotel time. For international chains, this could send texts in the middle of the night.

Module Version

Version: 1.0 Status: Stable (with caveats)