# Flow — Submit & Track Approval (Cleaning Supervisor)

> Persona: **Suresh** (CS). Source: `WORKFLOW_GUIDE` Stage E5–E6 + Stage F + `PROJECT_PLAN §4b/§9`. Screens: `CS-CHK-SUBMIT` → `CS-CHK-STATUS`. Sheet: `bottom-sheets/confirm-submit.html`.
> **Identical mechanics to the anchor** (`staff-court-monitor-mobile/flows/submit-and-track-approval.md`) — same gate, same cascade, same send-back-to-filler rule.

---

## Preconditions
- The instance is `IN_PROGRESS` with every item answered, an issue photo on every A item, and **≥1 completion photo** (from `fill-checklist-with-photo.md`).

## Steps

1. **Review.** On `CS-CHK-SUBMIT`, Suresh sees a summary: G-count vs A-count, the completion photo thumbnail(s), and each A item with its issue-photo thumbnail.

2. **Photo gate (blocked vs allowed).**
   - If **any item is untouched** → submit blocked, inline `danger` lists them.
   - If **no completion photo** → blocked ("Add a completion photo to submit", §9 #7).
   - If **an A item lacks its issue photo** → blocked ("Item X needs a photo of the issue"), row highlighted.
   - All gates pass → the **Submit** button (navy-on-orange) is enabled.

3. **Confirm.** Suresh taps **Submit** → the **confirm-submit sheet** (`confirm-submit.html`) asks to confirm. He confirms.
   → `POST /checklist-instances/:id/submit` (`If-Match: <version>`).

4. **Server transition.** The server **re-checks the gate** (returns 422 if anything is missing — the UI can't bypass it). On pass: state → `SUBMITTED`, `submittedAt` set, three `ApprovalStep` rows (TL, SM, OH) created, and **Priya (TL) is notified** (FCM + in-app). The TL's verify queue gains this instance.

5. **Track status.** The app routes to `CS-CHK-STATUS`. Suresh sees the **ApprovalTimeline**:
   `Filled by Suresh (Cleaning Supervisor) ✓ → TL (pending) → Store Manager → Operation Head (Done)`.
   He sees the **real sub-state** of his instance — "Submitted · awaiting TL" — not "Pending" (Pending is what TL/SM/OH see at their level, derived, L8).

6. **As the cascade moves** (`WORKFLOW_GUIDE` Stage F):
   - Priya **Approves** → timeline node `TL Approved ✓`; passes to Store Manager.
   - Rohit (SM) **Approves** → `Store Manager Approved ✓`; passes to Operation Head.
   - Anjali (OH) **Approves** → `Operation Head Approved (Done)`. The instance is fully done.
   - Until OH approves, OH/SM see it as **Pending**; Suresh always sees the true step.

## Send-back branch (§9 #3)
- If **any** approver (TL/SM/OH) **sends it back** with a reason, the instance → `SENT_BACK` and returns to **Suresh** (the original filler), not the previous approver.
- `CS-CHK-STATUS` shows a prominent **red banner** with the reject reason + a **"Re-fill"** CTA → reopens `CS-CHK-FILL` (state `IN_PROGRESS`). Suresh fixes and re-submits; the cascade restarts from TL (§9 #8).

## Result
- A submitted cleaning checklist that climbs TL → SM → OH to **Done**, with Suresh able to see exactly where it is at every moment — or a sent-back instance he can re-fill.
