This commit is contained in:
2024-12-09 17:42:23 +09:00
parent e33ca362fe
commit 7889117d6e
5 changed files with 99 additions and 5 deletions

View File

@@ -3,7 +3,7 @@ from asgiref.sync import sync_to_async
from hotels.models import Hotel, UserHotel
from users.models import User
from pms_integration.manager import PMSIntegrationManager
from bot.utils.froud_check import detect_fraud
async def manage_hotels(update: Update, context):
"""Отображение списка отелей, связанных с пользователем."""
query = update.callback_query
@@ -45,6 +45,7 @@ async def hotel_actions(update: Update, context):
keyboard = [
[InlineKeyboardButton("🗑️ Удалить отель", callback_data=f"delete_hotel_{hotel_id}")],
[InlineKeyboardButton("Проверить на FRAUD", callback_data=f"check_fraud_{hotel_id}")],
[InlineKeyboardButton("🔗 Проверить интеграцию с PMS", callback_data=f"check_pms_{hotel_id}")],
[InlineKeyboardButton("🛏️ Настроить номера", callback_data=f"setup_rooms_{hotel_id}")],
[InlineKeyboardButton("🏠 Главная", callback_data="main_menu")],
@@ -53,7 +54,12 @@ async def hotel_actions(update: Update, context):
reply_markup = InlineKeyboardMarkup(keyboard)
await query.edit_message_text(f"Управление отелем: {hotel.name}", reply_markup=reply_markup)
async def handle_fraud_check(update, context):
query = update.callback_query
hotel_id = int(query.data.split("_")[2])
await detect_fraud(hotel_id)
await query.edit_message_text("Проверка на FRAUD завершена. Администратор уведомлен.")
async def delete_hotel(update: Update, context):
"""Удаление отеля."""
query = update.callback_query