feat(sales): add decoupled 17k commercial sales router, ranking engine, and ingestion pipeline
This commit is contained in:
1 parent
ebba583c66
commit
aae2d508e8
8 files changed
+627
No files matched your search
@@ -10,10 +10,12 @@ import pandas as pd
|
||||
from fastapi import FastAPI, Header, HTTPException, Query, Security, status
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from routes.sales import sales_router
|
||||
|
||||
# Production auth secret required for Go backend header integration
|
||||
AUTH_SECRET = "hiffi_live_secret_key_prod_2026"
|
||||
|
||||
|
||||
def verify_auth_secret(x_auth_secret: Optional[str] = Header(None)) -> str:
|
||||
"""
|
||||
Validates the incoming X-Auth-Secret header for backend-to-backend communication.
|
||||
@@ -57,6 +59,9 @@ app.add_middleware(
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# Mount decoupled commercial sales router
|
||||
app.include_router(sales_router)
|
||||
|
||||
|
||||
def load_dataset() -> pd.DataFrame:
|
||||
"""Loads artist dataset with fallback paths."""
|
||||
@@ -122,6 +127,7 @@ def list_artists(
|
||||
) -> List[Dict[str, Any]]:
|
||||
"""
|
||||
Returns ranked artist list respecting data governance scopes.
|
||||
Strictly locked to the 500-artist telemetry cohort. Zero commercial sales leakage.
|
||||
"""
|
||||
df = load_dataset()
|
||||
if df.empty:
|
||||
|
||||
Reference in new issue
Block a user