feat(sub): subscription logic (pre release)

This commit is contained in:
2026-08-02 13:23:50 +07:00
parent cde8ce28f5
commit 24f857ef1b
15 changed files with 469 additions and 42 deletions

15
schemas/checkout.py Normal file
View 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