Repository navigation
fix(pedidos): el Hub crea clientes nuevos y guarda pedidos sin conexión (B-19, B-20) - #356
Merged
Merged
Conversation
…ón (B-19, B-20) B-19 (#346): el workspace no habilitaba 'Crear pedido' con un cliente nuevo (sin clienteId no había preview) y, aunque lo hiciera, el commit enviaba clienteId vacío y PedidoCreateSchema lo rechazaba (400). - POST /api/pedidos/preview acepta clienteNuevo (solo lectura): mismo dedup por teléfono normalizado que el commit; sin historial → precios base, sin crédito. - El borrador lleva clienteNuevo; el commit envía el marcador CONSUMIDOR_FINAL como el formulario antiguo. B-20 (#347): sin red no había preview y el botón quedaba deshabilitado. - Un fallo de RED (no de servidor) habilita guardar un pedido NUEVO sin conexión; se encola con la clave del borrador y el servidor valida al sincronizar. - Cobro 'completo' con total estimado (tabla ya cargada), rotulado como estimado. Pruebas: componente, reducer, esquema, integración Postgres y 2 E2E que verifican Cliente/Pedido en la base de datos (y una sola creación tras reintentar el sync). Refs #345 Closes #346 Closes #347 Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017BSShUMAyfVrcctN9TDrwK
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
E2E: comparación contra el baseline de
|
| Shard | Fallos PR | Fallos main |
Specs que fallan solo en el PR |
|---|---|---|---|
| 1 | 12 | 12 | ninguno |
| 2 | 26 | 27 | ninguno como fallo (1 flaky) |
| 3 | 4 | 4 | ninguno |
| 4 | 9 | 8 | qa/07-offline-sync/dlq-4xx [chromium] (+2 flaky) |
| 5 | 16 | 15 | auth › signOut [chromium-mobile] |
| 6 | 23 | 23 | ninguno (1 flaky) |
| 7 | 6 | 6 | ninguno |
| 8 | 8 | 8 | ninguno |
Las diferencias, una por una:
dlq-4xx[chromium] (shard 4) yauth› signOut [chromium-mobile] (shard 5) fallan solo en el PR. Corrí ambos en esta rama contra la app local: pasan (dlq-4xxcon otros 3 specs: 19 passed; signOut en los 2 proyectos: 2 passed). Ninguno toca el preview ni el workspace del Hub (son cola offline del repartidor y sesión). Enmain,dlq-4xxaparece en el proyecto móvil (shard 8, flaky): el reparto por shard cambió al agregar tests.- Flaky (pasaron al reintentar) solo en el PR:
abonos,venta-punto-entregada,facturas› page loads yfiado-status-ui› "nuevo cliente sin pedidos no muestra banner". Los E2E de shards corren con el flag OFF (formulario antiguo), que este PR no modifica. fiado-status-ui› "cliente al límite muestra banner 2/2" falla igual enmainy en el PR (también localmente): baseline.
Conclusión: no hay fallos nuevos atribuibles al PR. No reintento ningún shard (volvería a salir rojo por el baseline).
Generated by Claude Code
2 of 3 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objetivo
Cerrar dos brechas de paridad del workspace del Pedido Hub frente al formulario antiguo, antes de reactivar
NEXT_PUBLIC_PEDIDOS_V2(sigue OFF): crear un cliente nuevo (B-19, #346) y crear un pedido sin conexión (B-20, #347). Paso del plan de activación progresiva #345.Resumen de cambios
B-19 — cliente nuevo
POST /api/pedidos/previewaceptaclienteNuevo(solo lectura, no crea nada). Lo resuelve igual que el commit: mismo teléfono normalizado ⇒ ese cliente (con su límite, bloqueo y precios); si no, cliente sin historial (precios base, sin consulta de crédito; el commit revalida).clienteNuevo; con nombre y teléfono ya hay preview y el botón se habilita.clienteIdvacío yPedidoCreateSchemalo rechazaba (400). Ahora envía el marcadorCONSUMIDOR_FINALcomo el formulario antiguo.docs/pedidos/02-api-contract-pedidos.mdy la prueba de esquema que decía que el preview descartabaclienteNuevo.B-20 — sin conexión
Criterios de aceptación
Cliente+Pedidoen la BD.Dependencias
Ninguna con #348 (PR de documentación). Basado en
main@d70a4faa.Validaciones ejecutadas
npx tsc --noEmityeslintlimpios.npm run test: 380 archivos, 3764 pruebas OK (sobre el main actual).preview-pedido-integridad): 6/6, incluye cliente nuevo (preview == commit) y teléfono existente.Cliente/Pedido/offlineIden la BD (incluido el doble drenaje del sync).e2e/pedidos-hub.spec.tscompleto: el test "offline: badge visible…" y G9 son inestables en este entorno local. Baseline: sobremainsin estos cambios también fallan 2 tests del mismo archivo (el badge offline y otro), y G9 y el badge pasan aisladamente. No hay regresión atribuible.main).Limitaciones conocidas
#0 … $0sin marca de "pendiente de envío" (paso 4 de [Funcionalidad] Activación progresiva del Pedido Hub con paridad verificada contra el legacy #345, lista sin conexión).Info para QA
Con el flag ON: Nuevo pedido → buscar un nombre inexistente → "Crear cliente nuevo" → completar nombre, teléfono y dirección → producto → crear. Luego, con el modo avión después de abrir el workspace: componer y "Guardar sin conexión"; al reconectar debe aparecer un solo pedido.
Closes #346
Closes #347
Refs #345
🤖 Generated with Claude Code
https://claude.ai/code/session_017BSShUMAyfVrcctN9TDrwK
Generated by Claude Code