FastAPI + Celery + Next.js + Postgres/Redis app with company monitoring, source collection, LLM-based change analysis, enrichment, and account security (Turnstile, escalating lockout, email verification).
33 lines
647 B
Python
33 lines
647 B
Python
from __future__ import annotations
|
|
|
|
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
class RunsByDayPoint(BaseModel):
|
|
date: str
|
|
successful: int
|
|
failed: int
|
|
other: int
|
|
|
|
|
|
class RecentSignal(BaseModel):
|
|
id: uuid.UUID
|
|
company_id: uuid.UUID
|
|
company_name: str
|
|
change_type: str
|
|
severity: str
|
|
confidence_score: float
|
|
summary: str
|
|
created_at: datetime
|
|
|
|
|
|
class DashboardAnalytics(BaseModel):
|
|
changes_by_type: dict[str, int]
|
|
alerts_by_severity: dict[str, int]
|
|
sources_by_status: dict[str, int]
|
|
runs_by_day: list[RunsByDayPoint]
|
|
recent_signals: list[RecentSignal]
|