feat:新增接口
This commit is contained in:
+11
-5
@@ -14,11 +14,17 @@ class PurchaseReq(BaseModel):
|
||||
|
||||
|
||||
class PurchaseResp(BaseModel):
|
||||
"""申购结果:最新余额 + 该产品最新持仓。"""
|
||||
"""申购结果:order_no + status(已确认 / 风控挂起)。
|
||||
|
||||
balance: Decimal
|
||||
holding: HoldingResp
|
||||
已确认时返回最新余额 + 该产品持仓;风控挂起时账户/持仓不变,仅返回预警关联。
|
||||
"""
|
||||
|
||||
order_no: str
|
||||
status: str
|
||||
balance: Decimal | None = None
|
||||
holding: HoldingResp | None = None
|
||||
alert_id: int | None = None
|
||||
|
||||
@field_serializer("balance")
|
||||
def _fmt_balance(self, value: Decimal) -> str:
|
||||
return f"{value:.2f}"
|
||||
def _fmt_balance(self, value: Decimal | None) -> str | None:
|
||||
return f"{value:.2f}" if value is not None else None
|
||||
|
||||
Reference in New Issue
Block a user