feat(promo): Добавлена локализация при изменении процента скидки и логи при активации промокода на скидку

This commit is contained in:
VAQYBIN
2026-01-20 01:26:14 +05:00
parent e7df5e539c
commit fed1c1c960
5 changed files with 50 additions and 8 deletions
+15
View File
@@ -165,6 +165,21 @@ async def process_promo_code_input(message: types.Message, state: FSMContext,
f"Discount promo code '{code_input}' successfully applied for user {user.id}."
)
discount_pct = result_discount # Returns percentage
# Send notification about discount promo activation
if settings.LOG_PROMO_ACTIVATIONS:
try:
from bot.services.notification_service import NotificationService
notification_service = NotificationService(bot, settings, i18n)
await notification_service.notify_discount_promo_activation(
user_id=user.id,
promo_code=code_input.upper(),
discount_percentage=discount_pct,
username=user.username
)
except Exception as e:
logging.error(f"Failed to send discount promo activation notification: {e}")
response_to_user_text = _(
"discount_promo_code_applied_success",
code=hcode(code_input.upper()),