fix/next-check-ui
safeb2c23d7 · incrementalPR #313reviewed 2026-07-16 00:14 UTC0H · 0M · 0L · 1IThe branch
- Purpose
- Fix the Contratos automation strip ('Próxima' column) to show when the daily CFE monitoring cron will actually fire next for a row — it was showing the expected-bill date, which sat in the past once a bill ran late.
- Goal
- Replace static bill-expected-date display with a frontend-computed next-cron-fire timestamp that mirrors the backend due gates exactly and is never in the past.
The changes (whole branch)
- What
- Split the shared GRACE_DAYS=3 constant into COLLECT_GRACE_DAYS and PAYMENT_GRACE_DAYS (both 3) to mirror backend independent tracking; added one paid-status boundary test for the exact-gate-tick edge case.
- Why
- Backend tracks collect grace (COLLECT_GRACE_DAYS) and payment grace (PS_GRACE_DAYS) independently; a shared constant obscured this and risked silent divergence if either changes.
- Areas
- apps/platform/bills/_lib+249−0apps/platform/bills/contratos+30−4domains/utility (comment-only)+8−0infra/cdk (comment-only)+4−0
- Blast
- 7 files, +291/-4; 2 new pure-function files + 1 component wiring + 4 comment-only cross-references
no-api-change no-db-migration frontend-only-logic twin-parity-pattern
➖ci· No check-runs found for this SHA➖coderabbit· No .coderabbit.yaml in repo
Findings · 1
improvement1
info
Payment status typed as `string` rather than a union literal
apps/platform/src/app/[locale]/(dashboard)/bills/_lib/next-check.ts
`latestPaymentStatus` accepts `string | null | undefined` but the known values are `'paid' | 'pending' | 'overdue' | 'unknown'`. Narrowing to a union literal would let the compiler catch stale string comparisons (e.g. if 'paid' were ever renamed) at zero runtime cost.