# Cleaning Supervisor (Mobile) — Developer Handoff

> Handoff pack for **dev-mode v1.0 Step 3b — a CLONE of the ANCHOR** (`staff-court-monitor-mobile`). Built 2026-06-18 from the locked design (`docs/design/SCREEN_LIST.md` CS block, `docs/design/DESIGN_SYSTEM.md`, `docs/dev-mode-v1.0/FOUNDATION_SPEC.md`).
> Persona: **Suresh Yadav** · Cleaning Supervisor · Game Zone Ahmedabad-1 · cleaning areas (Washrooms · Café · Courts) · reports to Priya Nair (TL).
> Surface: **Mobile (Flutter), portrait ~390px.** Same fill→submit→status flow as the anchor; deltas = cleaning/hygiene templates + slot-2 nav label "Cleaning".

---

## 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. | If the anchor's Flutter screens are built generically (role-driven from `/me`), CS is **mostly free** — wire cleaning templates + slot-2 label, re-skin nothing. |
| **Backend Developer** | `tasks.md` Backend column + `api-contract.md` + `FOUNDATION_SPEC §3/§4`. | Same endpoints as the anchor; the one new piece is the **cleaning auto-assign branch** (category match, not ride-cert — see the gap in `api-contract.md`). |
| **Tester** | `spec.md` acceptance summary + the two `flows/`. | Mobile `integration_test`: photo-gate, send-back-to-filler, status timeline, Game-Zone scope — same suite as the anchor with cleaning seed data. |
| **Web Frontend Developer** | **N/A for this slot** (mobile-primary surface). The thin web read-only fallback is a P2 secondary surface, not built here. | — |

---

## Definition of Done for the Cleaning Supervisor 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 Cleaning Supervisor Home via `GET /me`; nav (5 bottom-nav slots, **slot 2 = "Cleaning" / `spray-can`**) + permissions come from the server — **no hardcoded role logic** in the app.
2. **Today's list integrity:** `CS-CHK-TODAY` shows exactly the auto-assigned **cleaning/hygiene** instances for Suresh'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):** each response's `recordedAt` is **server time** and `initials` are **server-derived** ("SY"); the client sends neither and renders both read-only.
5. **Photo evidence (§4a, §9 #7, L7):** **≥1 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):** `CS-CHK-STATUS` renders the cascade stepper; the CS sees the **real sub-state** of own instances (never "Pending").
9. **Send-back to filler (§9 #3):** a send-back from any approver surfaces a red banner + reason + Re-fill on `CS-CHK-STATUS`, returning to Suresh (not the previous approver); Re-fill reopens fill.
10. **Read-only roster + profile:** `CS-ROSTER-OWN` shows own shifts with no create/edit affordance; `SH-PROFILE` shows role/reports-to/cleaning areas + logout.
11. **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.
12. **Chrome + scope:** navy top app bar + Game-Zone scope strip + 5-slot bottom nav (slot 2 "Cleaning") + orange FAB on fill screens, matching `DESIGN_SYSTEM §8.2`; no cross-Game-Zone 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

- **8 screen mockups** (login, dashboard, today's checklists, fill, submit, status, profile, roster) · **6 state variants** · **3 bottom-sheets** = **17 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, notifications, device register — **the same set as the anchor**.
- **This is a clone:** if the anchor's Flutter widgets are role-generic (render from `/me`), the only net-new work is (a) the cleaning seed templates, (b) the cleaning auto-assign branch (BE), and (c) confirming slot-2 nav comes through as "Cleaning".

## Blocking questions / decisions before build

- [ ] **Cleaning auto-assign rule (gap, `api-contract.md`):** CS is not ride-certified — confirm how cleaning/hygiene templates land. Option (a) cleaning area modelled as a `Ride` + CS certified on it (reuses existing gate); option (b) a role/category rule that auto-gets all active `cleaning_hygiene` templates for the GZ + shift. Confirm at the client demo (`§9 #2/#12`). **Blocks the BE auto-assign branch only — the UI is unaffected.**
- [ ] **Cleaning seed templates:** confirm the exact "Cleaning / Hygiene — Daily" + any washroom/café/court rounds (frequencies) at the demo. The HTML uses realistic placeholders from the Park Opening/Closing hygiene items.
- [ ] **Cleaning area master:** are washrooms/café/courts a distinct master list (per Game Zone), or reuse the `Ride` table relabelled? Affects the roster `ride` column meaning for CS.
- [ ] Everything else (completion-photo count = ≥1 §9 #7, server time + auto initials §9 #9, re-fill restarts from TL §9 #8, FCM iOS APNs, tester model) is **already resolved** and inherited from the anchor — do not re-ask.

---

## File references
- Pack root: `docs/design/dev-mode-v1.0/cleaning-supervisor-mobile/`
- **Anchor (the template this clones):** `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`
