feat(scoring): composite recency decay and severity weights persisted in DB [FASE-5.1]

This commit is contained in:
2026-05-18 15:07:12 +02:00
parent 2ee59d4e18
commit 05b221a22d
13 changed files with 588 additions and 154 deletions

View File

@@ -21,6 +21,7 @@ from app.services.snapshot_service import (
create_snapshot,
compare_snapshots,
cleanup_old_snapshots,
get_coverage_evolution,
serialize_snapshot_summary,
list_snapshots as list_snapshots_svc,
get_snapshot_or_raise,
@@ -82,6 +83,21 @@ def create_snapshot_endpoint(
return serialize_snapshot_summary(snapshot)
# ---------------------------------------------------------------------------
# GET /snapshots/evolution — Coverage trend over time
# ---------------------------------------------------------------------------
@router.get("/evolution")
def coverage_evolution(
months: int = Query(12, ge=1, le=36),
db: Session = Depends(get_db),
current_user: User = Depends(get_current_user),
):
"""Return coverage snapshots for trend charts (last *months* months)."""
return get_coverage_evolution(db, months=months)
# ---------------------------------------------------------------------------
# GET /snapshots/compare — Compare two snapshots
# ---------------------------------------------------------------------------