|
1 | | -# HAIP — Build Plan |
2 | | - |
3 | | -> Updated April 6, 2026 — Phase 7 complete. Competitive milestone reached. |
4 | | -> Name: HAIP (Hotel AI Platform). Separate repo from OTAIP. |
5 | | -
|
6 | | ---- |
7 | | - |
8 | | -## THE PRODUCT |
9 | | - |
10 | | -An open-source, TypeScript/Node.js, API-first hotel PMS with native OTAIP agent orchestration and air booking. The only PMS in the world where AI agents are first-class citizens, not bolted-on afterthoughts. |
11 | | - |
12 | | - |
13 | | ---- |
14 | | - |
15 | | -## ARCHITECTURE DECISION |
16 | | - |
17 | | -**Option A — OTAIP agents ARE the PMS** (agents handle reservations, folios, housekeeping directly) |
18 | | -**Option B — PMS is a standalone system, OTAIP agents sit on top via APIs** |
19 | | - |
20 | | -**Decision: Option B.** The PMS is a real PMS — it works without OTAIP. OTAIP agents connect via the same APIs any third party would use. This is how Apaleo's Agent Hub works. It keeps the PMS useful to people who don't want AI, and keeps the agent layer clean. |
21 | | - |
22 | | -The PMS IS the product. OTAIP agents are the magic that makes it Telivity's. |
23 | | - |
24 | | -**Confirmed by Dušan — April 5, 2026.** |
25 | | - |
26 | | ---- |
27 | | - |
28 | | -## TECH STACK |
29 | | - |
30 | | -- **Language:** TypeScript (strict mode) |
31 | | -- **Runtime:** Node.js >=20 |
32 | | -- **Framework:** NestJS (modular, dependency injection, OpenAPI generation built-in) |
33 | | -- **Database:** PostgreSQL (multi-tenant from day one) |
34 | | -- **ORM:** Drizzle ORM (TypeScript-native, fast, no magic) |
35 | | -- **Cache:** Redis (session management, rate caching, pub/sub for events) |
36 | | -- **Message Queue:** BullMQ on Redis (webhook delivery, async tasks, night audit jobs) |
37 | | -- **API:** REST (JSON/HTTPS), OpenAPI 3.0 auto-generated from decorators |
38 | | -- **Auth:** OAuth 2.0 / OpenID Connect (Passport.js) |
39 | | -- **Package Manager:** pnpm (matches OTAIP) |
40 | | -- **Testing:** Vitest (matches OTAIP) |
41 | | -- **Build:** tsup (matches OTAIP) |
42 | | -- **Containerization:** Docker + docker-compose for self-hosting |
43 | | -- **CI/CD:** GitHub Actions |
44 | | - |
45 | | ---- |
46 | | - |
47 | | -## BUILD PHASES |
48 | | - |
49 | | -### Phase 0 — Scaffolding & Data Model (Week 1-2) |
50 | | -**2 Claude Code sessions** |
51 | | - |
52 | | -What gets built: |
53 | | -- Monorepo scaffolding (pnpm workspace, same structure as OTAIP) |
54 | | -- PostgreSQL schema: properties, rooms, room_types, reservations, guests, folios, charges, payments, rate_plans, rate_restrictions |
55 | | -- Multi-tenant schema design (property_id on every table, row-level security) |
56 | | -- NestJS app bootstrap with module structure |
57 | | -- OpenAPI/Swagger generation |
58 | | -- Docker-compose for local dev (Postgres + Redis + app) |
59 | | -- CLAUDE.md constitution (no invented domain logic rule) |
60 | | -- CI pipeline (lint, type-check, test) |
61 | | - |
62 | | -**Deliverables:** Working NestJS app with database migrations, empty API endpoints, docker-compose, CI green. |
63 | | - |
64 | | -**Estimate:** 2 sessions × 3-4 hours each = ~8 hours Claude Code time |
65 | | - |
66 | | ---- |
67 | | - |
68 | | -### Phase 1 — Reservation Lifecycle (Week 2-4) |
69 | | -**3-4 Claude Code sessions** |
70 | | - |
71 | | -What gets built: |
72 | | -- **Reservation module:** Create, read, update, cancel reservations |
73 | | -- **State machine:** Pending → Confirmed → Assigned → Checked In → Stayover → Due Out → Checked Out (+ No-Show, Cancelled) |
74 | | -- **Availability engine:** Room inventory by type per date, overbooking allowance |
75 | | -- **Guest profile module:** CRUD, preferences, stay history |
76 | | -- **Rate plan module:** BAR, derived, negotiated, package rates; MinLOS/MaxLOS/CTA/CTD restrictions |
77 | | -- **Room assignment:** Automated matching based on type, preferences, accessibility |
78 | | -- **Booking API:** Search availability → Select rate → Create reservation → Confirm |
79 | | -- Webhook events: reservation.created, reservation.confirmed, reservation.cancelled, reservation.modified |
80 | | - |
81 | | -**Deliverables:** Working booking API. Can create a property, define rooms and rates, search availability, book, modify, cancel. All states work. Webhooks fire. |
82 | | - |
83 | | -**Estimate:** 4 sessions × 3-4 hours = ~14 hours Claude Code time |
84 | | - |
85 | | ---- |
86 | | - |
87 | | -### Phase 2 — Folio & Billing (Week 4-6) |
88 | | -**3 Claude Code sessions** |
89 | | - |
90 | | -What gets built: |
91 | | -- **Folio module:** Guest folio, master folio, split folio, city ledger |
92 | | -- **Charge posting:** Room charges, F&B, incidentals, adjustments |
93 | | -- **Folio routing:** Charges route to correct folio based on rules |
94 | | -- **Payment abstraction:** Stripe gateway integration (first gateway) |
95 | | -- **Pre-authorization:** Hold at check-in, incremental auth, final settlement |
96 | | -- **Tokenization:** PCI-compliant payment token storage (never store card data) |
97 | | -- **Settlement:** Cash, card, city ledger transfer, balance verification |
98 | | -- Webhook events: folio.charge_posted, payment.received, folio.settled |
99 | | - |
100 | | -**Deliverables:** Complete billing flow. Check-in creates folio, charges post, payments settle, checkout zeroes balance. Stripe integration works. |
101 | | - |
102 | | - |
103 | | - |
104 | | ---- |
105 | | - |
106 | | -### Phase 3 — Check-In/Check-Out & Front Desk (Week 6-7) |
107 | | -**2 Claude Code sessions** |
108 | | - |
109 | | -What gets built: |
110 | | -- **Check-in flow:** ID verification fields, key card data prep, deposit auth, room assignment |
111 | | -- **Check-out flow:** Folio review, payment collection, room status update |
112 | | -- **Express checkout:** Automated settlement, email receipt |
113 | | -- **Group check-in:** Master list import, batch assignment |
114 | | -- **Early check-in / Late checkout:** Request handling, fee calculation |
115 | | -- **Room status updates:** Trigger housekeeping on checkout |
116 | | - |
117 | | -**Deliverables:** Full front desk operations. Check-in to checkout works end-to-end including group scenarios. |
118 | | - |
119 | | ---- |
120 | | - |
121 | | -### Phase 4 — Housekeeping (Week 7-8) |
122 | | -**2 Claude Code sessions** |
123 | | - |
124 | | -What gets built: |
125 | | -- **Room status state machine:** Dirty → Clean → Inspected → Guest Ready → Assigned |
126 | | -- **Task assignment:** Auto-assign rooms to housekeepers based on floor/priority |
127 | | -- **Checklist module:** Digital inspection checklists per room type |
128 | | -- **Turn-time tracking:** Analytics on cleaning time per room |
129 | | -- **Maintenance requests:** OOO/OOS status, repair tracking |
130 | | -- **Dashboard API:** Real-time status of all rooms for front desk and housekeeping |
131 | | -- Webhook events: room.status_changed, housekeeping.task_assigned, housekeeping.task_completed |
132 | | - |
133 | | -**Deliverables:** Working housekeeping module. Room status transitions work, tasks auto-assign, checklists trackable. |
134 | | - |
135 | | - |
136 | | ---- |
137 | | - |
138 | | -### Phase 5 — Night Audit & Reporting (Week 8-9) |
139 | | -**2 Claude Code sessions** |
140 | | - |
141 | | -What gets built: |
142 | | -- **Night audit job:** Automated via BullMQ cron |
143 | | - - Post room tariffs to all active folios |
144 | | - - Process no-shows (cancel + apply fee) |
145 | | - - Revenue reconciliation |
146 | | - - Day close (lock previous day, roll to new day) |
147 | | -- **Reports API:** |
148 | | - - Daily revenue report (room, F&B, other) |
149 | | - - Occupancy report (rooms occupied, available, OOO) |
150 | | - - Financial summary (totals by payment method) |
151 | | - - ADR, RevPAR, occupancy rate calculations |
152 | | -- **Audit log:** All transactions locked after day close |
153 | | - |
154 | | -**Deliverables:** Night audit runs automatically, posts charges, processes no-shows, generates reports. Day close works. |
155 | | - |
156 | | - |
157 | | ---- |
158 | | - |
159 | | -### Phase 6 — Channel Manager Integration (Week 9-11) |
160 | | -**3 Claude Code sessions** |
161 | | - |
162 | | -What gets built: |
163 | | -- **ARI push:** Availability, Rates, Inventory push to channel managers |
164 | | -- **Reservation pull:** Receive bookings from OTAs via channel manager |
165 | | -- **OpenTravel XML support:** OTA_HotelAvailNotif, OTA_HotelResNotif, OTA_HotelRateAmountNotif |
166 | | -- **SiteMinder adapter** (first channel manager integration) |
167 | | -- **Two-way sync:** Booking on any channel instantly updates inventory everywhere |
168 | | -- **Rate parity enforcement:** Same rate across all channels unless fenced |
169 | | - |
170 | | -**Deliverables:** PMS connected to a channel manager. Rates push out, bookings come in, inventory stays in sync. Hotel is bookable on OTAs. |
171 | | - |
172 | | - |
173 | | ---- |
174 | | - |
175 | | -### Phase 7 — OTAIP Agent Layer (Week 11-13) |
176 | | -**3-4 Claude Code sessions** |
177 | | - |
178 | | -What gets built: |
179 | | -- **PMS Connect Adapter:** OTAIP ConnectAdapter interface for the hotel PMS (same pattern as AmadeusAdapter, DuffelAdapter) |
180 | | -- **Hotel Search Agent (4.1):** Multi-source hotel search via PMS API |
181 | | -- **Rate Comparison Agent (4.4):** Compare rates across sources |
182 | | -- **Hotel Booking Agent (4.5):** Book via PMS API using OTAIP agent loop |
183 | | -- **Revenue Optimization Agent:** AI-driven pricing recommendations via PMS rate API |
184 | | -- **Guest Communication Agent:** Automated pre-arrival, in-stay, post-stay messaging |
185 | | -- **Housekeeping Optimization Agent:** AI room assignment and scheduling |
186 | | - |
187 | | -**Deliverables:** OTAIP agents running on the PMS. An AI agent can search, compare, book, and manage hotel stays through the same OTAIP infrastructure as air. |
188 | | - |
189 | | -**Estimate:** 4 sessions × 4 hours = ~16 hours Claude Code time |
190 | | - |
191 | | ---- |
192 | | - |
193 | | -### Phase 8 — Admin UI (Week 13-16) |
194 | | -**4-5 Claude Code sessions** |
195 | | - |
196 | | -What gets built: |
197 | | -- **React admin dashboard** (Telivity-branded) |
198 | | -- Screens: Property setup, Room management, Reservations, Guest profiles, Folios, Rates, Housekeeping dashboard, Night audit, Reports, Channel manager config |
199 | | -- **Mobile-responsive** front desk view |
200 | | -- **Real-time updates** via WebSocket for room status, new bookings |
201 | | - |
202 | | -**Deliverables:** Usable admin interface. A hotel can actually operate on this system. |
203 | | - |
204 | | - |
205 | | ---- |
206 | | - |
207 | | - |
208 | | -### What This Means in Real Time |
209 | | - |
210 | | -- Claude Code sessions average 3-4 hours each |
211 | | -- At 1-2 sessions per day: **3-4 months** of consistent work |
212 | | -- At 1 session per day with breaks: **4-5 months** realistically |
213 | | -- Your time (domain input, reviews, direction): ~30 min/day average, heavier during Phase 1 and 7 |
214 | | -- Biggest variable: Phase 6 (channel manager) depends on API access and partner relationships |
215 | | - |
216 | | -### MVP Milestone (Phase 0-5): ~9 weeks |
217 | | - |
218 | | -A standalone PMS that works for a single property. No OTA distribution yet, no AI agents, no UI — but the entire backend works. A hotel could operate on it via API. |
219 | | - |
220 | | -### Competitive Milestone (Phase 0-7): ~13 weeks |
221 | | - |
222 | | -PMS + channel manager + OTAIP agents. Now it's a real product. Hotels can get booked via OTAs, and AI agents can manage operations. This is where it gets interesting commercially. |
223 | | - |
224 | | ---- |
225 | | - |
226 | | -## WHAT'S NOT IN THIS PLAN (FUTURE) |
227 | | - |
228 | | -- Multi-property / portfolio management (Phase 9) |
229 | | -- Revenue management system integration (IDeaS/Duetto) |
230 | | -- Door lock integration (ASSA ABLOY, Salto) |
231 | | -- POS integration (MICROS, Toast) |
232 | | -- Accounting/ERP integration (QuickBooks, Xero) |
233 | | -- Guest mobile app / kiosk check-in |
234 | | -- Group bookings / allotments / attrition (meetings & events vertical) |
235 | | -- GDS distribution (Sabre/Amadeus hotel segments) |
236 | | -- Loyalty program engine |
237 | | -- Advanced reporting / BI dashboard |
238 | | - |
239 | | ---- |
240 | | - |
241 | | -## DECISIONS LOCKED (April 5, 2026) |
242 | | - |
243 | | -| Decision | Answer | Source | |
244 | | -|----------|--------|--------| |
245 | | -| Agents in PMS or on PMS? | **On PMS via API** (Option B) | confirmed | |
246 | | -| Target market | **General — fork it, it's yours** | confirmed | |
247 | | -| MVP scope | **Multi-property** (STR operators need this) | confirmed | |
248 | | -| Repo | **Separate repo** from OTAIP | Recommended, confirmed | |
249 | | -| Name | **HAIP** (Hotel AI Platform) | confirmed | |
250 | | -| Domain questions | **Research agents found answers** | 12/12 answered | |
251 | | - |
252 | | -## RESEARCH-INFORMED ADJUSTMENTS TO BUILD PLAN |
253 | | - |
254 | | -Based on 12 domain questions answered by research agents: |
255 | | - |
256 | | -1. **GDS architecture from day one** — GDS hotel bookings growing 13.5%/year, not declining. Design for it in Phase 0 schema even if integration comes in Phase 6. |
257 | | -2. **Compliance is a Phase 0-1 concern, not Phase 8** — PCI tokenization (Stripe), GDPR basics, guest registration forms, and tax engine are absolute MVP blockers. No hotel will adopt without them. |
258 | | -3. **Night audit automation is table-stakes** — 82% of hoteliers expect this. Already in Phase 5, confirmed as MVP priority. |
259 | | -4. **Basic housekeeping in MVP** — Small hotels need it built-in. Specialist tools (Optii, Quore) connect via webhook later. |
260 | | -5. **RMS integration is post-MVP** — 84% use RMS but it's not needed to operate. Architect data exports now, integrate later. |
261 | | -6. **Door locks are post-MVP** — 70% adoption expected but hotels operate fine without it. Phase 1 roadmap item. |
262 | | -7. **STR is a separate product line** — Research says fundamentally different needs (channel sync, dynamic pricing, automation). Build hotel PMS core first, STR module later. **Confirmed by Dušan April 5.** |
263 | | -8. **Revenue management + channel distribution is existential** — Dušan: "that's where they live or die." RMS data feeds and channel distribution should be elevated to Phase 1-2 priority, not Phase 6 afterthought. |
264 | | -8. **Apaleo Agent Hub is still experimental** — 4 agents, no scaling data. Don't make agents the core selling point. PMS must stand alone. |
265 | | -9. **Community building is a moat** — No dominant open-source hotel tech community exists. "Hotel Tech Builders" Discord + weekly calls could differentiate. |
266 | | - |
267 | | -## PHASE COMPLETION LOG |
268 | | - |
269 | | -| Phase | Status | Date | Tests | Key Stats | |
270 | | -|-------|--------|------|-------|-----------| |
271 | | -| 0. Scaffolding | ✅ Complete | Apr 5 | 13 | Monorepo, schema, CI | |
272 | | -| 1. Reservations | ✅ Complete | Apr 5 | 73 | State machine, availability, rates | |
273 | | -| 2. Billing | ✅ Complete | Apr 5 | 73 | Folio, charges, Stripe tokenization | |
274 | | -| 3. Front Desk | ✅ Complete | Apr 6 | 122 | Check-in/out, express, groups | |
275 | | -| 4. Housekeeping | ✅ Complete | Apr 6 | 168 | Tasks, checklists, inspection flow | |
276 | | -| 5. Night Audit | ✅ Complete | Apr 6 | 197 | 12-step audit, reports, RevPAR/ADR | |
277 | | -| 6. Channel Manager | ✅ Complete | Apr 6 | 239 | ChannelAdapter, ARI push, rate parity | |
278 | | -| 7. OTAIP Agent Layer | ✅ Complete | Apr 6 | 281 | Connect API (16 endpoints), insights | |
279 | | -| 8. Admin UI | ⏳ Next | — | — | React dashboard | |
280 | | - |
281 | | -**MVP Milestone (Phases 0-5): ✅ REACHED — Apr 6, 2026** |
282 | | -**Competitive Milestone (Phases 0-7): ✅ REACHED — Apr 6, 2026** |
283 | | - |
284 | | ---- |
285 | | - |
286 | | -## ALL DECISIONS FINALIZED (April 5, 2026) |
287 | | - |
288 | | -| Decision | Answer | |
289 | | -|----------|--------| |
290 | | -| Agents | On PMS via API (Option B) | |
291 | | -| Target | General-purpose, fork it | |
292 | | -| MVP scope | Multi-property | |
293 | | -| Repo | Separate from OTAIP | |
294 | | -| Name | HAIP | |
295 | | -| STR vs Hotel | Hotel core first, STR module later | |
296 | | -| Channel distribution | ChannelAdapter interface — ship SiteMinder/DerbySoft adapters first (instant 450+ OTA reach), direct OTA adapters over time (Booking.com, Expedia). Same pattern as OTAIP ConnectAdapter. | |
297 | | -| Revenue mgmt + distribution | Existential priority — elevated to Phase 1-2 | |
298 | | -| Dušan's PMS experience | Limited to SiteMinder and STR tools for now| |
| 1 | +# HAIP — Roadmap |
| 2 | + |
| 3 | +Open-source, API-first hotel PMS (Apache 2.0). |
| 4 | + |
| 5 | +## Shipped |
| 6 | +- Reservations, front desk, check-in/out |
| 7 | +- Folios, billing, payments (Stripe) |
| 8 | +- Rate plans, housekeeping, night audit |
| 9 | +- Groups, cashiering, house accounts, accounting, tax |
| 10 | +- Channel distribution + commission-free direct booking engine |
| 11 | +- Multi-property, RBAC, audit logging |
| 12 | +- Optional local AI for grounded decision explanations |
| 13 | + |
| 14 | +## In progress |
| 15 | +- Production deployment path (compose, container images, docs) |
| 16 | +- Full dashboard localization (page-level i18n) |
| 17 | +- End-to-end + money-path test coverage |
| 18 | + |
| 19 | +## Planned |
| 20 | +- New-property onboarding wizard |
| 21 | +- Expanded channel/OTA connectivity |
| 22 | +- Deeper reporting & analytics |
0 commit comments