payment.py 616 B

12345678910111213141516171819202122232425262728293031
  1. from datetime import datetime
  2. from lib2to3.pgen2.token import OP
  3. from typing import Optional
  4. from pydantic import BaseModel
  5. # Shared properties
  6. class PaymentBase(BaseModel):
  7. id: Optional[str] = None
  8. order_id: Optional[str] = None
  9. transaction_id: Optional[str] = None
  10. create_time: Optional[datetime] = datetime.now()
  11. line_id: Optional[str] = None
  12. nft_id: int
  13. amount: int
  14. payment_status: Optional[str] = None
  15. class Config:
  16. orm_mode = True
  17. class PaymentPrint(BaseModel):
  18. pass
  19. class PaymentCreate(PaymentBase):
  20. pass
  21. class PaymentUpdate(PaymentBase):
  22. pass