Files
malenia-backend/schemas/checkout.py

16 lines
408 B
Python

from pydantic import BaseModel, Field, computed_field
class CheckoutResponse(BaseModel):
order_id: str = Field()
total_amount: float = Field()
bonus_paid: float = Field()
amount_to_pay: float = Field()
payment_link: str | None = Field(None)
@property
@computed_field
def is_fully_paid(self):
return self.total_amount <= self.bonus_paid and self.amount_to_pay <= 0