feat(fase4): add GlobalVariable database model
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,6 +3,7 @@ from app.models.whatsapp import WhatsAppAccount, Contact, Conversation, Message
|
|||||||
from app.models.flow import Flow, FlowSession, TriggerType
|
from app.models.flow import Flow, FlowSession, TriggerType
|
||||||
from app.models.queue import Queue, QueueAgent, AssignmentMethod
|
from app.models.queue import Queue, QueueAgent, AssignmentMethod
|
||||||
from app.models.quick_reply import QuickReply
|
from app.models.quick_reply import QuickReply
|
||||||
|
from app.models.global_variable import GlobalVariable
|
||||||
|
|
||||||
__all__ = [
|
__all__ = [
|
||||||
"User",
|
"User",
|
||||||
@@ -17,4 +18,5 @@ __all__ = [
|
|||||||
"QueueAgent",
|
"QueueAgent",
|
||||||
"AssignmentMethod",
|
"AssignmentMethod",
|
||||||
"QuickReply",
|
"QuickReply",
|
||||||
|
"GlobalVariable",
|
||||||
]
|
]
|
||||||
|
|||||||
18
services/api-gateway/app/models/global_variable.py
Normal file
18
services/api-gateway/app/models/global_variable.py
Normal file
@@ -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)
|
||||||
Reference in New Issue
Block a user