refactor
Some checks failed
continuous-integration/drone/pr Build is failing

This commit is contained in:
2026-02-17 00:22:42 +09:00
parent ca0c63a89c
commit 0fdad07d82
36 changed files with 4384 additions and 368 deletions

View File

@@ -6,6 +6,7 @@ from aiogram.fsm.context import FSMContext
from aiogram.fsm.state import State, StatesGroup
from sqlalchemy import select, and_
from src.filters.case_insensitive import CaseInsensitiveCommand
from src.core.database import async_session_maker
from src.core.registration_services import AccountService, WinnerNotificationService, RegistrationService
from src.core.services import UserService, LotteryService, ParticipationService
@@ -22,19 +23,19 @@ class AddAccountStates(StatesGroup):
choosing_lottery = State()
@router.message(Command("cancel"))
@router.message(CaseInsensitiveCommand("cancel"))
@admin_only
async def cancel_command(message: Message, state: FSMContext):
"""Отменить текущую операцию и сбросить состояние"""
"""Отменить текущую операцию и сбросить состояние (регистронезависимо)"""
await state.clear()
await message.answer("✅ Состояние сброшено. Все операции отменены.")
@router.message(Command("add_account"))
@router.message(CaseInsensitiveCommand("add_account"))
@admin_only
async def add_account_command(message: Message, state: FSMContext):
"""
Добавить счет пользователю по клубной карте
Добавить счет пользователю по клубной карте (регистронезависимо)
Формат: /add_account <club_card> <account_number>
Или: /add_account (затем вводить данные построчно)
"""
@@ -434,11 +435,11 @@ async def skip_lottery_add(callback: CallbackQuery, state: FSMContext):
await state.clear()
@router.message(Command("remove_account"))
@router.message(CaseInsensitiveCommand("remove_account"))
@admin_only
async def remove_account_command(message: Message):
"""
Деактивировать счет(а)
Деактивировать счет(а) (регистронезависимо)
Формат: /remove_account <account_number1> [account_number2] [account_number3] ...
Можно указать несколько счетов через пробел для массового удаления
"""
@@ -504,11 +505,11 @@ async def remove_account_command(message: Message):
await message.answer(f"❌ Критическая ошибка: {str(e)}")
@router.message(Command("verify_winner"))
@router.message(CaseInsensitiveCommand("verify_winner"))
@admin_only
async def verify_winner_command(message: Message):
"""
Подтвердить выигрыш по коду верификации
Подтвердить выигрыш по коду верификации (регистронезависимо)
Формат: /verify_winner <verification_code> <lottery_id>
Пример: /verify_winner AB12CD34 1
"""
@@ -595,11 +596,11 @@ async def verify_winner_command(message: Message):
await message.answer(f"❌ Ошибка: {str(e)}")
@router.message(Command("winner_status"))
@router.message(CaseInsensitiveCommand("winner_status"))
@admin_only
async def winner_status_command(message: Message):
"""
Показать статус всех победителей розыгрыша
Показать статус всех победителей розыгрыша (регистронезависимо)
Формат: /winner_status <lottery_id>
"""
@@ -668,11 +669,11 @@ async def winner_status_command(message: Message):
await message.answer(f"❌ Ошибка: {str(e)}")
@router.message(Command("user_info"))
@router.message(CaseInsensitiveCommand("user_info"))
@admin_only
async def user_info_command(message: Message):
"""
Показать информацию о пользователе
Показать информацию о пользователе (регистронезависимо)
Формат: /user_info <club_card>
"""