feat: implement referral payment system and enhance ticket management
This commit is contained in:
@@ -131,6 +131,12 @@ def format_username(username: str | None) -> str:
|
||||
return texts.NO_USERNAME
|
||||
|
||||
|
||||
def format_referal_id(referal_id: int | None) -> str:
|
||||
if referal_id:
|
||||
return str(referal_id)
|
||||
return texts.NOTHING_PLACEHOLDER
|
||||
|
||||
|
||||
def convert_duration_to_int(duration: SubscriptionDuration) -> int:
|
||||
mapping: dict[str, int] = {
|
||||
SubscriptionDuration.MONTH.value: 1,
|
||||
@@ -187,6 +193,7 @@ def format_support_subscription(
|
||||
user_id: int,
|
||||
balance: int,
|
||||
username: str | None = None,
|
||||
referal_id: int | None = None,
|
||||
) -> str:
|
||||
username = format_username(username)
|
||||
whitelist_description = "ВЫКЛ"
|
||||
@@ -204,6 +211,7 @@ def format_support_subscription(
|
||||
whitelist_description=whitelist_description,
|
||||
price=calculate_price(subscription),
|
||||
balance=balance,
|
||||
referal_id=referal_id,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user