# Senior Court Monitor (Mobile) — Developer Handoff

> Handoff pack for **dev-mode v1.0 Step 3b — Senior Court Monitor**. Built 2026-06-18 from the locked design (`docs/design/SCREEN_LIST.md` SCM block, `docs/design/DESIGN_SYSTEM.md`, `docs/dev-mode-v1.0/FOUNDATION_SPEC.md`) and the **anchor** pack (`staff-court-monitor-mobile/`) it mirrors.
> Persona: **Karan Patel** · Senior Court Monitor · Game Zone Ahmedabad-1 · Trampoline-certified · reports to Priya Nair (TL).
> Surface: **Mobile (Flutter), portrait ~390px.** This role is a near-twin of the anchor + one added read-only Team / Zone status view.

---

## Who consumes which file

| Role | Primary file | Why |
|---|---|---|
| **Mobile (Flutter) Developer** | `tasks.md` Mobile-FE column → filter `Priority=P0`, sort by Dependencies. Build queue. Pixel target = `screens/*.html` at 390px. | Builds the fill→submit→status flow from the Flutter design-system; photo-gate + G/A toggle + offline-retry; **plus the read-only Team / Zone status screen**. |
| **Backend Developer** | `tasks.md` Backend column + `api-contract.md` + `FOUNDATION_SPEC §3/§4`. | The endpoints in `api-contract.md`; submit-gate + cascade producer touchpoint (TL notify); **the read-only team read-model endpoint + the `checklist.view` (own_team) permission seed**. |
| **Tester** | `spec.md` acceptance summary + the two `flows/`. | Mobile `integration_test`: photo-gate, send-back-to-filler, status timeline, Game-Zone scope, **and that the Team view has zero write affordances**. |
| **Web Frontend Developer** | **N/A for this slot** (this is the mobile-primary surface). The thin web read-only fallback is a P2 secondary surface, not built here. | — |

---

## Definition of Done for the Senior Court Monitor slot

The slot ships when all P0 behaviours in `spec.md` pass in a UAT build, evidenced by:

