Commit Graph

2127 Commits

Author SHA1 Message Date
Egor
3553ff615d Update subscription.py 2026-01-19 23:06:21 +03:00
Egor
1e1c0e89bc Update subscription.py 2026-01-19 22:51:57 +03:00
Egor
93227b7f41 Update yookassa.py 2026-01-19 22:49:58 +03:00
Egor
9e69b0cf22 Update branding.py 2026-01-19 10:17:33 +03:00
Egor
10fea329ad Update admin_promocodes.py 2026-01-19 09:31:41 +03:00
Egor
6775b06b2e Update admin_stats.py 2026-01-19 08:51:48 +03:00
Egor
f8d7b3288c Update cloudpayments.py 2026-01-19 07:52:54 +03:00
Egor
bd6498fb73 Update subscription.py 2026-01-19 07:52:16 +03:00
Egor
cdb3507a56 Update tariff_purchase.py 2026-01-19 06:26:15 +03:00
Egor
0b18c16f47 Update subscription_auto_purchase_service.py 2026-01-19 06:25:30 +03:00
PEDZEO
e6e688a395 fix(routes): reorder notification and ticket routers to prevent route conflicts
- Moved the notifications router to be included before the tickets router to avoid conflicts.
- Updated comments for clarity regarding the order of router inclusion.
2026-01-19 01:30:31 +03:00
PEDZEO
b1206a84c7 feat(notifications): enhance notification security and ownership checks
- Added ownership verification for user notifications to ensure only the rightful owner can mark them as read.
- Implemented checks to confirm that admin notifications are correctly identified before allowing them to be marked as read.
- Introduced a new method to retrieve notifications by ID in the TicketNotificationCRUD for improved data handling.
2026-01-19 00:39:36 +03:00
PEDZEO
792ff22471 Merge branch 'main' into test 2026-01-19 00:33:21 +03:00
PEDZEO
346806bce0 feat(notifications): integrate WebSocket notifications for ticket replies and new tickets
- Added WebSocket notifications for admins on new ticket creation and user replies.
- Implemented notification handling in the ticket management routes.
- Enhanced error logging for notification failures.
2026-01-19 00:28:57 +03:00
PEDZEO
5630e99812 Merge branch 'main' of https://github.com/Fr1ngg/remnawave-bedolaga-telegram-bot 2026-01-19 00:03:43 +03:00
PEDZEO
67c3dba1cc feat(notifications): implement ticket notifications for users and admins
- Added a new TicketNotification model to handle notifications for ticket events.
- Implemented user and admin notifications for new tickets and replies in the cabinet.
- Introduced settings to enable or disable notifications for users and admins.
- Enhanced ticket settings to include notification preferences.
- Integrated WebSocket notifications for real-time updates.
2026-01-19 00:02:41 +03:00
Egor
b6f2052464 Update auth.py 2026-01-18 23:33:45 +03:00
PEDZEO
c63db708cc feat(tickets): notify admins on new ticket creation and replies
- Added functionality to notify admins when a new ticket is created.
- Implemented notification for admins when a user replies to a ticket.
- Included error handling for notification failures.
2026-01-18 23:23:46 +03:00
gy9vin
78d785f83f fix(contests): исправлены критические баги системы конкурсов
- Исправлен вызов get_active_rounds в админ-панели (передавалось 2 параметра вместо 1)
- Обновлены кнопки редактирования призов с prize_days на prize_type/prize_value
- Мигрирован Cabinet API с устаревшего prize_days на новые поля
- Добавлена поддержка нескольких типов призов (дни, баланс, кастом)
- Обновлена документация API конкурсов
2026-01-18 10:15:45 +03:00
Egor
15e7725cf7 Update tariff.py 2026-01-18 05:47:59 +03:00
Egor
4205eed54f Update admin_tariffs.py 2026-01-18 05:46:50 +03:00
Egor
92339ec55a Merge pull request #2323 from libkitdev/main
feat(promocodes): добавить тип DISCOUNT для одноразовых процентных скидок
2026-01-17 19:45:10 +03:00
Egor
cd0ce908a1 Add files via upload 2026-01-17 10:31:40 +03:00
Egor
b7f8469895 Add files via upload 2026-01-17 10:31:21 +03:00
Egor
840c954203 Add files via upload 2026-01-17 10:05:30 +03:00
libkit
8b6683302d feat(localization): добавить тексты для DISCOUNT промокодов
Добавлены переводы на все 4 языка (ru, en, ua, zh):
- ADMIN_PROMOCODE_TYPE_DISCOUNT - название типа в админке
- PROMOCODE_ACTIVE_DISCOUNT_EXISTS - ошибка при конфликте скидок

