feat(sub): subscription logic (pre release)
This commit is contained in:
15
schemas/checkout.py
Normal file
15
schemas/checkout.py
Normal file
@@ -0,0 +1,15 @@
|
||||
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
|
||||
Reference in New Issue
Block a user