# Phase 12.0 — Hospitality Platform Foundation | Field | Value | | --- | --- | | Status | Complete | | Module | hospitality | | Commercial Product | Torbat Food | | Version | 0.12.0.0 | | Database | `hospitality_db` | | API Port | 8009 | | ADR | ADR-001, ADR-003, ADR-006, ADR-017 | | Prior phase id | `restaurant-foundation` (evolved) | ## Goal Establish the **Hospitality Platform** as a completely independent enterprise microservice foundation capable of serving Cafe, Coffee Shop, Restaurant, Fast Food, Bakery, Pastry, Ice Cream, Juice Bar, Cloud Kitchen, Food Court, Catering, and Take Away — without hardcoding format-specific business engines. Works standalone and inside TorbatYar SuperApp. Integrations with Accounting, CRM, Loyalty, Communication, Delivery, Website Builder, and AI are **API + Events only**. ## Scope (In) - Independent `backend/services/hospitality` service + `hospitality_db` - Feature-based architecture shells: bundle definitions, tenant bundle activation, feature toggles, capability discovery - Foundation aggregates: venues, branches, dining areas, tables, menus, menu categories, menu items, roles, permissions, configurations, settings, events, audit - Health + `/capabilities` - Permissions `hospitality.*` (including bundle-gated permission keys registered for later phases) - Publish-only events `hospitality.*` - Provider contracts only (Accounting, CRM, Loyalty, Communication, Delivery, Website Builder, AI, …) - Compose / env wiring on port 8009 - Quality-gate tests + docs + handover ## Out of Scope - POS Lite / POS Pro engines - Kitchen display / ticket engines - QR ordering / reservation engines - Payment posting / Accounting journals - Delivery dispatch ownership - Website Builder pages - AI inference ## Owned Modules (aggregates) Independent aggregates in `app/models/foundation.py` (UUID refs only, no ORM relationship graphs). ## Published Events | Event | Aggregate | | --- | --- | | `hospitality.venue.created` / `updated` | venue | | `hospitality.branch.created` / `updated` | branch | | `hospitality.menu.created` / `updated` | menu | | `hospitality.menu_category.created` | menu_category | | `hospitality.menu_item.created` | menu_item | | `hospitality.dining_area.created` | dining_area | | `hospitality.table.created` | dining_table | | `hospitality.bundle_definition.created` | bundle_definition | | `hospitality.tenant_bundle.activated` / `deactivated` | tenant_bundle | | `hospitality.feature_toggle.upserted` | feature_toggle | | `hospitality.role.created` | hospitality_role | | `hospitality.permission.created` | hospitality_permission | | `hospitality.configuration.created` / `updated` | hospitality_configuration | | `hospitality.setting.upserted` | hospitality_setting | ## API Contracts (foundation) | Resource | Prefix | | --- | --- | | Venues | `/api/v1/venues` | | Branches | `/api/v1/branches` | | Dining areas / tables | `/api/v1/dining-areas`, `/api/v1/tables` | | Menus / categories / items | `/api/v1/menus`, `/menu-categories`, `/menu-items` | | Bundles / toggles | `/api/v1/bundle-definitions`, `/tenant-bundles`, `/feature-toggles` | | Roles / permissions | `/api/v1/roles`, `/permissions` | | Configuration / events / settings | `/api/v1/configurations`, `/events`, `/settings` | | Health / capabilities | `/health`, `/capabilities` | ## Permissions `hospitality.*` trees covering venues, menus, bundles, feature toggles, audit, and registered bundle-gated keys (`digital_menu`, `pos_lite`, `kitchen`, connectors, …). ## Architecture Decisions 1. Database-per-service (`hospitality_db`) — ADR-001 / ADR-017 2. Row-level `tenant_id` — ADR-003 3. Event publish contracts via `EventEnvelope` — ADR-006 4. Venue-format-agnostic model — no hardcoded F&B engines 5. Bundle-based licensing + feature toggles for capability discovery 6. Soft delete + actor audit + hospitality audit log 7. Optimistic locking on venues, menus, tenant bundles, configurations ## Tests Executed Architecture · API foundation · tenant isolation · permissions · bundles · migration · dependency · security · performance · docs ## Related Documents - [Phase Handover 11.0](phase-handover/phase-12-0.md) - [Hospitality Roadmap](hospitality-roadmap.md) - [ADR-017](architecture/adr/ADR-017.md) - [Module Registry](module-registry.md#hospitality) - [Progress](progress.md)