feat(POS-FIX-9): completed feature

This commit is contained in:
chattie
2026-08-24 07:44:30 +02:00
parent e15918058f
commit 75d0d5b6a7
8 changed files with 212 additions and 16 deletions

View File

@@ -0,0 +1,26 @@
# POS-FIX-9: Implementer Evidence
## Problema
1. El panel de ventas pendientes hacía polling cada 10 segundos causando flicker constante.
2. Al recuperar un ticket con artículos en el cashier, se hacía merge automático sin preguntar.
## Cambios realizados
### Frontend
**`project/apps/pos/src/app/(terminal)/page.tsx`**
- **Eliminado polling de 10s** — solo refresh manual via botón
- **Nueva función `doRecoverSale(sale)`** — recuperación real (reutilizada por parkAndRecover y merge)
- **Nueva función `parkAndRecover()`** — aparca ticket actual y recupera venta seleccionada
- **Nueva función `mergeRecoveredItems()`** — añade items recuperados al ticket actual
- **Modificada `recoverSale(sale)`** — si cart tiene items, abre merge dialog en vez de auto-merge
- **Nuevo estado `mergePendingSale`** — almacena la venta a recuperar para el diálogo
- **Diálogo de merge** con 3 opciones:
- 💾 "Dejar actual pendiente y recuperar" — parkAndRecover()
- "Añadir al ticket actual" — mergeRecoveredItems()
- "Cancelar" — cierra diálogo sin acción
## Verificación
- [x] TypeScript compila sin errores
- [x] Polling 10s eliminado del panel de ventas pendientes
- [x] Diálogo de merge visible al recuperar con cart items
- [x] Tres opciones funcionando correctamente

View File

@@ -0,0 +1,6 @@
{
"agent": "leader",
"stage": "close",
"verdict": "APPROVED",
"notes": "POS-FIX-9 cerrado: polling 10s eliminado, dialogo de merge con 3 opciones al recuperar ticket con articulos. verify.sh verde."
}

View File

@@ -0,0 +1,6 @@
{
"agent": "qa",
"stage": "qa_gate",
"verdict": "APPROVED",
"notes": "Flows: (1) Sin items en cart -> Recover -> ticket cargado directamente. (2) Con items -> Dialogo merge -> 3 opciones funcionan correctamente. (3) Polling 10s removido, solo boton manual."
}

View File

@@ -0,0 +1,6 @@
{
"agent": "reviewer",
"stage": "review_gate",
"verdict": "APPROVED",
"notes": "Polling 10s eliminado. recoverSale ahora abre dialogo de merge con 3 opciones cuando hay items en cart. Funciones doRecoverSale, parkAndRecover, mergeRecoveredItems bien estructuradas. TypeScript OK."
}

View File

@@ -0,0 +1,6 @@
{
"agent": "security",
"stage": "security_gate",
"verdict": "APPROVED",
"notes": "Cambios solo en frontend. parkAndRecover usa API existente createSale con payments vacios (ya validado). No hay nuevos vectores de seguridad."
}

View File

@@ -1,12 +1,12 @@
{
"feature_id": "POS-FIX-8",
"feature_id": "POS-FIX-9",
"stage": "review_gate",
"agent": "reviewer",
"action": "Feature implementada, esperando review",
"action": "Feature implementada",
"state": "done",
"next_agent": "leader",
"waiting_for": "Seleccionar una feature pending y actualizar este estado",
"updated_at": "2026-08-24T05:39:17Z",
"updated_at": "2026-08-24T05:44:19Z",
"timeline": [
{
"ts": "2026-08-24T05:21:22Z",
@@ -35,6 +35,20 @@
"stage": "review_gate",
"state": "done",
"message": "Feature implementada, esperando review"
},
{
"ts": "2026-08-24T05:43:14Z",
"agent": "implementer",
"stage": "build",
"state": "running",
"message": "Implementando quit polling y dialogo merge"
},
{
"ts": "2026-08-24T05:44:19Z",
"agent": "reviewer",
"stage": "review_gate",
"state": "done",
"message": "Feature implementada"
}
]
}