feat(models): 组织、用户、角色、客户、会话与消息模型
按组织边界定义数据关系,补齐仓储层与通用工具,迁移脚本可重复执行。
This commit is contained in:
1 parent
2aee6286d6
commit
5e0615f36d
126 files changed
+17436
No files matched your search
@@ -0,0 +1,150 @@
|
||||
"""
|
||||
Copyright 2024-2026 ChatterMate
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
"""
|
||||
|
||||
from app.database import Base
|
||||
from .organization import Organization
|
||||
from .user import User
|
||||
from .fcm_token import FCMToken
|
||||
from .auth_session import AuthSession
|
||||
from .customer import Customer
|
||||
from .role import Role
|
||||
from .permission import Permission
|
||||
from .ai_config import AIConfig, AIModelType
|
||||
from .agent import Agent
|
||||
from .knowledge_to_agent import KnowledgeToAgent
|
||||
from .knowledge import Knowledge
|
||||
from .chat_history import ChatHistory
|
||||
from .session_to_agent import SessionToAgent, SessionStatus
|
||||
from .rating import Rating
|
||||
from app.models.jira import JiraToken
|
||||
from app.models.shopify import ShopifyShop
|
||||
from app.models.workflow import Workflow
|
||||
from app.models.workflow_node import WorkflowNode, ExitCondition
|
||||
from app.models.workflow_connection import WorkflowConnection
|
||||
from app.models.mcp_tool import MCPTool, MCPToolToAgent, MCPTransportType
|
||||
from app.models.file_attachment import FileAttachment
|
||||
from app.models.customer import LeadStage
|
||||
from app.models.lead_capture import (
|
||||
LeadCaptureConfig, LeadCaptureResponse,
|
||||
LeadAssignmentMode, CrmSyncTarget,
|
||||
)
|
||||
from app.models.channels import (
|
||||
ChannelAccount, ChannelType, ChannelConversation, AgentChannelConfig,
|
||||
)
|
||||
from app.models.faq_generation_job import (
|
||||
FAQGenerationJob, FAQJobType, FAQJobStatus, FAQJobStage,
|
||||
)
|
||||
from app.models.faq import FAQ, FAQStatus
|
||||
from app.models.help_center import (
|
||||
HelpCenterSettings, HelpCenterQuery, DomainStatus, SSLStatus,
|
||||
)
|
||||
from app.models.ticket import (
|
||||
Ticket, TicketSequence, TicketSession,
|
||||
TicketStatus, TicketPriority, TicketSource, ResolutionOutcome,
|
||||
)
|
||||
from app.models.ticket_activity import TicketActivity, TicketActivityType, TicketActorType
|
||||
from app.models.ticket_settings import OrganizationTicketSettings
|
||||
from app.models.investigation import (
|
||||
InvestigationRun, InvestigationRunType, InvestigationRunStatus, InvestigationTrigger,
|
||||
InvestigationHypothesis, InvestigationEvent, RCADocument, TicketProposal,
|
||||
)
|
||||
from app.models.ticket_db_connector import TicketDBConnector, DBConnectorAuditLog
|
||||
from app.models.crm import (
|
||||
CrmConnection, CrmSyncJob, CrmCustomerSync,
|
||||
CrmProvider, CrmConnectionStatus, CrmSyncJobStatus,
|
||||
)
|
||||
from app.models.notification_settings import UserNotificationSettings
|
||||
from app.models.guardrail_event import GuardrailEvent
|
||||
|
||||
|
||||
|
||||
# This ensures all models are imported in the correct order
|
||||
__all__ = [
|
||||
"Organization",
|
||||
"User",
|
||||
"FCMToken",
|
||||
"AuthSession",
|
||||
"Customer",
|
||||
"Permission",
|
||||
"Role",
|
||||
"AIConfig",
|
||||
"AIModelType",
|
||||
"Agent",
|
||||
"KnowledgeToAgent",
|
||||
"Knowledge",
|
||||
"ChatHistory",
|
||||
"SessionToAgent",
|
||||
"SessionStatus",
|
||||
"Rating",
|
||||
"JiraToken",
|
||||
"ShopifyShop",
|
||||
"Workflow",
|
||||
"WorkflowNode",
|
||||
"ExitCondition",
|
||||
"WorkflowConnection",
|
||||
"MCPTool",
|
||||
"MCPToolToAgent",
|
||||
"MCPTransportType",
|
||||
"FileAttachment",
|
||||
"LeadStage",
|
||||
"LeadCaptureConfig",
|
||||
"LeadCaptureResponse",
|
||||
"LeadAssignmentMode",
|
||||
"CrmSyncTarget",
|
||||
"ChannelAccount",
|
||||
"ChannelType",
|
||||
"ChannelConversation",
|
||||
"AgentChannelConfig",
|
||||
"FAQGenerationJob",
|
||||
"FAQJobType",
|
||||
"FAQJobStatus",
|
||||
"FAQJobStage",
|
||||
"FAQ",
|
||||
"FAQStatus",
|
||||
"HelpCenterSettings",
|
||||
"HelpCenterQuery",
|
||||
"DomainStatus",
|
||||
"SSLStatus",
|
||||
"Ticket",
|
||||
"TicketSequence",
|
||||
"TicketSession",
|
||||
"TicketStatus",
|
||||
"TicketPriority",
|
||||
"TicketSource",
|
||||
"ResolutionOutcome",
|
||||
"TicketActivity",
|
||||
"TicketActivityType",
|
||||
"TicketActorType",
|
||||
"OrganizationTicketSettings",
|
||||
"UserNotificationSettings",
|
||||
"InvestigationRun",
|
||||
"InvestigationRunType",
|
||||
"InvestigationRunStatus",
|
||||
"InvestigationTrigger",
|
||||
"InvestigationHypothesis",
|
||||
"InvestigationEvent",
|
||||
"RCADocument",
|
||||
"TicketProposal",
|
||||
"TicketDBConnector",
|
||||
"DBConnectorAuditLog",
|
||||
"CrmConnection",
|
||||
"CrmSyncJob",
|
||||
"CrmCustomerSync",
|
||||
"CrmProvider",
|
||||
"CrmConnectionStatus",
|
||||
"CrmSyncJobStatus",
|
||||
"GuardrailEvent",
|
||||
]
|
||||
Reference in new issue
Block a user