Files
mercadodevida/work/current.md
2026-08-20 21:29:14 +02:00

42 lines
2.9 KiB
Markdown

# Feature actual
## Feature activa: F-088 (in_progress) — Admin `taxApi.update` type signature missing `appliesTo` (F-085 regression)
Backlog: 156 features (146 done, 9 pending, 1 in_progress).
Últimas features cerradas: **F-080**, **F-081**, **F-082**, **F-083**, **F-084**, **F-085**, **F-086**, **F-087**.
## Symptom reportado por el operador (2026-08-20)
`http://192.168.18.93:3004/``ERR_CONNECTION_REFUSED`. El servicio admin del monolito no se mantiene en pie. Diagnóstico:
- `monolith.sh prod status` → admin `exited during startup`, log: `Could not find a production build in the '.next' directory`.
- `apps/admin/.next/` existe pero no contiene `BUILD_ID` ni `required-server-files.json`.
- `npx tsc --noEmit` en `apps/admin``error TS2353` en `tax-rates/page.tsx(59,33)`: `'appliesTo' does not exist in type 'Partial<{ name: string; ratePercent: number; active: boolean; }>'`.
## Root cause
F-085 añadió el handler `saveTipo` que llama a `taxApi.update(id, { appliesTo })` y extendió la página con UI de edición inline, pero olvidó extender la firma de `taxApi.update` en `apps/admin/src/lib/api-client.ts`. Resultado: `next build` aborta por typecheck, no se genera `BUILD_ID`, `next start` falla y el admin no puede servir nada en :3004. El backend en `pricing.routes.ts` ya valida y persiste `appliesTo`, así que el fix es 100% frontend (type only).
## Fix
Ampliar la firma `Partial<{...}>` de `taxApi.update` para aceptar `appliesTo: 'general' | 'reduced' | 'super-reduced'` (mismo enum que el backend). Después: `npm run build` en `apps/admin` produce `BUILD_ID`, `monolith.sh prod` mantiene el admin vivo y `http://192.168.18.93:3004/` responde 200.
## Pending tickets (next up — pick ONE)
(Se mantienen en `pending` por si reaparecen tras cerrar F-088; ninguno bloquea la operativa actual más allá de F-088 mismo.)
1. **F-079** [bug] `/products` listing does not show brand
2. **F-080** [fix] `PVP (IVA incl.)` input in Prices tab locks decimal editing
3. **F-081** [fix] Inventory `PRECIO NETO` input has wrong format and no save
4. **F-082** [fix] `/inventory` editable fields cannot be saved; Stock UX needs click-to-edit
5. **F-083** [feature] `/customers` password reset via email link
6. **F-084** [bug] Parent categories list does not show emoji in front of the name
7. **F-085** [fix] `/tax-rates` `TIPO` column is not editable *(closed earlier but with missing type signature; F-088 repairs the regression)*
8. **F-086** [feature] Product expiration date (`fecha de caducidad`) field — backend + admin + listing + inventory
9. **F-087** [feature] Frontend cart: cap quantity to available stock
## Nota de intake (2026-08-20)
El operador reportó `ERR_CONNECTION_REFUSED` en :3004. El triage lo une a F-085 (cambio parcial sin actualizar la firma TS). Se crea F-088 para reparar la regresión sin reabrir F-085, y se ejecuta por orquestra secuencial.