This commit is contained in:
valenti
2026-09-08 07:21:34 -04:00
commit a4b224da8e
169 changed files with 27483 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
"""Overview dashboard aggregations — data for the UI Overview page."""
from __future__ import annotations
from fastapi import APIRouter, Depends
from pydantic import BaseModel
from .deps import overview_service
from ...services import OverviewService
router = APIRouter()
class OverviewResponse(BaseModel):
tenant_id: str
total_projects: int
total_requirements: int
total_tasks: int
total_tests: int
total_deployments: int
total_commits: int
jobs_running: int
jobs_queued: int
jobs_failed_24h: int
implementation_coverage_pct: float
test_coverage_pct: float
traceability_score_pct: float
project_health_pct: float
security_findings: int
failed_builds: int
active_ai_jobs: int
featured_projects: list[dict]
mock_fields: list[str]
@router.get("", response_model=OverviewResponse, summary="Overview metrics for the tenant dashboard")
async def get_overview(
svc: OverviewService = Depends(overview_service),
) -> OverviewResponse:
stats = await svc.overview()
return OverviewResponse(**stats.to_dict())