# Decisions

## Inherited from the template (binding)

Full text: `github.com/Ezytail/ezyflow-webapp-template/tree/master/docs/adr`.

| ADR | Decision | Consequence for EzyOrder |
| --- | --- | --- |
| 0001 | TypeScript-first stack | No .NET / PHP side services |
| 0002 | TanStack Start | Screens are file routes; server work in `createServerFn` |
| 0003 | Scaffold CLI wraps TanStack CLI | Generation is `tanstack create`'s |
| 0004 | Two identities: machine API client + pluggable OIDC | API never sees App users; roles from one OIDC claim |
| 0005 | Postgres in every App | Inbox, login, drafts live there |
| 0006 | SDK generated from pinned specs | Use SDK types; never hand-write API types |
| 0007 | pnpm monorepo + Changesets (template side) | — |
| 0008 | Webhook inbox with pg-boss | Deliveries are de-duplicated and retried; handlers idempotent |
| 0009 | Better Auth + Drizzle | Schema changes via `db:generate` / `db:migrate` |
| 0010 | One activity per App | Never pass `activity`; a second activity = a second deployment |
| 0011 | Thin scaffold, fat runtime | Don't reimplement Runtime behaviour; upgrade the package instead |
| 0012 | Packages on GitHub Packages `@ezytail` | Needs `read:packages` token |
| 0013 | Packages version = API release | SDK and Runtime always at the same version |
| 0014 | Bundles ship inside the CLI | — |
| 0015 | Agent material generated into the App | Never edit Brief / Primer; run `ezyflow:agents` |
| 0016 | MCP server exposes the whole API client | Sessions can push live: rehearse first |

## EzyOrder decisions

Format: `EO-NNN — title — status — date`, then context / decision / consequences in a few lines.

### EO-001 — English for all development artefacts — accepted — 2026-10-12

Code, comments, commits, docs and `.ai/` are in English. Only end-user UI copy is localised
(FR, EN) through the paraglide catalogs.

### EO-002 — Receipt notice maps to `procurement.created` — proposed — 2026-10-12

The customer's "annonce de réception" is an announced inbound supply, which the API models as a
procurement. `receipt.confirmed` is the later confirmation. To confirm against the activity's
event catalog before building the form.

### EO-003 — Rehearsal is mandatory before every push in the UI — accepted — 2026-10-12

The Push button is disabled until the same body has been rehearsed successfully. Mirrors the
reference App and the Brief's rule 7.
