Files
security-alert-center/backend/app/services/notification_severity.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

12 lines
340 B
Python

"""Severity ordering for notification policy gates."""
SEVERITY_ORDER = {"info": 10, "warning": 20, "high": 30, "critical": 40}
def severity_value(value: str) -> int:
return SEVERITY_ORDER.get(value, 0)
def severity_meets_minimum(severity: str, minimum: str) -> bool:
return severity_value(severity) >= severity_value(minimum)