fix(alertas): la bandeja mide las vencidas con la fecha de México
La bandeja comparaba el vencimiento contra `date.today()` del servidor (UTC) e Inicio contra `app.fechas.hoy()`: después de las 18:00 de México una alerta que vence hoy salía «vencida» en la bandeja y vigente en Inicio. Las dos usan ahora la fecha de México.
This commit is contained in:
1 parent
9d63162637
commit
2c150aede0
1 file changed
+2
-2
@@ -8,7 +8,6 @@ crea en el PR 3. El historial de estados se reconstruye desde `audit_trail`.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import date
|
||||
from typing import Annotated
|
||||
|
||||
from fastapi import APIRouter, Depends, Form, HTTPException, Query, Request, status
|
||||
@@ -17,6 +16,7 @@ from sqlalchemy import func, or_, select
|
||||
from sqlalchemy.orm import Session
|
||||
from starlette.responses import HTMLResponse, RedirectResponse, Response
|
||||
|
||||
from app import fechas
|
||||
from app.auth import requiere_rol
|
||||
from app.db import get_db
|
||||
from app.models import Alerta, Cliente, Credito, ReglaAlerta, Transaccion, Usuario
|
||||
@@ -136,7 +136,7 @@ def bandeja(
|
||||
filtros: Annotated[FiltrosAlertas, Depends(_filtros)],
|
||||
) -> HTMLResponse:
|
||||
tenant = tenant_de_sesion(db)
|
||||
hoy = date.today()
|
||||
hoy = fechas.hoy() # la fecha de México, la misma con la que Inicio cuenta las vencidas
|
||||
base = (
|
||||
select(Alerta, ReglaAlerta, Cliente.id_externo)
|
||||
.join(ReglaAlerta, ReglaAlerta.id == Alerta.regla_id)
|
||||
|
||||
Reference in new issue
Block a user