Initial commit: CI Agent competitive-intelligence monitoring app
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).
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import uuid
|
||||
|
||||
from sqlalchemy import Boolean, Enum, Float, ForeignKey, String, Text
|
||||
from sqlalchemy.orm import Mapped, mapped_column
|
||||
|
||||
from app.db.base import Base, TimestampMixin, UUIDPrimaryKeyMixin
|
||||
from app.models.enums import SeverityLevel
|
||||
|
||||
|
||||
class Alert(Base, UUIDPrimaryKeyMixin, TimestampMixin):
|
||||
__tablename__ = "alerts"
|
||||
|
||||
company_id: Mapped[uuid.UUID] = mapped_column(
|
||||
ForeignKey("companies.id", ondelete="CASCADE"), index=True
|
||||
)
|
||||
detected_change_id: Mapped[uuid.UUID] = mapped_column(
|
||||
ForeignKey("detected_changes.id", ondelete="CASCADE"), index=True
|
||||
)
|
||||
user_id: Mapped[uuid.UUID] = mapped_column(
|
||||
ForeignKey("users.id", ondelete="CASCADE"), index=True
|
||||
)
|
||||
title: Mapped[str] = mapped_column(String(200))
|
||||
summary: Mapped[str] = mapped_column(Text)
|
||||
why_it_matters: Mapped[str] = mapped_column(Text)
|
||||
severity: Mapped[SeverityLevel] = mapped_column(
|
||||
Enum(SeverityLevel, native_enum=False, length=20)
|
||||
)
|
||||
confidence: Mapped[float] = mapped_column(Float)
|
||||
read: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
resolved: Mapped[bool] = mapped_column(Boolean, default=False)
|
||||
Reference in New Issue
Block a user