From 5a42b21a040a8142ab7354091e4140fa9b40b0a8 Mon Sep 17 00:00:00 2001 From: NguyenND Date: Thu, 16 Jul 2026 10:32:47 -0400 Subject: [PATCH] Jul 16 - Update facilities QR codes - report can upload up to 5 photos --- CLAUDE.md | 6 ++-- app/routes/public.py | 46 ++++++++++++++++++++++++------ app/templates/public/area.html | 26 +++++++++++++++-- app/templates/public/facility.html | 26 +++++++++++++++-- app/utils/forms.py | 8 +++--- 5 files changed, 90 insertions(+), 22 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index cf424d5..d0fae16 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -279,7 +279,7 @@ Triage of `handler_type` + facility/vendor detail fields on the **update** panel | Column | Type | Populated by | Displayed as | |---|---|---|---| | `photo_path` | `VARCHAR(255)` | Web form upload OR first iPad photo | "Photo Evidence" (primary) | -| `mobile_photo_paths` | `JSON` (`list[str]`) | iPad PATCH `/issues//photos` — extra evidence photos | "Photo Evidence" (additional) | +| `mobile_photo_paths` | `JSON` (`list[str]`) | iPad PATCH `/issues//photos` — extra evidence photos; **also public QR "report a problem" (photos 2–5)** | "Photo Evidence" (additional) | | `result_photos` | `JSON` (`list[str]`) | Web update form file upload — resolution photos | "Resolution Details" | **Rule:** Never write iPad evidence photos into `result_photos`. They belong in `mobile_photo_paths` so they appear under "Photo Evidence" on the web, not "Resolution Details". @@ -472,7 +472,7 @@ Management (`/scheduled-inspections/new|edit|delete`) is `@project_manager_requi | `auth` | `/auth` | `/login`, `/logout`, `/profile`, `/users/*`, `/notification-matrix` | | `dashboard` | `/` | `GET /`, `/facility-trend` (AJAX) | | `facilities` | `/facilities` | CRUD + area management + QR code: `//qr` printable page, `//qr.png` image, `POST //qr/regenerate` (invalidates old printed code), `/qr/print-all[?contract_id=]` bulk sheet. **Per-area QR (Phase 39):** `/areas//qr`, `/areas//qr.png`, `POST /areas//qr/regenerate` — mirror the facility QR routes; scope enforced by `_area_for_qr_or_403()` via the area's parent facility. **Customers may use all QR actions (including regenerate) for their own assigned facilities**; inspectors/PM/admin/director for any. Scope enforced by `_facility_for_qr_or_403()` (customers) / `get_customer_scope` (print-all). Regenerate is limited to admin/director + scoped customer (PM/inspector excluded). **QR print/export page:** `GET /qr/print-all` is a selectable sheet with filters `?contract_id=` / `?facility_id=` / `?include_areas=1` (contract narrows the facility dropdown; areas render each facility's per-area QR cards). Each card is a `