# app/modules/hosting/routes/api/admin_stats.py
"""
Admin API routes for hosting dashboard statistics.
"""

import logging

from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session

from app.api.deps import get_current_admin_api
from app.core.database import get_db
from app.modules.hosting.services.stats_service import stats_service
from app.modules.tenancy.schemas.auth import UserContext

router = APIRouter(prefix="/stats")
logger = logging.getLogger(__name__)


@router.get("/dashboard")
def get_dashboard_stats(
    db: Session = Depends(get_db),
    current_admin: UserContext = Depends(get_current_admin_api),
):
    """Get dashboard statistics for the hosting module."""
    return stats_service.get_dashboard_stats(db)
