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>
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
Reference in New Issue
Block a user