1. **Login → role-resolve:** login routes to Senior Monitor Home via `GET /me`; nav (5 bottom-nav slots) + permissions come from the server — **no hardcoded role logic** in the app.
2. **Today's list integrity:** `SCM-CHK-TODAY` shows exactly the auto-assigned instances for Karan's published roster entry, scoped to his Game Zone + own assignments; status chips render the correct sub-state.
3. **G/A toggle (DESIGN_SYSTEM §6.13):** G = green / A = red-orange, by color+icon+label; selecting **A** opens the note+photo sheet and flags the item photo-required; an untouched item blocks submit.
4. **Server time + auto initials (§9 #9):** per-item `recordedAt` is server time and initials are auto-derived — no manual time/initials field is editable.
5. **Photo evidence (§4a, §9 #7, L7):** completion photo + per-A-item issue photo capture via the photo-capture sheet; each is a multipart upload to **local-disk storage**; thumbnails + remove work.
6. **Submit gate (UI + server):** submit is blocked client-side AND rejected server-side (422) unless every item is answered, ≥1 completion photo exists, and every A item has its issue photo.
7. **Submit transition + handoff:** on success the instance → `SUBMITTED`, `ApprovalStep`s created, **TL (Priya) notified** (FCM + in-app), and the app routes to status.
8. **Status timeline (DESIGN_SYSTEM §6.14):** `SCM-CHK-STATUS` renders the cascade stepper; the Senior Monitor sees the **real sub-state** of own instances (never "Pending").
9. **Send-back to filler (§9 #3/#8):** a send-back from any approver surfaces a red banner + reason + Re-fill on `SCM-CHK-STATUS`, returning to Karan (not the previous approver); Re-fill reopens fill; re-submit restarts the cascade from TL.
10. **Read-only roster + profile:** `SCM-ROSTER-OWN` shows own shifts with no create/edit affordance; `SH-PROFILE` shows role/reports-to/certified rides + a Team-status entry + logout.
11. **Team / Zone status (ADDED, read-only):** `SCM-TEAM-STATUS` shows the zone monitors' submissions with `StatusBadge` + per-monitor counts, scoped to own GZ + team; tapping opens a read-only detail (photos + timeline); **there is NO approve / send-back / edit affordance anywhere on this screen** (verified in UAT). Backend grants SCM `checklist.view` (own_team) and **denies** `checklist.approve` (403).
12. **States:** loading (skeleton), empty (nothing-assigned), error+retry, **offline-retry preserving the in-memory draft**, locked (login), 403 (out-of-scope) all render and are reachable.
13. **Chrome + scope:** navy top app bar + Game-Zone scope strip + 5-slot bottom nav + orange FAB on fill screens, matching `DESIGN_SYSTEM §8.2`; no cross-Game-Zone or cross-team data leak; CI Dart-model drift gate green.

P1 items are nice-to-have for the slot; out-of-slot items (approve/verify, roster build, reports, templates) are explicitly not here.

---

## Slot scope at a glance

- **9 screen mockups** (login, dashboard, today's checklists, fill, submit, status, profile, roster, **team-status**) · **6 state variants** · **3 bottom-sheets** = **18 HTML artifacts** (PNG render is a later step).
- Endpoints consumed: auth (login/refresh/logout/forgot/reset), `/me`, my roster, today's checklists, instance detail, save/submit responses, photo upload, my submissions + timeline, **team read-model (read-only)**, notifications, device register.
- **Relation to the anchor:** mechanical clone of the Staff Court Monitor pack (`MON-*` → `SCM-*`, persona Ramesh → Karan) **plus one added** `SCM-TEAM-STATUS` read-only screen + its read-model endpoint. Reuse the anchor's Flutter widgets verbatim for screens 1–8.

## Blocking questions / decisions before build

- [ ] **Team view scope definition:** is "team" the Staff Court Monitors reporting to the **same Team Leader** as the SCM (assumed), or **all monitors in the Game Zone** regardless of TL? Spec assumes same-TL team (`own_team`). Confirm at demo.
- [ ] **Does the senior role get a `checklist.view` seed at all?** This pack assumes the access matrix is extended so SCM has read-only team visibility (oversight) — confirm with client that a Senior Monitor *should* see peers' submissions but never approve. If declined, drop `SCM-TEAM-STATUS` and the role becomes an exact anchor clone.
- [ ] **Ride↔template auto-assign map** (`PROJECT_PLAN §9 #2`): confirm at the client demo which templates land for Trampoline/Toddler/ZipZag and which shift role is the "opener" for the 114-pt. Engine is generic; only seed rows are blocked.
- [ ] **FCM on iOS:** confirm APNs cert/key provisioning for the unified app before the notification touchpoint is testable end-to-end (§9 #10).
- [ ] **Tester model** (`DEV_EXECUTION_PLAN` D3 / §9 #11): pooled tester(s) — owns the photo-gate + send-back + Team-view-read-only integration suite.

---

## File references
- Pack root: `docs/design/dev-mode-v1.0/senior-court-monitor-mobile/`
- Anchor (mirror): `docs/design/dev-mode-v1.0/staff-court-monitor-mobile/`
- Screens: `screens/*.html` · States: `states/*.html` · Sheets: `bottom-sheets/*.html`
- Spec: `spec.md` · API: `api-contract.md` · Handoffs: `HANDOFFS.md` · Flows: `flows/*.md`
- Foundation: `docs/dev-mode-v1.0/FOUNDATION_SPEC.md` · Dev plan: `docs/dev-mode-v1.0/DEV_EXECUTION_PLAN.md`
- Project plan: `docs/PROJECT_PLAN.md` · Design system: `docs/design/DESIGN_SYSTEM.md` · Workflow: `docs/WORKFLOW_GUIDE.md`