Тексты описывают функционал одноразовой процентной скидки.
2026-01-17 11:25:51 +05:00
libkit
7a351d3028 feat(keyboards): добавить кнопку типа DISCOUNT в меню промокодов
Кнопка "💸 Одноразовая скидка" в меню выбора типа промокода.
2026-01-17 11:23:08 +05:00
libkit
5610a91866 feat(admin): добавить UI для создания DISCOUNT промокодов
Добавлена полная поддержка DISCOUNT типа в админке:
- Тип "💸 Одноразовая скидка" в селекторе
- Флоу создания: код → процент (1-100) → макс использований → срок промокода (дни) → срок скидки (часы)
- Валидация процента скидки (1-100)
- Валидация срока действия скидки (0-8760 часов)
- Отображение в списках и странице управления
- Новый стейт setting_discount_hours для ввода срока скидки
2026-01-17 11:22:32 +05:00
libkit
0858388b18 feat(handlers): добавить обработку ошибки active_discount_exists
Пользователь получает понятное сообщение при попытке
активировать промокод когда уже есть активная скидка.
2026-01-17 11:19:24 +05:00
libkit
1793775fe8 feat(services): реализовать логику активации DISCOUNT промокодов
Добавлена обработка нового типа промокода DISCOUNT:
- Проверка конфликта с активными скидками пользователя
- Запись скидки в профиль (promo_offer_discount_percent, promo_offer_discount_expires_at)
- Обработка срока действия скидки (0 часов = бессрочно до первой покупки)
- Логирование активации и ошибок
- Выброс ValueError при попытке активировать скидку при наличии активной
2026-01-17 11:18:46 +05:00
libkit
ff45a3e28d feat(models): добавить тип DISCOUNT в PromoCodeType
Добавлен новый тип промокода для одноразовых скидок.
Использует существующие поля без изменения схемы БД:
- balance_bonus_kopeks для хранения процента скидки (1-100)
- subscription_days для хранения срока действия скидки в часах (0-8760)
2026-01-17 11:17:30 +05:00
Egor
44a410babf Add files via upload 2026-01-17 08:50:47 +03:00
Egor
19a1d93a15 Update balance.py 2026-01-17 08:41:15 +03:00
Egor
64fe45fcfc Update balance.py 2026-01-17 08:40:37 +03:00
Egor
1f138aa772 Update admin_users.py 2026-01-17 06:51:20 +03:00
Egor
ca4252c9cb Update admin_users.py 2026-01-17 06:40:12 +03:00
Egor
15386ad4d8 Update admin_users.py 2026-01-17 06:35:08 +03:00
Egor
a54f5347a8 Update users.py 2026-01-17 06:28:42 +03:00
Egor
c121855078 Update admin_users.py 2026-01-17 06:28:10 +03:00
Egor
8956fff7d7 Update admin_users.py 2026-01-17 06:21:14 +03:00
Egor
35b900dfe4 Add files via upload 2026-01-17 05:57:40 +03:00
Egor
c1b70436b7 Add files via upload 2026-01-17 05:57:10 +03:00
Egor
fd68c1c99f Add files via upload 2026-01-17 05:24:12 +03:00
Egor
0e339450f8 Add files via upload 2026-01-17 05:23:44 +03:00
Egor
1eadbfe3f8 Update campaigns.py 2026-01-17 05:14:23 +03:00
Egor
bf0627a301 Update campaigns.py 2026-01-17 05:08:14 +03:00
Egor
274f8701a2 Update states.py 2026-01-17 05:06:07 +03:00
Egor
ea4570ba71 Update campaigns.py 2026-01-17 05:05:42 +03:00
Egor
5f39821652 Update admin.py 2026-01-17 05:05:12 +03:00
Egor
26c78b6814 Update campaigns.py 2026-01-17 05:04:01 +03:00