feat(admin): add admin notification system for deposits, purchases, and renewals
This commit is contained in:
@@ -29,6 +29,7 @@ from misc.utils import (
|
||||
)
|
||||
from schemas.di import DependenciesDTO
|
||||
from schemas.subscriptions import SubscriptionPlan
|
||||
from services.admin_notifications import notify_subscription_purchase
|
||||
|
||||
router = Router()
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -223,4 +224,18 @@ async def proceed_to_checkout(
|
||||
amount,
|
||||
)
|
||||
|
||||
if deducted_user:
|
||||
await notify_subscription_purchase(
|
||||
cb.bot,
|
||||
user_id=user.id,
|
||||
username=cb.from_user.username,
|
||||
amount=amount,
|
||||
balance_before=deducted_user.balance + amount,
|
||||
balance_after=deducted_user.balance,
|
||||
devices=ctx.devices,
|
||||
duration_days=convert_duration_to_int(ctx.duration),
|
||||
whitelists=ctx.whitelists,
|
||||
credit=credit,
|
||||
)
|
||||
|
||||
await cb.message.edit_text(SUCCESSFULLY_CREATED_SUBSCRIPTION, reply_markup=return_to_menu)
|
||||
|
||||
Reference in New Issue
Block a user