Advertisement
Pandaaaa906

Untitled

Nov 24th, 2022 (edited)
789
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. from decimal import Decimal
  2. from enum import Enum
  3. from typing import Optional
  4.  
  5. from pydantic import BaseModel, Field
  6.  
  7.  
  8. class RecordType(str, Enum):
  9.     credit = '借'
  10.     debit = '贷'
  11.  
  12.  
  13. class AccountRecord(BaseModel):
  14.     seq_id: str = Field(title="电子回单唯一标识")
  15.     only_seq: Optional[str] = Field(title="银行交易流水号")
  16.     acc_no: str = Field('己方银行账号')
  17.     acc_name: str = Field('己方银行户名')
  18.     receipt_acc_no: str = Field(title="对方银行账号")
  19.     receipt_acc_name: str = Field(title="对方账户户名")
  20.     receipt_acc_bank: str = Field(title="对方银行")
  21.     record_type: RecordType = Field(title="流水类型(借/贷)")
  22.     amount: Decimal = Field(title="原币金额")
  23.     currency: str = Field(title="币种")
  24.     summary: Optional[str] = Field(title="摘要")
  25.     use_cn: Optional[str] = Field(title="用途")
  26.  
  27.     class Config:
  28.         use_enum_values = True
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement