Repository navigation
feat(pagos): tres fechas del pago y tabla Regularizacion (#402) - #465
Merged
Merged
Conversation
- Pago.createdAt sigue siendo la fecha de registro (now(); ningún writer la fija, test que recorre src/ y lo exige). - Pago.ocurridoAt (fecha del hecho; NULL = igual a createdAt) y Pago.regularizacionId → Regularizacion (lote, motivo, evidencia, autorizadoPor, ejecutadoPor, ejecutadoAt, simulacionHash). - CHECK: un pago de regularización exige ocurridoAt <= createdAt. - Cierre de caja (GET y POST): excluye los pagos de regularización de la caja y de los REPORTADO del día en que se registran. - Regla V14 del verificador: cierre que contó un pago de regularización. - Migración 20261024 idempotente, solo agrega; CI la aplica tras db push. Closes #402 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01N4EvimoVAYZdhzbZsGvFNV
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Owner
Author
|
CI en
Pendiente antes del merge (#359): aplicar la migración Generated by Claude Code |
Owner
Author
|
Migración aplicada en producción (2026-10-24, autorizada por el usuario). Se aplicó en dos transacciones con Verificado con consultas de solo lectura:
Listo para merge cuando el usuario lo pida. Generated by Claude Code |
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
Registrar cuándo ocurrió un cobro sin reescribir cuándo se registró, y dejar auditado quién autorizó y ejecutó cada regularización histórica. Plan de integridad v1.2 §5.D.
Cambios
Pago.createdAtsigue siendo la fecha de registro: la pone la base (now()).pago-created-at-writers.test.tsrecorresrc/y falla si algún writer dePagopasacreatedAt.Pago.ocurridoAtguarda la fecha del hecho.NULL= igual acreatedAt(pago normal).Pago.regularizacionIdapunta a la nueva tablaRegularizacion:lote(único),motivo,evidencia,autorizadoPorId,ejecutadoPorId,ejecutadoAt,simulacionHash;ejecutadoAtes la fecha de regularización.chk_pago_regularizacion_ocurrido: un pago de regularización exigeocurridoAt <= createdAt./api/cierre, GET y POST): los pagos de regularización no entran a la caja ni a los REPORTADO del día en que se registran./reportes,/reportes/ventas,/api/reportes/ventas).20261024_pago_tres_fechas_regularizacion:db push.prisma/clean.tsincluyeRegularizacion.Fuera de alcance
Ejecutar regularizaciones: cada lote es una autorización aparte (#403, #404).
Validación local (Postgres 16)
pago-tres-fechas-regularizacion.test.ts, 4/4:GET /api/cierrecuenta 5.000 y no 8.000;main.prisma migrate diffcontra el schema nuevo da una migración vacía.npx tsc --noEmity eslint limpios.Despliegue (regla de #359)
La migración se aplica en producción antes del merge, con autorización expresa del usuario, y se verifica con consultas de solo lectura.
Closes #402
Generated by Claude Code