25 lines
624 B
Python
25 lines
624 B
Python
"""生产订单 Pydantic Schemas"""
|
|
from __future__ import annotations
|
|
import uuid
|
|
from datetime import datetime
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class OrderCreate(BaseModel):
|
|
"""创建订单"""
|
|
order_no: str = Field(..., max_length=64, description="订单编号")
|
|
customer_info: str | None = Field(None, max_length=500, description="客户信息")
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class OrderResponse(BaseModel):
|
|
"""订单响应"""
|
|
id: uuid.UUID
|
|
order_no: str
|
|
customer_info: str | None
|
|
status: str
|
|
created_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|