add:bonus store
This commit is contained in:
48
app/models/bonus.py
Normal file
48
app/models/bonus.py
Normal file
@ -0,0 +1,48 @@
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional, List
|
||||
from datetime import datetime
|
||||
|
||||
class PurchaseBonus(BaseModel):
|
||||
username: str
|
||||
bonus_type_id: str
|
||||
|
||||
class BonusEffect(BaseModel):
|
||||
effect_type: str
|
||||
effect_value: float
|
||||
expires_at: Optional[datetime] = None
|
||||
|
||||
class BonusType(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
description: str
|
||||
effect_type: str # "experience", "strength", "speed", etc.
|
||||
base_effect_value: float # Базовое значение эффекта (например, 1.0 для +100%)
|
||||
effect_increment: float # Прирост эффекта за уровень (например, 0.1 для +10%)
|
||||
price: int # Базовая цена
|
||||
upgrade_price: int # Цена улучшения за уровень
|
||||
duration: int # Длительность в секундах (0 для бесконечных)
|
||||
max_level: int = 0 # 0 = без ограничения уровней
|
||||
|
||||
class UserTypeBonus(BaseModel):
|
||||
id: str
|
||||
name: str
|
||||
description: str
|
||||
effect_type: str
|
||||
effect_value: float
|
||||
level: int
|
||||
purchased_at: datetime
|
||||
can_upgrade: bool
|
||||
upgrade_price: int
|
||||
expires_at: Optional[datetime] = None
|
||||
is_active: bool = True
|
||||
is_permanent: bool
|
||||
|
||||
class UserBonus(BaseModel):
|
||||
id: str
|
||||
user_id: str
|
||||
username: str
|
||||
bonus_type_id: str
|
||||
level: int
|
||||
purchased_at: datetime
|
||||
expires_at: Optional[datetime] = None
|
||||
is_active: bool
|
Reference in New Issue
Block a user