feat(15-01): add signal history and site alert services, routers, and main.py wiring

- Create signal_history_service with TimescaleDB time_bucket queries for 24h/7d/30d ranges
- Create site_alert_service with full CRUD for rules, events list/resolve, and active count
- Create signal_history router with GET endpoint for time-bucketed signal data
- Create site_alerts router with CRUD endpoints for rules and event management
- Wire both routers into main.py with /api prefix

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-19 07:18:02 -05:00
parent b9a92f3869
commit 124a72582b
5 changed files with 720 additions and 0 deletions

View File

@@ -465,6 +465,8 @@ def create_app() -> FastAPI:
from app.routers.sites import router as sites_router
from app.routers.links import router as links_router
from app.routers.sectors import router as sectors_router
from app.routers.signal_history import router as signal_history_router
from app.routers.site_alerts import router as site_alerts_router
app.include_router(auth_router, prefix="/api")
app.include_router(tenants_router, prefix="/api")
@@ -497,6 +499,8 @@ def create_app() -> FastAPI:
app.include_router(sites_router, prefix="/api")
app.include_router(links_router, prefix="/api")
app.include_router(sectors_router, prefix="/api")
app.include_router(signal_history_router, prefix="/api")
app.include_router(site_alerts_router, prefix="/api")
# Health check endpoints
@app.get("/health", tags=["health"])