Actualizar backend/main.py
This commit is contained in:
@@ -102,6 +102,49 @@ def get_vendedores(
|
|||||||
raise HTTPException(status_code=500, detail=str(e))
|
raise HTTPException(status_code=500, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/api/tiempo-respuesta/detalle")
|
||||||
|
def get_tiempo_respuesta_detalle(
|
||||||
|
dia: int = Query(...),
|
||||||
|
modo: str = Query("asignacion"),
|
||||||
|
vendedor: str = Query("TODOS"),
|
||||||
|
ano: str = Query("TODOS"),
|
||||||
|
mes: str = Query("TODOS"),
|
||||||
|
):
|
||||||
|
try:
|
||||||
|
return services.tiempo_respuesta_detalle(dia, modo, vendedor, ano, mes)
|
||||||
|
except Exception as e:
|
||||||
|
raise HTTPException(status_code=500, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/api/programa/opciones")
|
||||||
|
def get_programa_opciones(ano: str = Query("TODOS"), mes: str = Query("TODOS")):
|
||||||
|
try:
|
||||||
|
return {"programas": services.programa_opciones(ano, mes)}
|
||||||
|
except Exception as e:
|
||||||
|
raise HTTPException(status_code=500, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/api/programa")
|
||||||
|
def get_programa(
|
||||||
|
ano: str = Query("TODOS"),
|
||||||
|
mes: str = Query("TODOS"),
|
||||||
|
programa: str = Query("TODOS"),
|
||||||
|
):
|
||||||
|
try:
|
||||||
|
return services.programa_dashboard(ano, mes, programa)
|
||||||
|
except Exception as e:
|
||||||
|
raise HTTPException(status_code=500, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
|
@app.get("/api/alertas")
|
||||||
|
def get_alertas_dash():
|
||||||
|
"""Cursos proximos a iniciar (<=30d) clasificados critico/advertencia/buen rumbo."""
|
||||||
|
try:
|
||||||
|
return services.alertas_dashboard()
|
||||||
|
except Exception as e:
|
||||||
|
raise HTTPException(status_code=500, detail=str(e))
|
||||||
|
|
||||||
|
|
||||||
@app.get("/api/roas")
|
@app.get("/api/roas")
|
||||||
def get_roas(
|
def get_roas(
|
||||||
ano: str = Query("TODOS"),
|
ano: str = Query("TODOS"),
|
||||||
|
|||||||
Reference in New Issue
Block a user