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