From 7e8dcc74dbdb228a467b1467d3ea1d71a26a9e5a Mon Sep 17 00:00:00 2001 From: Dave Date: Thu, 5 Nov 2026 22:29:54 +0200 Subject: [PATCH] =?UTF-8?q?docs(agents):=20point=20at=20the=20repairs=20sp?= =?UTF-8?q?ec=20=E2=80=94=20the=20repair=20flow=20is=20not=20in=20the=20co?= =?UTF-8?q?de?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AGENTS.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/AGENTS.md b/AGENTS.md index f32f35c..9eba1f8 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -339,6 +339,34 @@ The preview popup is REUSED, not rebuilt: the service emits `SearchPreviewDialog` (`src/app/(app)/search/search-preview.tsx`), so the manager sees the same quick-overview the desk sees on /search. +# Repairs (`/repairs`) — the machine-repair job, and the phone app planned for it + +The job runs: customer reports a broken machine → we collect it → the +repairs person books it in (photos, serial number, whose machine it is, +what the customer says is wrong, what the supplier must look at) → the +driver carries the printed request to the supplier → the supplier keeps a +copy, signs one and hands it back → supplier quote uploaded → customer +quote → customer order → the buyer approves the order or rejects it and +collects the machine back unrepaired. + +**That flow is not in the code.** It came from the operator on 2026-11-05. +Design: `docs/superpowers/specs/2026-11-05-repairs-app-design.md`. The +planned phone app lives at `/repairs-app`, not built yet. + +- Status vocabulary `new → assessing → quoted → approved → in_progress → + completed` (+ `cancelled`) is guarded by `ALLOWED_TRANSITIONS` in + `src/lib/server/repairs-service.ts`. The **labels are duplicated in + three places** — `repairs/page.tsx`, `repairs/[id]/page.tsx` and the + PDF map in `repairs-service.ts` — with three different sets of words. + Don't add a fourth; the spec consolidates them into + `src/lib/repair-status.ts`. +- `repairs.order` and `orders.is_repair_order` **exist and are never + written**. The order ↔ repair match is designed but not built. +- A Repair Request is a **paper document for the supplier**, not a + delivery note. Repairs do not flow through the customer-DN pipeline. +- `createCustomerQuoteFromRepair` refuses to overwrite an existing + `customer_quote` link unless `replace: true` is passed. + # The POS counter never sells at R0 The POS (`/api/v1/pos/catalog`) lists `stock_items` matching