← all branches

fix/next-check-ui

safe
b2c23d7 · incrementalPR #313reviewed 2026-07-16 00:14 UTC0H · 0M · 0L · 1I
The 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+2490apps/platform/bills/contratos+304domains/utility (comment-only)+80infra/cdk (comment-only)+40
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 SHAcoderabbit· 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.

History · 3 commits

  1. b2c23d7safeincremental0H · 0M · 0L2026-07-16 00:14current
  2. c531302needs attentionfull0H · 2M · 5L2026-07-15 23:47
  3. a52a19dneeds attentionfull2H · 5M · 3L2026-07-15 23:33