Enhance bulk promo code creation with CSV export functionality

- Added the ability to generate and send a CSV file containing created promo codes, improving data accessibility for admins.
- Updated success messages to inform users about the CSV file and the number of created promo codes.
- Refactored the promo code creation logic to include detailed validity information and links for activation in the CSV output.
- Improved localization for bulk promo creation messages to enhance user experience.
This commit is contained in:
machka-pasla
2025-08-06 17:58:44 +03:00
parent a126c05365
commit 859263dc2d
4 changed files with 58 additions and 14 deletions
+1 -1
View File
@@ -224,7 +224,7 @@ async def start_command_handler(message: types.Message,
if promo_code_to_apply:
try:
from bot.services.promo_code_service import PromoCodeService
promo_code_service = PromoCodeService()
promo_code_service = PromoCodeService(settings, subscription_service, bot, i18n)
success, result = await promo_code_service.apply_promo_code(
session, user_id, promo_code_to_apply, current_lang