|
|
@@ -3,7 +3,7 @@ from datetime import datetime
|
|
|
|
|
|
from fastapi import Request
|
|
|
from fastapi.datastructures import FormData
|
|
|
-from pydantic import BaseModel, Field
|
|
|
+from pydantic import BaseModel, Field, model_validator
|
|
|
from app.core.logger import log
|
|
|
|
|
|
|
|
|
@@ -156,8 +156,8 @@ class OrderChangeContent(BaseModel):
|
|
|
enterprise_id: str = Field(..., description="企业ID")
|
|
|
employee_id: str | None = Field(None, description="员工ID")
|
|
|
out_biz_no: str | None = Field(None, description="外部业务号")
|
|
|
- action: str = Field(..., description="变动动作")
|
|
|
- change_time: str = Field(..., description="变动时间")
|
|
|
+ action: str | None = Field(None, description="变动动作")
|
|
|
+ change_time: str | None = Field(None, description="变动时间")
|
|
|
order_status: str | None = Field(None, description="订单状态")
|
|
|
|
|
|
# 补充字段
|
|
|
@@ -176,6 +176,13 @@ class OrderChangeContent(BaseModel):
|
|
|
invoice_status: str | None = Field(None, description="发票状态")
|
|
|
ext_info: str | None = Field(None, description="扩展信息")
|
|
|
|
|
|
+ # 把order_no设置为pay_no的值
|
|
|
+ @model_validator(mode="before")
|
|
|
+ def set_order_no(cls, values):
|
|
|
+ if not values.get("order_no") and values.get("pay_no"):
|
|
|
+ values["order_no"] = values["pay_no"]
|
|
|
+ return values
|
|
|
+
|
|
|
|
|
|
class BillDetailQueryOut(BaseModel):
|
|
|
"""账单详情查询响应"""
|