# TANRAIL ONE — Development Roadmap

## 1. Overview
This roadmap outlines the phased development plan for TANRAIL ONE. The goal is to build the Core Platform first, establish the shared capabilities, and then implement the specific business units (Restaurant and Catering).

## 2. Phases

### PHASE 0 — Architecture & Documentation (CURRENT)
- **Objective:** Establish the permanent Source of Truth for the platform design.
- **Deliverables:** `/docs` directory completed, ADR initialized, project boundaries defined.

### PHASE 1 — Platform Foundation
- **Objective:** Bootstrap the application and infrastructure.
- **Tasks:** Initialize Laravel, establish modular folder structure, setup database schemas for Core entities.
- **Dependencies:** None.

### PHASE 2 — Authentication, Authorization & Organization
- **Objective:** Multi-tenant access control.
- **Tasks:** Login, Users, Roles, Permissions, Organization, Business Units, Branches, Context Switcher UI.
- **Acceptance:** A user can log in and securely switch between permitted BUs.

### PHASE 3 — Core Master Data & Inventory
- **Objective:** Shared catalogs and stock tracking.
- **Tasks:** Customers, Suppliers, Products, Warehouses, Stock In/Out, Stock Valuation.
- **Acceptance:** Stock can be received into a specific Branch.

### PHASE 4 — Sales, Invoicing & Payments
- **Objective:** Core financial loop.
- **Tasks:** Orders, Invoices, Receipts, Expenses, Tax calculation.
- **Acceptance:** A generic sale can be processed, reducing inventory and generating a paid invoice.

### PHASE 5 — Reusable Capabilities
- **Objective:** Build shared modules needed by initial BUs.
- **Tasks:** Production (BOM/Recipes), Event Booking.

### PHASE 6 — Restaurant Implementation (Extension)
- **Objective:** First live business unit.
- **Tasks:** Table Management UI, Kitchen Display System, POS Interface tailored for dine-in.
- **Dependencies:** Phases 1-5.

### PHASE 7 — Catering Implementation (Extension)
- **Objective:** Second live business unit.
- **Tasks:** Catering Packages, Event Costing, Proposal generation.
- **Dependencies:** Phases 1-5.

### PHASE 8 — Executive Management Dashboard
- **Objective:** Cross-BU reporting.
- **Tasks:** Consolidated widgets, aggregate reporting jobs.

### PHASE 9 — Hardening, Testing & Deployment
- **Objective:** Production readiness.
- **Tasks:** Comprehensive testing, UI polish, infrastructure setup, final data migration.

## 3. Development Gates
To ensure the architecture remains intact and AI agents do not proceed prematurely, every phase must pass through a strict gate:

```text
PHASE START
 ↓
ARCHITECTURE CHECK (Verify phase requirements)
 ↓
IMPLEMENTATION (Write Code)
 ↓
TEST (Automated and Manual)
 ↓
REVIEW (Human verification against Docs)
 ↓
ACCEPTANCE (Sign-off)
 ↓
NEXT PHASE
```

No phase automatically triggers the next phase without explicit human approval.

## 4. Roadmap Governance
- This roadmap is a living document.
- Do not skip Phase 2 or 3 to rush to Phase 6. The Core must exist before the Extension can be built.
