Repository navigation
feat(pedidos): Fase 7 — relación cruzada + riesgo en el peek - #233
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5 <[email protected]>
…esgo) Reemplaza el bloque bare de casos abiertos en el peek por PedidoPeekRiesgo, que consume el texto oficial de la regla (GUIA_ALERTAS de alertas-config.ts): qué se detectó · por qué importa · qué se puede hacer. Tono por severidad (ALTA rojo / MEDIA ámbar / BAJA neutro), explicación colapsada (<details>), fallback neutro si un alertaTipo no tiene guía (no inventa texto). Señal ≠ Bloqueo ≠ Acusación: footer explícito, sin botones de resolución. El peek NO embebe CasoGuiaModal — sólo cross-linkea a /casos (frontera de dominio; G4 acceso no fusión). No calcula riesgo ni redefine reglas (G7). 13 unit (7 comportamiento + 3 guardrail de fuente + regresión peek). tsc + eslint limpios. Detrás de NEXT_PUBLIC_PEDIDOS_V2 (OFF). Co-Authored-By: Claude Sonnet 5 <[email protected]>
F7-ii: PedidoPeekExtras += entregaResumen (read-only, null salvo ENTREGADO; los campos vienen del selfRow existente de GET /api/pedidos/[id], sin queries nuevas). Componente PeekEntrega: fecha (Bogotá) + "Ver ubicación" (Maps, pestaña nueva) + "Ver foto". Wireado tras el bloque de Factura. F7-iii: documentado el límite de realtime (no hay evento caso.*; un Caso del cron alertas-batch no empuja al peek abierto — aceptable, es detectivo). No se inventa el evento. E2E pedidos-peek-riesgo.spec.ts: Caso abierto aparece en el peek con su guía + cross-link a /casos que navega (no modal); pedido sin casos no muestra el bloque. 18 unit (PeekEntrega 5 + route-peek 2 + PedidoPeekRiesgo 13 de F7-i). 495 tests de pedidos verdes, tsc + eslint limpios. Fase 7 completa. Co-Authored-By: Claude Sonnet 5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Plan:
docs/pedidos/fase7-peek-riesgo-flujo-plan.md. Blueprint §5.3 (riesgo/antifraude "en el peek") + §6.2 (relación Pedidos↔Embarques↔Cartera — acceso contextual, no fusión). Gates G4 (peek no navega la lista), G7 (ninguna regla crítica solo en frontend).F7-i —
PedidoPeekRiesgoReemplaza el bloque bare de casos abiertos por uno que consume el texto oficial de la regla (
GUIA_ALERTASdealertas-config.ts): qué se detectó · por qué importa · qué se puede hacer. Tono por severidad (ALTA rojo / MEDIA ámbar / BAJA neutro), explicación colapsada (<details>), fallback neutro si unalertaTipono tiene guía. Señal ≠ Bloqueo ≠ Acusación: footer explícito, sin botones de resolución. Cross-link "Ver en Casos →" a/casos(navega, no embebeCasoGuiaModal— frontera de dominio).F7-ii — entrega en el peek
PedidoPeekExtras += entregaResumen(read-only,nullsalvoENTREGADO; los campos vienen delselfRowexistente, sin queries nuevas). ComponentePeekEntrega: fecha (Bogotá) + "Ver ubicación" (Maps, pestaña nueva) + "Ver foto".F7-iii — realtime + E2E
Documentado el límite: no hay evento realtime
caso.*(RealtimeEntityno lo incluye); unCasodel cronalertas-batchno empuja al peek abierto — aceptable (es detectivo). No se inventa el evento. E2Epedidos-peek-riesgo.spec.ts.Verificación: ~31 unit nuevos, 495 tests de pedidos verdes,
tsc+eslintlimpios. No tocaalertas-detector.ts/ el cron /salud-antifraude. No redefineAlertaTipo. No agregaentregadoPoral schema. Detrás deNEXT_PUBLIC_PEDIDOS_V2(OFF).🤖 Generated with Claude Code