код написан
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
# @LAYER: Domain
|
||||
# @RELATION: DEPENDS_ON -> sqlalchemy
|
||||
|
||||
from sqlalchemy import Column, String, DateTime, JSON
|
||||
from sqlalchemy import Column, String, DateTime, JSON, Boolean
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
from .mapping import Base
|
||||
@@ -23,4 +23,21 @@ class AppConfigRecord(Base):
|
||||
|
||||
|
||||
# [/DEF:AppConfigRecord:Class]
|
||||
|
||||
# [DEF:NotificationConfig:Class]
|
||||
# @PURPOSE: Global settings for external notification providers.
|
||||
class NotificationConfig(Base):
|
||||
__tablename__ = "notification_configs"
|
||||
|
||||
id = Column(String, primary_key=True, default=lambda: str(uuid.uuid4()))
|
||||
type = Column(String, nullable=False) # SMTP, SLACK, TELEGRAM
|
||||
name = Column(String, nullable=False)
|
||||
credentials = Column(JSON, nullable=False) # Encrypted connection details
|
||||
is_active = Column(Boolean, default=True)
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
|
||||
# [/DEF:NotificationConfig:Class]
|
||||
|
||||
import uuid
|
||||
|
||||
# [/DEF:backend.src.models.config:Module]
|
||||
|
||||
Reference in New Issue
Block a user