- Implemented SubscriptionRepository with methods to get, create, and update subscriptions. - Added BalanceTXRepository for creating and retrieving balance transactions. - Introduced a test script for simulating Pally webhook for local testing.
30 lines
619 B
Python
30 lines
619 B
Python
from enum import Enum, StrEnum
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from config import settings
|
|
|
|
|
|
class SubscriptionDuration(Enum):
|
|
MONTH = "month"
|
|
THREE_MONTHS = "three_months"
|
|
SIX_MONTHS = "six_months"
|
|
YEAR = "year"
|
|
|
|
|
|
class SubscriptionPlan(BaseModel):
|
|
devices: int = settings.min_devices
|
|
duration: SubscriptionDuration = SubscriptionDuration.MONTH
|
|
whitelists: bool = False
|
|
discount: float = 1
|
|
|
|
|
|
class SubscriptionStatus(StrEnum):
|
|
EXPIRED = "expired"
|
|
ACTIVE = "active"
|
|
|
|
|
|
class InternalSquads(StrEnum):
|
|
WHITELISTS = settings.whitelist_squad
|
|
DEFAULT = settings.general_squad
|