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).
45 lines
984 B
Python
45 lines
984 B
Python
from __future__ import annotations
|
|
|
|
import uuid
|
|
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, ConfigDict
|
|
|
|
from app.models.enums import NotificationDeliveryStatus, SeverityLevel
|
|
|
|
|
|
class NotificationDeliverySummary(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: uuid.UUID
|
|
destination_id: uuid.UUID
|
|
provider: str
|
|
status: NotificationDeliveryStatus
|
|
external_message_id: str | None
|
|
error_message: str | None
|
|
|
|
|
|
class AlertResponse(BaseModel):
|
|
model_config = ConfigDict(from_attributes=True)
|
|
|
|
id: uuid.UUID
|
|
company_id: uuid.UUID
|
|
detected_change_id: uuid.UUID
|
|
title: str
|
|
summary: str
|
|
why_it_matters: str
|
|
severity: SeverityLevel
|
|
confidence: float
|
|
read: bool
|
|
resolved: bool
|
|
created_at: datetime
|
|
|
|
|
|
class AlertDetailResponse(AlertResponse):
|
|
deliveries: list[NotificationDeliverySummary]
|
|
|
|
|
|
class AlertUpdate(BaseModel):
|
|
read: bool | None = None
|
|
resolved: bool | None = None
|