feat(fase4): add FlowTemplate model and API
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -4,6 +4,7 @@ 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
|
||||
from app.models.flow_template import FlowTemplate
|
||||
|
||||
__all__ = [
|
||||
"User",
|
||||
@@ -19,4 +20,5 @@ __all__ = [
|
||||
"AssignmentMethod",
|
||||
"QuickReply",
|
||||
"GlobalVariable",
|
||||
"FlowTemplate",
|
||||
]
|
||||
|
||||
21
services/api-gateway/app/models/flow_template.py
Normal file
21
services/api-gateway/app/models/flow_template.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from sqlalchemy import Column, String, Text, DateTime, Boolean, ForeignKey
|
||||
from sqlalchemy.dialects.postgresql import UUID, JSONB
|
||||
from app.core.database import Base
|
||||
|
||||
|
||||
class FlowTemplate(Base):
|
||||
__tablename__ = "flow_templates"
|
||||
|
||||
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
||||
name = Column(String(100), nullable=False)
|
||||
description = Column(Text, nullable=True)
|
||||
category = Column(String(50), default="general", nullable=False)
|
||||
nodes = Column(JSONB, default=list)
|
||||
edges = Column(JSONB, default=list)
|
||||
variables = Column(JSONB, default=dict)
|
||||
preview_image = Column(String(500), nullable=True)
|
||||
is_public = Column(Boolean, default=True, nullable=False)
|
||||
created_by = Column(UUID(as_uuid=True), ForeignKey("users.id"), nullable=False)
|
||||
created_at = Column(DateTime, default=datetime.utcnow, nullable=False)
|
||||
Reference in New Issue
Block a user