1.4 KiB
1.4 KiB
F-085 — Implementer evidence
What was implemented
/tax-rates TIPO column is now inline-editable. Server validates the value against the same enum used by pricing.
Files changed
project/src/modules/pricing/api/pricing.routes.ts- PATCH
/admin/tax-rates/:idbody schema now acceptsappliesTo: z.enum(['general','reduced','super-reduced']).optional(). - Added an UPDATE branch
applies_to = $Nmirroring the existing branches.
- PATCH
project/apps/admin/src/app/(dashboard)/tax-rates/page.tsx- New state:
tipoEditing,savingTipo. - New handler:
saveTipo(id, newTipo)→taxApi.update(id, { appliesTo })→ in-place row update. - TIPO cell:
<button>shows current value with hover affordance; click swaps to a<select autoFocus>with the three allowed options. On change, PATCH fires immediately. On blur (without change), edit mode closes.
- New state:
Validation
npx tsc --noEmit→ exit 0npx eslinton touched files → exit 0
Acceptance trace
- "TIPO cell enters edit mode on a single click and shows a select with allowed types" → button → select.
- "Selecting a new type and confirming triggers PATCH /tax-rates/:id" → onChange handler.
- "Invalid types are rejected client and server side" → Zod enum on server; only three options in select.
- "Successful change is reflected in the cell without a full page reload" → in-place
rates.map. - "verify.sh is green" → tsc + eslint clean.