feat(referral): add referral system with withdrawals

This commit is contained in:
2026-07-18 10:58:14 +05:00
parent 5e5bab91f2
commit a04734b8a7
17 changed files with 1750 additions and 60 deletions
+10 -1
View File
@@ -1,7 +1,7 @@
# - *- coding: utf- 8 - *-
from typing import Any, Dict, Optional
from sqlalchemy import Integer, String
from sqlalchemy import Integer, String, Float
from sqlalchemy.orm import Mapped, mapped_column
from tgbot.database.core import Base
@@ -46,6 +46,15 @@ class SettingsModel(Base):
misc_profit_week: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
misc_profit_month: Mapped[int] = mapped_column(Integer, nullable=False, default=0)
# Реферальная система
referral_refill_percent: Mapped[float] = mapped_column(
Float, nullable=False, default=0
)
status_referral: Mapped[str] = mapped_column(
String(16), nullable=False, default="False"
)
referral_bonus_rub: Mapped[float] = mapped_column(Float, nullable=False, default=0)
ModelBase = Settings
BaseModel = Settings