打通 T+ 快照、业务、发货、回款和核算准备链路,保留来源差异并提供待补状态。 新增业务自动接入任务、跨平台读取服务托管、权限复核、来源关联和前端核对页面。 补充迁移、隔离集成测试、浏览器模拟验收及角色授权边界修复。
31 lines
906 B
Python
31 lines
906 B
Python
"""基础档案待确认分类的批量补充。"""
|
|
|
|
from typing import Literal
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field, field_validator
|
|
|
|
|
|
class CategoryBatch(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
ids: list[int] = Field(min_length=1, max_length=200)
|
|
|
|
@field_validator("ids")
|
|
@classmethod
|
|
def validate_ids(cls, value):
|
|
if any(item < 1 for item in value) or len(value) != len(set(value)):
|
|
raise ValueError("档案 ID 必须为不重复的正整数")
|
|
return value
|
|
|
|
|
|
class CustomerCategoryBatch(CategoryBatch):
|
|
category: Literal["personal", "manager_personal", "enterprise"]
|
|
|
|
|
|
class ProductCategoryBatch(CategoryBatch):
|
|
category: Literal["municipal_water", "rail_transit"]
|
|
|
|
|
|
class CustomerOwnershipBatch(CategoryBatch):
|
|
new_owner_personnel_id: int = Field(ge=1)
|
|
reason: str | None = Field(default=None, max_length=255)
|