fix: schemas + states
This commit is contained in:
0
schemas/__init__.py
Normal file
0
schemas/__init__.py
Normal file
14
schemas/di.py
Normal file
14
schemas/di.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
from repositories.tickets import TicketRepository
|
||||
from repositories.users import UserRepository
|
||||
from services.user_service import UserService
|
||||
from remnawave import RemnawaveSDK
|
||||
|
||||
|
||||
@dataclass
|
||||
class DependenciesDTO:
|
||||
ticket_repository: TicketRepository
|
||||
user_repository: UserRepository
|
||||
user_service: UserService
|
||||
rw_sdk: RemnawaveSDK
|
||||
18
schemas/subscriptions.py
Normal file
18
schemas/subscriptions.py
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
6
schemas/tickets.py
Normal file
6
schemas/tickets.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class NewTicketDTO:
|
||||
creator_id: int
|
||||
14
schemas/users.py
Normal file
14
schemas/users.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import Optional
|
||||
|
||||
|
||||
@dataclass
|
||||
class NewUserDTO:
|
||||
id: int
|
||||
referal: int
|
||||
|
||||
|
||||
@dataclass
|
||||
class TicketCreator:
|
||||
id: int
|
||||
username: Optional[str] = None
|
||||
6
states/buy.py
Normal file
6
states/buy.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from aiogram.fsm.state import StatesGroup, State
|
||||
|
||||
|
||||
class SubscriptionStorage(StatesGroup):
|
||||
devices = State()
|
||||
duration = State()
|
||||
Reference in New Issue
Block a user