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:
- Loads templates matching names
like %Pre-Arrival%. - Calculates send times based on Check-in/Check-out timestamps.
- Inserts
ScheduledNotificationrecords.
- Loads templates matching names
processScheduledNotifications()
Cron runner.
- Logic:
- Finds due notifications.
- Compiles context (Guest Name, Hotel Name).
- Sends via
SmsService. - 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 (
ScheduledNotificationtable) 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
slugorjourney_stagecolumn tosms_templatestable.
- Fix: Add a
- 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)