Fix dashboard data findings from browser verification
All checks were successful
Deploy to VPS / test (push) Successful in 1m32s
Deploy to VPS / deploy (push) Successful in 1m2s

- Próximas cuotas: headline is the upcoming billing batch (sum of every
  active plan's next cuota, using the rounding-absorbing last cuota
  when it's the pending one) — the in-cycle formula was ~always zero
  since cuotas bill on the 19th, day one of the next cycle.
- useAgent must name the 'wealthysmart' agent (default crashed the page).
- /transactions/recent excludes future-dated Tasa Cero cuotas.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Carlos Escalante
2026-07-04 11:02:26 -06:00
parent b1c387c415
commit 10d9bd209f
3 changed files with 32 additions and 19 deletions

View File

@@ -253,9 +253,15 @@ def recent_transactions(
session: Session = Depends(get_session),
_user: str = Depends(get_current_user),
):
from app.timeutil import utcnow
query = (
select(Transaction)
.where(Transaction.source == TransactionSource.CREDIT_CARD)
.where(
Transaction.source == TransactionSource.CREDIT_CARD,
# Tasa Cero generates future-dated cuotas; "recent" means billed.
Transaction.date <= utcnow(),
)
.order_by(col(Transaction.date).desc(), col(Transaction.id).desc())
.limit(limit)
)