- Added billing models and repository for handling bills. - Introduced BillingService to manage payment initiation and bill creation. - Updated user service to remove ticket-related functionality. - Refactored settings to include new billing-related fields. - Removed ticket-related handlers and schemas. - Added new billing handlers for processing payments. - Updated database schema with new bills table and status enum. - Enhanced utility functions to calculate prices considering discounts. - Introduced prehandling for non-private messages. - Updated main application to initialize new billing services and repositories.
20 lines
415 B
Python
20 lines
415 B
Python
from enum import Enum
|
|
|
|
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
|