Files
tps-dashboard/backend/app/schemas/yearly_target.py
T

31 lines
587 B
Python

"""
年度收视目标 Schema — 请求 / 响应模型
业务规则:yearly_targets 只增不改,ON CONFLICT DO NOTHING
"""
from datetime import date
from pydantic import BaseModel, ConfigDict
class YearlyTargetBase(BaseModel):
year: int
base_target: float
stretch_target: float
issued_date: date | None = None
notes: str | None = None
class YearlyTargetCreate(YearlyTargetBase):
pass
class YearlyTargetUpdate(YearlyTargetBase):
pass
class YearlyTargetResponse(YearlyTargetBase):
id: int
model_config = ConfigDict(from_attributes=True)