
✈️ Travel & Hospitality · State Machine
Every state of a hotel reservation from enquiry to checkout, including pay-at-hotel, cancellations and no-shows.
Drawing diagram…
State machine for a hotel reservation: Pending, then Confirmed (after prepayment or with a card guarantee for pay-at-hotel). A confirmed booking can be Cancelled free until 24 hours before check-in, or with a fee after that. On the arrival day it becomes Checked In or No Show (charged one night). Checked In goes to Checked Out and then Completed once the bill is settled.
stateDiagram-v2 [*] --> Pending Pending --> Confirmed: Prepaid or card guarantee Pending --> Expired: Not paid in 30 min Confirmed --> Modified: Dates changed Modified --> Confirmed Confirmed --> CancelledFree: 24h+ before check-in Confirmed --> CancelledWithFee: Within 24h Confirmed --> CheckedIn: Guest arrives Confirmed --> NoShow: Guest doesn't arrive NoShow --> Charged: One night charged CheckedIn --> CheckedOut CheckedOut --> Completed: Bill settled Completed --> [*] CancelledFree --> [*] CancelledWithFee --> [*] Charged --> [*] Expired --> [*]
How an online travel site books a flight: fare search across airlines, seat hold, passenger details, payment and ticket issue.
A hotel chain's reservation platform: booking engine, property management system, channel manager for OTAs and revenue management.
A database schema for an airline or hotel loyalty programme: members, tiers, earning and burning points, partners and rewards.
How a passenger checks in for a flight: online or at the airport, seat selection, documents check, bags and boarding pass.
How an online travel aggregator is deployed to handle search spikes: search fan-out to suppliers, caching, and separate booking services.
Mobile check-in for a hotel: ID upload, room assignment by the PMS, payment hold and a digital room key.