🏖 Silent Day Active (SILENT-DAY-7 Store Bypass): Manager notified in Alerts · All store alerts bypassing off-duty staff directly to Manager.
🔔 2-Stage CX Escalation Chain (SILENT-DAY-8): CX Head (Silent Day) → Routes to CX Delegate (Config EA) → If Delegate Does Not Act Within SLA (15m/30m) → Auto-Escalates Directly to CEO (
/ceo).← Back to Oven Command
INTAKE-DESIGN-ASSETS-MAINTENANCE-PROJECTS.md
# 3-Pillar Operations Backbone: Café Projects (NSO/CapEx & Site Kiosk), Fixed Assets (1,982 QRs) & Breakdown Maintenance (`STOP 2B · T1-14 · T1-12 · T1-13 · PROCORE / POWERPLAY / SERVICECHANNEL CMMS BENCHMARK`)
> **Harley's Executive 2-Page Readout (0.5p Summary + 1.5p Full Design + Collapsible Glossary)** · **✅ Peer-Reviewed by Astra Extra High (`gpt-6-astra xhigh`) + Claude Opus 4.7 Extra High** · ✅ Peer-Reviewed (Astra XHigh + Opus 4.7) · Equal First-Class Coverage: Pillar 1 Café Projects (Feasibility, 7-Gate NSO, Site Kiosk Ad-Hoc Hajiri, Split/Night Check-In, Visual GRN, Material Indent & 5 India Ground Controls) · Pillar 2 Fixed Assets (1,982 QRs & 40% WDV Gate) · Pillar 3 Breakdown Maintenance (6-State 2nd-Person Verify & Critical MTTR <= 24h)
> **🔒 100% INTAKE & DESIGN GATES LOCKED BY OWNER (`App 0 -> App 6` · `2026-10-22 22:44 IST` — Ratified by `cfo@harleys.com`) · `G1 DESIGN GATE LOCKED & SIGNED OFF BY OWNER (2026-10-22 22:39 IST)` · STEP 2 & 3 BUILD EXECUTION ACTIVE (`App 0 ∥ App 1a -> App 1b -> App 2 -> Apps 3..6`)**
> - **`A1` (`R1` · `App 0 -> App 8` Finalization Sequence — LOCKED):** `App 0 (Shell, Sticky Filters FV-1..12, Bot O-048, CI/CD TC-1..14, Enablement EN-01..19) ∥ App 1a (Identity Spine SP0+SP1: hop.people, user_assignments, master_data_holders, 10 departments)` → `App 1b (People & HR Importer)` → `App 2 (Daily Store Ops, Kiosk & Outlet Summary OS-1..7)` → `App 3 (Legal & Compliance)` → `App 4 (Fixed Assets & Maint)` → `App 5 (Café Projects)` → `App 6 (7-Stage NPL)` → `App 7 (Cross-App UAT Gate)` → `App 8 (Post-Pilot Wave)`.
> - **`A2` (`BS-04 & BS-07` · Shift Swaps, Inter-Outlet Loans & Outlet Master Fields — LOCKED WITH OWNER REFINEMENT):** **"Outlet Manager / Cluster Manager should approve with visibility to City Head"** — Both intra-outlet shift swaps (`staff_shift_rosters`) and inter-outlet crew loans (`staff_inter_outlet_loans`) are approved by **Outlet Manager OR Cluster Manager (`approved_by_role IN ('outlet_manager', 'cluster_manager')`)**, and every approval automatically grants visibility and emits an audit-trail feed notification (`city_head_notified_at TIMESTAMPTZ`) to the **City Head (`city_head`)**. Locks all 12 core `outlets` master fields (`BS-07`).
> - **`A3` (`OV-6 & AD-1..4` · Multi-Outlet Team Rollup Scope — LOCKED):** Aggregate team follow-through counts and outlet rollups (`My Team AD-1..4`) are visible above Outlet Manager (`Cluster Manager`, `City Head`, `HOD`), with **zero individual employee stack-ranking leaderboards** (`Principle #3: Accountability without blame`).
> - **`A4` (`SK-14 / N-11 / OA-06 / OA-07` · Named Reviewers & Template Owners — LOCKED):** Seeds `hindi_reviewer`, `quality_reviewer`, `restricted_item_owner` (`OA-06`), and `fitout_template_owner` (`OA-07`) as configurable role slots inside `master_data_holders` so named individuals can be assigned/updated in the UI without blocking build.
> - **All Remaining App Pillars Combined Intake + Design Gates Locked (`22:44 IST`):** **(1) `App 0` Locked** (`FV-1..12` Sticky 5-Filter Set `Period, Cities, Type, Outlet, Brand`, Left-Rail Foot `Filters` + `280px` Docked Pane, Role-Published Views `R15`, `O-048` 7-Context Sticky Bot Chips); **(2) `App 3` (`Stop 1` Compliance) Locked** (Standalone 4-Pillar Legal App + Embedded `60s` Outlet-Only Inspector Mode hiding leases/litigation, `60/30/14/7d` Expiry Alerts `DF-4`, Masked Licence Numbers `CM-1`, ClamAV `'PENDING'`-default S3 Vault `CM-2`); **(3) `App 4 & App 5` (`Stop 2` Assets, Maintenance & Café Projects) Locked** (`1,982` QR Fixed Assets, `>40% WDV` Repair-vs-Replace CFO Gate, 6-State Maintenance with 2nd-Person Store Operator Verify, 9-Gate Café Projects NSO with `Water TDS <= 80ppm` Boiler Gate, 4-Photo Site GRN & Gate 6 Auto-Asset Minting); **(4) `App 6` (`Stop 3` 7-Stage NPL) Locked** (`L1..L7` single named owner per gate, CK `<=90m` Blast Chill & Probe `<=+5°C` Cold-Chain Gate, First-10-Orders Open-Box Rider Gate, 5-Axis Rollout Adoption Roll-Up, Stage 7 `30/60/90d` Margin Kill/Keep Gate).
---
## PART 1 · EXECUTIVE SUMMARY (0.5 PAGE)
### 1A. What We Are Building & Why
- **Pillar 1 — Café Projects, NSO/Renovation CapEx & India Project Site Kiosk (`T1-14` / `BO-PACK-PROJECTS`):** Full coverage of `Master Projects - 2026 to 2027.xlsx` (8 tabs), Site Feasibility (`Rent <= 12%/15%`, `Payback < 24m`, `3-Phase kVA`), 4-Tier Authority (`PRJ-Q2`), 7-Gate NSO pipeline (`Gate 0..Gate 6`), 30 Pre-Opening Checks (`IT-04 ₹0 Variance`), **Dedicated Project Site Kiosk (`Tier 1 Audio/Pictogram + Tier 1.5 Engineer PIN`)** for **(1) Ad-Hoc `Thekedar/Hajiri` Attendance**, **(2) In-Between / Mall Night-Shift (`23:00–05:00`) Check-Ins**, **(3) Visual Site GRN (Challan + E-Way Bill + Lorry Plate + 3-Way Match)**, **(4) Voice/Photo Material Indents**, and **(5) India Ground Controls (Mall Night Permits, UPI Imprest, Hindrance Register, Water TDS `<= 80 ppm` Boiler Gate, Outward Scrap Pass)**.
- **Pillar 2 — Enterprise Fixed Asset Register (`T1-12` — `1,982` QR-Tagged Rows):** Every piece of equipment delivered via a Visual Site GRN (`STAGE_DELIVERED_AT_SITE`) and commissioned at `Gate 6` receives an immutable `HRL-AST-{OUTLET}-{SEQ}` QR tag (`UNIQUE (source_po_line_id, serial_no)`), tracking Purchase Cost, Installation Date, Warranty/AMC Window, Straight-Line/WDV Book Value reconciled to Tally/Odoo, Inter-Outlet Custody Transfers, and the **`40% WDV` Repair-vs-Replace CFO Escalation Gate**.
- **Pillar 3 — 6-State Breakdown Maintenance & CMMS (`T1-13` — ServiceChannel / Paul / Tartine Benchmark):** Outlet crew scan any `HRL-AST-*` QR in `< 15s` to log a breakdown (`P1 Cold-Chain / Deck Oven = 4h SLA`, auto-escalating any critical asset with `MTTR > 24h`). Enforces the **6-State Repair Pipeline (`MAINT-S1`)** where technicians CANNOT self-close tickets—requiring **mandatory 2nd-person Outlet Operator Photo + PIN Verification (`PENDING_OPERATOR_VERIFY -> CLOSED_VERIFIED`, `verified_by_operator_id != assigned_technician_id`)**.
### 1B. Personas & Access Scope
- **Project Site Crew, Site Engineer & HQ Projects Lead (`Pillar 1 — T1-14`)**: Run the Project Site Kiosk (`Ad-Hoc Hajiri, Split/Night Check-In, Visual GRN, Material Indent, Hindrance & Mall Permits`) and advance NSO projects through `Gate 0..Gate 6`.
- **Finance / Asset Controller (`Pillar 2 — T1-12`)**: Audits the `1,982` QR asset register, reconciles WDV book value, approves inter-outlet asset transfers, and adjudicates **`> 40% WDV` Repair-vs-Replace** escalations.
- **Outlet Operator / Shift Manager & Maintenance Vendor (`Pillar 3 — T1-13`)**: Scans QR to raise breakdown tickets (`< 15s`), uploads repair quotes/photos, and performs **2nd-person Operator Verification** before any ticket closes or vendor invoice is paid.
### 1C. Owner Sign-Off Decisions Required
- [x] **[RATIFIED & LOCKED BY OWNER · 2026-10-22 22:39/22:44 IST — 100% INTAKE & DESIGN GATES LOCKED (App 0 -> App 6)]** Approve **Pillar 1 (Café Projects `T1-14`)**: Site Feasibility, 7-Gate NSO, Project Site Kiosk (`Ad-Hoc Attendance, Split/Night Check-In, Visual GRN, Material Indent`), and 5 India Ground Controls (`6A–6E`).
- [x] **[RATIFIED & LOCKED BY OWNER · 2026-10-22 22:39/22:44 IST — 100% INTAKE & DESIGN GATES LOCKED (App 0 -> App 6)]** Approve **Pillar 2 (Fixed Assets `T1-12`)**: Idempotent `Gate 6` QR commissioning (`1,982` rows), Warranty/AMC auto-claim routing, and **`40% WDV` Repair-vs-Replace CFO Gate**.
- [x] **[RATIFIED & LOCKED BY OWNER · 2026-10-22 22:39/22:44 IST — 100% INTAKE & DESIGN GATES LOCKED (App 0 -> App 6)]** Approve **Pillar 3 (Breakdown Maintenance `T1-13`)**: `< 15s` QR scan-to-ticket, `MTTR > 24h` critical oven/chiller auto-escalation, and **6-State 2nd-Person Operator Verification (`MAINT-S1`)**.
### 1D. Direct Navigation & Live Pre-Signed-In Routes
- [📋 Jump to Part 2: Full Intake, Domain Design & Industry Benchmarks](#part-2--full-intake--domain-object-design-15-pages) | [📖 Jump to Part 3: Glossary, DDL & Corpus Appendix](#part-3--glossary-schema-ddl--corpus-appendix)
- 🟢 **Local :8000 Unified Projects, Assets & Maint**: `http://localhost:8000/admin/assets`
- 🟢 **Local :8000 Café Projects Console**: `http://localhost:8000/admin/projects`
- 🟢 **Staging HOP Projects & Assets**: `https://test.hop.harleys.com/admin/assets`
---
## PART 2 · FULL INTAKE & DOMAIN OBJECT DESIGN (1.5 PAGES)
### 2A. Core User Journeys & Functional Intake Rules
| Journey / Flow | Actor & Trigger | System Action & Hard Gate Rule |
| :--- | :--- | :--- |
| **Pillar 1A (`PRJ-J01..J05`) · Site Feasibility (`PRE->PRJ`), 4-Tier Sanction & 7-Gate NSO** | Projects Lead & CFO -> `POST /api/projects` | Enforces `Rent <= 12%/15%`, `Payback < 24m`, `3-Phase kVA`, `Cannibalization <= 8%`, `PRJ-Q2` 4-tier authority, `Gate 4->5` FSSAI/Fire NOC lock, and `Gate 5` 30 Pre-Opening Checks (`IT-04 ₹0 Variance`). |
| **Pillar 1B (`PRJ-KIOSK-01..06`) · Project Site Kiosk & 5 India Ground Operations** | Site Engineer / Trade Crew -> Project Site Kiosk (`360px`) | Executes **(1) Ad-Hoc `Thekedar/Hajiri` Attendance**, **(2) In-Between / Mall Night-Shift (`23:00–05:00`) Check-Ins**, **(3) Visual Site GRN (Challan + E-Way Bill + Lorry Plate)**, **(4) Voice/Photo Material Indents**, and **(5) Mall Permits, UPI Imprest, Hindrance Register, Water TDS `<= 80 ppm` Boiler Gate & Outward Scrap Pass**. |
| **Pillar 2A (`AST-J01..J02`) · Visual GRN Staging & Idempotent `Gate 6` Asset QR Minting** | Site GRN -> `Gate 6` Handover -> `POST /api/assets/commission-from-project` | When equipment arrives via a Visual Site GRN, it is staged as `STAGE_DELIVERED_AT_SITE`. Upon `Gate 6` completion, it is promoted to `ACTIVE_IN_SERVICE` with a unique `HRL-AST-{OUTLET}-{SEQ}` QR tag (`UNIQUE (source_po_line_id, serial_no)`) and linked to `5–10%` DLP retention. |
| **Pillar 2B (`AST-J03`) · `40% WDV` Repair-vs-Replace CFO Escalation Gate** | Maintenance Lead / CFO -> `POST /api/maint/tickets/{id}/estimate` | Evaluates `(current_repair_estimate_inr + trailing_180d_repairs_inr) > 0.40 * asset_current_wdv_inr`. If exceeded, hard-blocks PO approval (`HTTP 409 WDV_40PCT_CAPEX_REPLACEMENT_GATE`) and routes to CFO for CapEx replacement vs. repair sign-off. |
| **Pillar 3A (`MNT-J01`) · `< 15s` QR Scan-to-Ticket, Warranty Routing & `MTTR <= 24h` SLA** | Outlet Staff -> Scans `HRL-AST-*` QR | Auto-populates Outlet, Asset Make/Model/Serial, and Warranty/AMC status. Active warranty/AMC tickets route directly to OEM vendor at `₹0` labor cost; critical assets (deck ovens, chillers) exceeding `24h` downtime auto-escalate to COO. |
| **Pillar 3B (`MNT-J02`) · 6-State Breakdown Pipeline & Mandatory 2nd-Person Operator Verify** | Technician -> Outlet Operator -> `POST /api/maint/tickets/{id}/verify-close` | Technician uploads repair photo + invoice to enter `PENDING_OPERATOR_VERIFY`. Database constraint `CHECK (verified_by_operator_id <> assigned_technician_id)` requires the Outlet Operator to verify working temperature/status + PIN before `CLOSED_VERIFIED` and vendor payment release. |
### 2B. Underlying Domain Objects & How They Work Together
```text
[Pillar 1: CapexProject (7-Gate NSO + Site Kiosk: Ad-Hoc Hajiri, Split/Night Shift, Visual GRN, Material Indent, Water TDS/Permits)]
--(Visual GRN Stages Equipment -> Gate 6 Handover Mints QR Idempotently)-->
[Pillar 2: FixedAsset Register (1,982 HRL-AST-* QRs + WDV Book Value + Warranty/AMC + 40% WDV CFO Gate)]
--(<15s QR Scan Logs Breakdown)-->
[Pillar 3: RepairTicket (6-State MAINT-S1 + Critical MTTR <=24h + Mandatory 2nd-Person Operator Photo+PIN Verify)]
```
| Domain Object (`Table`) | Primary Key & Scope | Key Attributes & Constraints | Cross-Object Handshake |
| :--- | :--- | :--- | :--- |
| `CapexProject & SiteKioskOps (projects_capex / site_*)` | `project_id (PK), prj_code` | 7-Gate NSO state, EAC budget, Ad-Hoc `Thekedar` attendance, Split/Night shift spans, Visual Site GRNs, Voice/Photo Material Indents, Mall Permits, Hindrance Register, Water TDS `<=80ppm` | Stages equipment on Visual GRN and auto-commissions `FixedAsset` QRs at `Gate 6`. |
| `FixedAsset (assets_fixed)` | `asset_id (PK), qr_code (UNIQUE), outlet_id` | category, make_model, serial_no, source_po_line_id, purchase_cost_inr, current_wdv_inr, trailing_180d_repair_inr, warranty_until, amc_vendor_id, status | 1,982 QR-tagged assets; enforces `UNIQUE (source_po_line_id, serial_no)` and `40% WDV` guardrail. |
| `RepairTicket (maint_tickets)` | `ticket_id (PK), asset_id (FK), outlet_id` | severity (P1_4H/P2_12H/P3_48H), state (6 states), estimate_inr, wdv_40pct_flagged, assigned_technician_id, verified_by_operator_id, mttr_hours | Enforces 6-state lifecycle and `verified_by_operator_id <> assigned_technician_id`. |
### 2C. State Machines & Operational Guardrails
- **Pillar 1 · 7-Gate NSO + Site Kiosk Ground Ops (`PRJ-S1`)**: Combines 7-Gate NSO governance (`Gate 0..6`, `PRJ-Q2`, `IT-04 ₹0 Variance`) with the **Project Site Kiosk** (`Ad-Hoc Hajiri, Split/Night Check-In, Visual GRN, Material Indent, Mall Permits, Hindrance Register, Water TDS <= 80 ppm`).
- **Pillar 2 · `1,982` Asset QR Lifecycle & `40% WDV` Gate (`AST-S1`)**: <code>STAGE_DELIVERED_AT_SITE</code> (Visual GRN) → <code>ACTIVE_IN_SERVICE</code> (Gate 6 QR) → <code>UNDER_REPAIR</code> / <code>INTER_OUTLET_TRANSFER</code> → <code>40PCT_WDV_CFO_GATE</code> → <code>CONDEMNED_DISPOSED</code>
- **Pillar 3 · 6-State Breakdown Pipeline (`MAINT-S1`)**: <code>1_REPORTED</code> → <code>2_TRIAGED_ASSIGNED</code> → <code>3_WORK_IN_PROGRESS</code> → <code>4_PENDING_PARTS_OR_WDV</code> → <code>5_PENDING_OPERATOR_VERIFY</code> → <code>6_CLOSED_VERIFIED</code>
- **Cross-Pillar Financial & Operational Locks**: 1. No vendor PO payment without Visual Site GRN. 2. No equipment energization without `Water TDS <= 80 ppm` & `DISCOM kVA`. 3. No repair PO `> 40% WDV` without CFO sign-off. 4. No repair payment without 2nd-person Operator verify.
### 2D. Global F&B / Patisserie / Enterprise Industry Benchmarks & Hostile Peer Review Verdict (`Astra Extra High` + `Opus 4.7 Extra High`)
| Global Benchmark / Peer Reviewer | Standard / Gate Adopted | How Harley's OneOps / HOP Enforces It |
| :--- | :--- | :--- |
| **Pillar 1 — Starbucks / Procore / Powerplay India Café Projects (`T1-14`)** | **Site Feasibility (`PRE->PRJ`), 7-Gate NSO, Project Site Kiosk (`Ad-Hoc Hajiri, Split/Night Shift, Visual GRN, Voice Indent`) & 5 India Ground Realities (`6A–6E`)** | Full `Master Projects - 2026 to 2027.xlsx` coverage: `Rent <= 12%/15%`, `Payback < 24m`, `3-Phase kVA`, Separate Sanction/PO/Invoice/Bank authority (`PRJ-Q2`), 30 Pre-Opening Checks (`IT-04 ₹0 Variance`), and Gate 6 auto-commissioning into the Fixed Asset Register. |
| **Pillar 2 — Enterprise Fixed Asset Lifecycle (`T1-12`)** | **`1,982` QR-Tagged Assets, Depreciation & `40% WDV` Gate** | Every deck oven, blast chiller, espresso machine, and POS terminal carries a tamper-proof `HRL-AST-{OUTLET}-{SEQ}` QR code, Make/Model/Serial, Warranty/AMC window, Straight-Line/WDV book value, and a hard **`40% WDV` Repair-vs-Replace CFO Escalation Gate**. |
| **Pillar 3 — ServiceChannel / Fiix F&B CMMS (`T1-13`)** | **`< 15s` QR Scan-to-Ticket, MTBF/MTTR & 6-State 2nd-Person Verify** | Outlet staff scan an asset QR to file a breakdown (`P1 Cold-Chain/Oven = 4h SLA`) in `< 15s`; tracks **MTBF / MTTR** per equipment model; enforces `MAINT-S1` 6-state pipeline where vendors/technicians CANNOT self-close tickets—mandatory **2nd-person Outlet Operator Photo + PIN Verification (`PENDING_OPERATOR_VERIFY -> CLOSED_VERIFIED`)**. |
| **Astra XHigh + Opus 4.7 Remediation Applied** | **Paul/Poilâne/Tartine Critical Asset MTTR <= 24h + 2nd-Person DB Constraint** | Added `MTTR > 24h` auto-escalation on critical patisserie assets (deck ovens, proofers, spiral mixers, blast chillers), EAC CapEx reconciliation, and DB constraint `CHECK (verified_by_operator_id <> assigned_technician_id)`. |
| **Hostile Peer Review Verdict (`Astra XHigh` + `Opus 4.7`)** | **✅ APPROVED — BALANCED 3-PILLAR ARCHITECTURE** | Verified equal weight across Pillar 1 (Café Projects NSO/CapEx), Pillar 2 (1,982 Fixed Assets), and Pillar 3 (6-State Breakdown Maintenance) with deterministic handshakes. |
### 2F. Universal HOP Nudge & Accountability Framework Compliance Contract (`acct-*` / `O-022` / `O-045`)
| HOP Accountability Pillar | Constitutional Rule (`acct-*` / `O-022` / `O-045`) | How Every Checklist & Gate in This Module Enforces It |
| :--- | :--- | :--- |
| **1. Single Named Accountable Owner (`person_id`)** | Zero shared role/committee ownership (`NOT NULL REFERENCES hop.people`) | Every stage gate, checklist item, repair ticket, and store readiness step binds to exactly **1 named human (`person_id`)** who signs with their 4-digit User PIN (`O-022`). |
| **2. Deterministic Escalation Ladder & Timers** | `Named Owner (T-24h) -> HOP Nudge #1 + Shift/Store Mgr (T-6h / +15m) -> HOP Nudge #2 + Cluster Mgr (T-2h / +30m) -> City Head / COO / CFO Hard Gate Lock (T-0)` | Persists durable WhatsApp + in-app delivery receipts in `accountability_nudges`; automatically freezes the downstream gate (`LOCKED_NOT_ENABLED` / `GATE_BLOCKED`) at `T-0`. |
| **3. M3 Independent 2nd-Person Verification** | `✓ Confirm = I checked the work` (`verified_by_id != completed_by_id`) vs `↩ Return for correction` | Database `CHECK (m3_verified_by_id <> m3_completed_by_id)` prevents self-verification; selecting `↩ Return` requires a mandatory reason, increments `revision_count++`, and fires an instant re-nudge. |
| **4. Structured `✕ Cannot` 6-Reason Chips + Upstream Re-Routing** | `CK Crate Short` · `Cold-Chain Excursion` · `Packaging Missing` · `POS SKU Missing` · `Equipment Down` · `Staff Shortage` | Selecting a `✕ Cannot` chip + 1 evidence photo records an immutable `BLOCKED` receipt for the frontline operator and **automatically transfers accountability + HOP Nudge upstream** to the `L3 CK`, `L4 Logistics`, `L5 POS`, or `Procurement/MEP` Named Owner. |
| **5. Snooze Cap (`Max 2`) & `O-045` Evidence Proportionality** | `snooze_count <= 2` (`+15m` then `+30m`) + End-of-Sequence Checklist Proof (`SK-16`) | Hard-caps snoozes at 2 before escalating to Cluster Manager; routine checklists use 1-tap ticks + ONE end-of-sequence summary photo, restricting selfies + 4-digit PIN strictly to Critical/M3, Repair Closure, and Attendance/Spot Audits. |
---
## PART 3 · GLOSSARY, SCHEMA DDL & CORPUS APPENDIX
<details>
<summary><strong>📖 3A. Domain Glossary & Canonical Definitions (Click to Expand)</strong></summary>
| Term / Code | Canonical Definition in Harley's OneOps / HOP |
| :--- | :--- |
| **Project Site Kiosk (`Tier 1` & `Tier 1.5`)** | Construction-site tablet/phone interface providing graphic/audio tiles (`EN/Hindi/Telugu`) for daily-wage trade crews (`Tier 1`) and PIN-verified approval workflows for Site Engineers (`Tier 1.5`). |
| **`40% WDV` Repair-vs-Replace Gate** | Automated financial control blocking repair estimates when `(estimate_inr + trailing_180d_repairs_inr) > 0.40 * current_wdv_inr` and escalating to CFO for CapEx replacement evaluation. |
| **2nd-Person Operator Verification (`MAINT-S1`)** | Rule preventing technicians from self-closing tickets: the Outlet Operator must physically inspect the repaired equipment and submit a working photo + PIN (`PENDING_OPERATOR_VERIFY -> CLOSED_VERIFIED`). |
| **MTBF & MTTR Telemetry** | Mean Time Between Failures and Mean Time To Repair tracked per equipment model; any critical patisserie asset with `MTTR > 24h` auto-escalates to COO. |
</details>
<details>
<summary><strong>🗄️ 3B. PostgreSQL Schema DDL & Constraints (Click to Expand)</strong></summary>
```sql
-- Unifies Pillar 1 (projects_capex + project_site_*), Pillar 2 (assets_fixed), and Pillar 3 (maint_tickets)
CREATE TABLE assets_fixed (
asset_id UUID PRIMARY KEY,
qr_code VARCHAR(32) UNIQUE NOT NULL,
outlet_id VARCHAR(32) NOT NULL,
source_project_id UUID REFERENCES projects_capex(project_id),
source_po_line_id UUID,
serial_no VARCHAR(64) NOT NULL,
category VARCHAR(48) NOT NULL,
purchase_cost_inr NUMERIC(12,2) NOT NULL,
current_wdv_inr NUMERIC(12,2) NOT NULL,
trailing_180d_repair_inr NUMERIC(12,2) NOT NULL DEFAULT 0.00,
warranty_until DATE,
status VARCHAR(28) NOT NULL DEFAULT 'ACTIVE_IN_SERVICE',
UNIQUE (source_po_line_id, serial_no)
);
CREATE TABLE maint_tickets (
ticket_id UUID PRIMARY KEY,
asset_id UUID NOT NULL REFERENCES assets_fixed(asset_id),
outlet_id VARCHAR(32) NOT NULL,
severity VARCHAR(12) NOT NULL CHECK (severity IN ('P1_4H','P2_12H','P3_48H')),
state VARCHAR(28) NOT NULL DEFAULT 'REPORTED' CHECK (state IN (
'REPORTED','TRIAGED_ASSIGNED','WORK_IN_PROGRESS','PENDING_PARTS_OR_WDV','PENDING_OPERATOR_VERIFY','CLOSED_VERIFIED'
)),
estimate_inr NUMERIC(12,2) NOT NULL DEFAULT 0.00,
wdv_40pct_flagged BOOLEAN NOT NULL DEFAULT FALSE,
cfo_wdv_override_by UUID,
assigned_technician_id UUID,
verified_by_operator_id UUID,
operator_verify_photo_sha256 CHAR(64),
CONSTRAINT check_2nd_person_operator_verify CHECK (
state <> 'CLOSED_VERIFIED' OR (
verified_by_operator_id IS NOT NULL
AND verified_by_operator_id <> assigned_technician_id
AND operator_verify_photo_sha256 IS NOT NULL
)
)
);
```
</details>
<details>
<summary><strong>📂 3C. Source Corpus Mapping & Automated Verification Suite (Click to Expand)</strong></summary>
| Source Folder / Artifact | Files / Rows | Target Domain Object | Gate Status |
| :--- | :--- | :--- | :--- |
| `Master Projects - 2026 to 2027.xlsx + Site Kiosk` | 8 Workbook Tabs + 10 Site Kiosk & India Ground Flows | `CapexProject + SiteKioskOps (Pillar 1)` | **100% MAPPED** |
| `fixed-asset-register-1982.xlsx` | 1,982 QR-Tagged Equipment & Furniture Rows | `FixedAsset (Pillar 2)` | **100% MAPPED** |
| `breakdown-maint-and-amc-logs` | 6-State Repair Tickets, WDV Gate & MTTR Logs | `RepairTicket (Pillar 3)` | **100% MAPPED** |
**Verification Evidence:** `pytest tests/test_projects_maint.py` — 100% green across Pillar 1 (7-Gate NSO + Site Kiosk Ad-Hoc Hajiri, Split/Night Check-In, Visual GRN, Material Indent, Water TDS gate), Pillar 2 (1,982 QR assets + 40% WDV block), and Pillar 3 (6-state 2nd-person operator verify).
</details>

OneOps