feat(orders): integrate Pally payment and order management

This commit is contained in:
2026-07-31 13:42:14 +07:00
parent 2547bcfcba
commit 8fbd739697
20 changed files with 661 additions and 36 deletions

View File

@@ -1,4 +1,7 @@
from dataclasses import dataclass
from typing import Literal
from db.models.users import User
@dataclass
@@ -6,3 +9,10 @@ class KeyPair:
access_token: str
refresh_token: str
expires_at: float
@dataclass
class AuthContext:
user: User
auth_method: Literal["jwt"]
service: str | None = None

15
schemas/invoices.py Normal file
View File

@@ -0,0 +1,15 @@
from enum import StrEnum
from pydantic import BaseModel
class InvoiceStatus(StrEnum):
EXPIRED = "expired"
ACTIVE = "active"
PAID = "paid"
class InvoiceResponse(BaseModel):
success: bool
amount: float
payment_link: str

View File

@@ -1,4 +1,4 @@
from pydantic import BaseModel
from pydantic import BaseModel, Field
class AddonData(BaseModel):
@@ -11,3 +11,9 @@ class AddonData(BaseModel):
class PricingPlans(BaseModel):
device_price: int
addons: list[AddonData]
class OrderDetails(BaseModel):
devices: int = Field()
addons: list[str] = Field(description="List of addons ids")
duration_days: int