diff --git a/services/api-gateway/app/models/__init__.py b/services/api-gateway/app/models/__init__.py index 027c644..a45b9ad 100644 --- a/services/api-gateway/app/models/__init__.py +++ b/services/api-gateway/app/models/__init__.py @@ -3,6 +3,7 @@ from app.models.whatsapp import WhatsAppAccount, Contact, Conversation, Message from app.models.flow import Flow, FlowSession, TriggerType from app.models.queue import Queue, QueueAgent, AssignmentMethod from app.models.quick_reply import QuickReply +from app.models.global_variable import GlobalVariable __all__ = [ "User", @@ -17,4 +18,5 @@ __all__ = [ "QueueAgent", "AssignmentMethod", "QuickReply", + "GlobalVariable", ] diff --git a/services/api-gateway/app/models/global_variable.py b/services/api-gateway/app/models/global_variable.py new file mode 100644 index 0000000..5272aa1 --- /dev/null +++ b/services/api-gateway/app/models/global_variable.py @@ -0,0 +1,18 @@ +import uuid +from datetime import datetime +from sqlalchemy import Column, String, Text, DateTime, Boolean +from sqlalchemy.dialects.postgresql import UUID +from app.core.database import Base + + +class GlobalVariable(Base): + __tablename__ = "global_variables" + + id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4) + key = Column(String(100), nullable=False, unique=True, index=True) + value = Column(Text, nullable=True) + value_type = Column(String(20), default="string", nullable=False) + description = Column(String(500), nullable=True) + is_secret = Column(Boolean, default=False, nullable=False) + created_at = Column(DateTime, default=datetime.utcnow, nullable=False) + updated_at = Column(DateTime, default=datetime.utcnow, onupdate=datetime.utcnow, nullable=False)