diff --git a/backend/__pycache__/main.cpython-312.pyc b/backend/__pycache__/main.cpython-312.pyc index a818b48..8568288 100644 Binary files a/backend/__pycache__/main.cpython-312.pyc and b/backend/__pycache__/main.cpython-312.pyc differ diff --git a/backend/main.py b/backend/main.py index 9ff27a1..a03e4c4 100644 --- a/backend/main.py +++ b/backend/main.py @@ -142,6 +142,21 @@ def colonias_por_cp( "encontrado": len(colonias) > 0 } +@app.get("/admin/rutas/estado") +def admin_estado_rutas(db: Session = Depends(get_db)): + resultado = [] + for ruta in simulator.RUTAS: + eta = simulator.get_eta(ruta["routeId"], db) + resultado.append({ + "route_id": ruta["routeId"], + "name": ruta["name"], + "evento": eta["evento"] if eta else "DESCONOCIDO", + "current_position": eta.get("current_position", 0) if eta else 0, + "ventana_inicio": eta["ventana_inicio"] if eta else "--", + "ventana_fin": eta["ventana_fin"] if eta else "--", + }) + return resultado + @app.post("/reportes") def crear_reporte( domicilio_id: int,