"""
Router Configuration and Management
"""
from fastapi import APIRouter, FastAPI
from src.core.routers import api_router
from src.core.config import settings

# Create a root router for health check
root_router = APIRouter()

@root_router.get("/health")
async def health_check():
    """Simple health check endpoint for Docker health checks"""
    return {"status": "healthy", "message": "Application is running"}


def include_routers(app: FastAPI):
    """
    Include all application routers with their respective configurations.
    
    Args:
        app: FastAPI application instance
    """
    # Root level routes (like health check)
    app.include_router(root_router)

    # Main API v1 routes
    app.include_router(
        api_router, 
        prefix=getattr(settings, 'API_ROUTE_PREFIX', '/api/v1')
    )
