# Flow — Final Approval & Done (Operation Head)

> Persona: **Anjali Desai** (OH), sees ALL Game Zones. Source: `WORKFLOW_GUIDE` Stage F + `PROJECT_PLAN §4b / §9 #3 / §9 #8`. Screens: `OH-CHK-OVERVIEW` → `OH-CHK-APPROVE`. Modals: `modals/photo-lightbox.html`, `modals/approve-confirm.html`, `modals/send-back-reason.html`.

---

## Preconditions
- Anjali is logged in (`/me` resolved role = OH, scope = all). A checklist (e.g. Ramesh's **Trampoline Daily**, Game Zone Ahmedabad-1) has climbed the cascade: filler ✓ → TL approved ✓ → **SM approved ✓**, so it is now at the **OH step** (`state = SM_APPROVED`) and reads **Pending** to Anjali.

## Steps

1. **Spot it.** On `OH-DASH`, the **Pending** KPI (amber) is non-zero, and the Ahmedabad-1 tile shows a Pending count. Anjali clicks the tile (or the Checklists nav) → `OH-CHK-OVERVIEW`, optionally narrowing the Game-Zone selector to Ahmedabad-1.
   → `GET /checklist-instances?scope=all&status=pending` — every not-yet-OH-approved instance, each with a compact cascade timeline + a **Pending** `StatusBadge` (derived, never stored, §9 #5).

2. **Open the OH step.** Anjali clicks the **Trampoline Daily** row (it has reached `SM_APPROVED`) → the `OH-CHK-APPROVE` drawer opens.
   → `GET /checklist-instances/:id` + `GET …/timeline` + `GET …/photos`. The timeline shows `Filled by Ramesh (Monitor) ✓ · TL approved ✓ · SM approved ✓ · **Operation Head — pending (you are here)**` with a ring on the OH node.

3. **Review the evidence (read-only).** The drawer lists every item with its **G/A** response, the **server time** + **auto-initials** (§9 #9 — read-only, tamper-proof), and a thumbnail grid: the **completion photo(s)** + each **A-item issue photo**. Anjali clicks a thumbnail → the **photo-lightbox** modal (full-screen, swipe, item-context caption). Photos load from **local disk** (`Photo.url`, L7).

4. **Decide — Approve (Done).**
   - Anjali clicks the **green "Approve (Final)"** button (Approve = green, `DESIGN_SYSTEM §6.4`) → the **approve-confirm modal**.
   - On confirm → `POST /checklist-instances/:id/approve` (`If-Match: <version>`).
   - Server: `SM_APPROVED → OH_APPROVED` (= **Done**); writes `ApprovalLog` + `ApprovalStep[3].APPROVE`; the instance **drops off every Pending list** (there is no level above OH). Success toast. Ramesh's `MON-CHK-STATUS` now reads "Operation Head Approved · Done".

5. **Decide — Send back (alternative branch).**
   - Anjali clicks the **red-orange "Send back"** button (Send-back = red-orange) → the **send-back-reason modal** (required textarea).
   - On submit → `POST /checklist-instances/:id/sendback` (`If-Match`, `{ reason }`).
   - Server: `state → SENT_BACK`; writes `ApprovalLog` with the reason; notifies the **original filler (Ramesh), not the Store Manager** (§9 #3). Ramesh's `MON-CHK-STATUS` shows a red banner + reason + Re-fill. On his re-submit, the cascade **restarts from TL** (§9 #8) — a fresh TL → SM → OH climb.
   - A blank reason is rejected client-side AND server-side (**422**).

6. **Concurrency.** If the SM (or a parallel session) moved the instance after Anjali opened it, the approve/sendback returns **409 stale**; the UI refetches the timeline and asks her to re-decide — no double-apply.

## Rules enforced in this flow
- **OH is terminal:** approval = `Done`; there is no further approver.
- **Pending is derived:** what Anjali saw as "Pending" was computed by `renderStatusForViewer()`, never a stored status.
- **Send-back always returns to the filler**, never to the previous approver, and restarts from TL.
- **OH is view-only on evidence:** no editing of items, time, initials, or photos.

## Result
- The checklist is either **Done** (full cascade complete, drops off all Pending lists) or **Sent back** to Ramesh to re-fill and re-climb the cascade from TL.
