Files
Neo-ZQYY/apps/backend/app/schemas/xcx_tasks.py
2026-03-15 10:15:02 +08:00

37 lines
910 B
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""
小程序任务相关 Pydantic 模型。
覆盖:任务列表项、放弃请求等场景。
"""
from __future__ import annotations
from pydantic import BaseModel, Field
class TaskListItem(BaseModel):
"""任务列表项(含客户信息 + RS 指数 + 爱心 icon"""
id: int
task_type: str
status: str
priority_score: float | None
is_pinned: bool
expires_at: str | None
created_at: str
# 客户信息FDW 读取)
member_id: int
member_name: str | None
member_phone: str | None
# RS 指数 + 爱心 icon
rs_score: float | None
heart_icon: str # 💖 / 🧡 / 💛 / 💙
# 放弃原因(仅 abandoned 任务有值)
abandon_reason: str | None = None
class AbandonRequest(BaseModel):
"""放弃任务请求reason 必填)。"""
reason: str = Field(..., min_length=1, description="放弃原因(必填)")