feat: Complete ATLAS system installation and API fixes
## Backend Changes - Add new API endpoints: combustible, pois, mantenimiento, video, configuracion - Fix vehiculos endpoint to return paginated response with items array - Add /vehiculos/all endpoint for non-paginated list - Add /geocercas/all endpoint - Add /alertas/configuracion GET/PUT endpoints - Add /viajes/activos and /viajes/iniciar endpoints - Add /reportes/stats, /reportes/templates, /reportes/preview endpoints - Add /conductores/all and /conductores/disponibles endpoints - Update router.py to include all new modules ## Frontend Changes - Fix authentication token handling (snake_case vs camelCase) - Update vehiculosApi.listAll to use /vehiculos/all - Fix FuelGauge component usage in Combustible page - Fix chart component exports (named + default exports) - Update API client for proper token refresh ## Infrastructure - Rename services from ADAN to ATLAS - Configure Cloudflare tunnel for atlas.consultoria-as.com - Update systemd service files - Configure PostgreSQL with TimescaleDB - Configure Redis, Mosquitto, Traccar, MediaMTX ## Documentation - Update installation guides - Update API reference - Rename all ADAN references to ATLAS Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -75,6 +75,36 @@ async def listar_conductores(
|
||||
]
|
||||
|
||||
|
||||
@router.get("/all")
|
||||
async def listar_todos_conductores(
|
||||
db: AsyncSession = Depends(get_db),
|
||||
current_user: Usuario = Depends(get_current_user),
|
||||
):
|
||||
"""Lista todos los conductores activos."""
|
||||
result = await db.execute(select(Conductor).where(Conductor.activo == True))
|
||||
conductores = result.scalars().all()
|
||||
return [
|
||||
{"id": c.id, "nombre": c.nombre, "apellido": c.apellido, "telefono": c.telefono}
|
||||
for c in conductores
|
||||
]
|
||||
|
||||
|
||||
@router.get("/disponibles")
|
||||
async def listar_conductores_disponibles(
|
||||
db: AsyncSession = Depends(get_db),
|
||||
current_user: Usuario = Depends(get_current_user),
|
||||
):
|
||||
"""Lista conductores disponibles (sin vehículo asignado)."""
|
||||
result = await db.execute(
|
||||
select(Conductor).where(Conductor.activo == True, Conductor.vehiculo_actual_id == None)
|
||||
)
|
||||
conductores = result.scalars().all()
|
||||
return [
|
||||
{"id": c.id, "nombre": c.nombre, "apellido": c.apellido}
|
||||
for c in conductores
|
||||
]
|
||||
|
||||
|
||||
@router.get("/{conductor_id}", response_model=ConductorResponse)
|
||||
async def obtener_conductor(
|
||||
conductor_id: int,
|
||||
|
||||
Reference in New Issue
Block a user