e99d0aec8a
This reverts commit a4904973bf.
32 lines
724 B
Python
32 lines
724 B
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
import uuid
|
|
from datetime import date
|
|
|
|
|
|
class WorkPlanCreate(BaseModel):
|
|
customer_id: uuid.UUID
|
|
plan_content: str = ""
|
|
plan_date: str # "YYYY-MM-DD"
|
|
status: str = "计划中"
|
|
|
|
|
|
class WorkPlanUpdate(BaseModel):
|
|
customer_id: Optional[uuid.UUID] = None
|
|
plan_content: Optional[str] = None
|
|
plan_date: Optional[str] = None
|
|
status: Optional[str] = None
|
|
|
|
|
|
class WorkPlanOut(BaseModel):
|
|
id: uuid.UUID
|
|
customer_id: uuid.UUID
|
|
plan_content: str
|
|
plan_date: date
|
|
manager_id: uuid.UUID
|
|
status: str
|
|
customer_name: Optional[str] = None
|
|
manager_name: Optional[str] = None
|
|
|
|
model_config = {"from_attributes": True}
|