feat: 累积功能变更 — 聊天集成、租户管理、小程序更新、ETL 增强、迁移脚本
包含多个会话的累积代码变更: - backend: AI 聊天服务、触发器调度、认证增强、WebSocket、调度器最小间隔 - admin-web: ETL 状态页、任务管理、调度配置、登录优化 - miniprogram: 看板页面、聊天集成、UI 组件、导航更新 - etl: DWS 新任务(finance_area_daily/board_cache)、连接器增强 - tenant-admin: 项目初始化 - db: 19 个迁移脚本(etl_feiqiu 11 + zqyy_app 8) - packages/shared: 枚举和工具函数更新 - tools: 数据库工具、报表生成、健康检查 - docs: PRD/架构/部署/合约文档更新 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
60
apps/backend/app/schemas/tenant_clues.py
Normal file
60
apps/backend/app/schemas/tenant_clues.py
Normal file
@@ -0,0 +1,60 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
租户管理后台 — 维客线索管理 Pydantic Schema。
|
||||
|
||||
覆盖:客户搜索结果、线索列表、线索编辑、线索隐藏/显示。
|
||||
|
||||
需求: 9.1, 10.1, 11.1
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import Field, field_validator
|
||||
|
||||
from app.schemas.base import CamelModel
|
||||
|
||||
|
||||
class ClueCategory(str, Enum):
|
||||
"""线索大类枚举(6 值)。"""
|
||||
CUSTOMER_BASIC = "客户基础"
|
||||
CONSUMPTION_HABIT = "消费习惯"
|
||||
PLAY_PREFERENCE = "玩法偏好"
|
||||
PROMO_PREFERENCE = "促销偏好"
|
||||
SOCIAL_RELATION = "社交关系"
|
||||
IMPORTANT_FEEDBACK = "重要反馈"
|
||||
|
||||
|
||||
class CustomerSearchItem(CamelModel):
|
||||
"""客户搜索结果项。"""
|
||||
member_id: int
|
||||
nickname: str | None = None
|
||||
mobile_masked: str | None = None
|
||||
site_name: str | None = None
|
||||
site_id: int | None = None
|
||||
|
||||
|
||||
class ClueListItem(CamelModel):
|
||||
"""线索列表项。"""
|
||||
id: int
|
||||
category: str | None = None
|
||||
summary: str | None = None
|
||||
detail: str | None = None
|
||||
recorded_by_name: str | None = None
|
||||
source: str | None = None
|
||||
recorded_at: str | None = None
|
||||
is_hidden: bool = False
|
||||
|
||||
|
||||
class ClueEditRequest(CamelModel):
|
||||
"""线索编辑请求。"""
|
||||
category: ClueCategory = Field(..., description="线索大类(6 值枚举)")
|
||||
summary: str = Field(..., min_length=1, max_length=200, description="摘要(非空,≤200 字符)")
|
||||
detail: Optional[str] = Field(None, description="详情(可选)")
|
||||
|
||||
|
||||
class ClueVisibilityRequest(CamelModel):
|
||||
"""线索隐藏/显示请求。"""
|
||||
is_hidden: bool = Field(..., description="是否隐藏")
|
||||
Reference in New Issue
Block a user