Files
security-alert-center/backend/app/models/notification_policy.py
T
PapaTramp ebb450be92 feat: global notification policy severity to channels (notif-22)
Singleton notification_policy table, NOTIFY_MIN_SEVERITY/CHANNELS env,
central dispatch gate, Settings policy UI, migration 007.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-29 16:19:26 +10:00

19 lines
667 B
Python

from sqlalchemy import Boolean, String
from sqlalchemy.orm import Mapped, mapped_column
from app.database import Base
POLICY_ROW_ID = 1
class NotificationPolicy(Base):
"""Singleton: глобальное правило severity → каналы (F-NOT-02 урезанно)."""
__tablename__ = "notification_policy"
id: Mapped[int] = mapped_column(primary_key=True)
min_severity: Mapped[str] = mapped_column(String(16), default="warning")
use_telegram: Mapped[bool] = mapped_column(Boolean, default=True)
use_webhook: Mapped[bool] = mapped_column(Boolean, default=False)
use_email: Mapped[bool] = mapped_column(Boolean, default=False)