Добавлена ветка prod_prep

This commit is contained in:
grigorij
2026-07-31 12:58:23 +04:00
parent bf26370da9
commit f289631645
36 changed files with 893 additions and 290 deletions
+14 -7
View File
@@ -1,14 +1,21 @@
"""Masters keyboard with specialty filtering."""
from aiogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from app.config import MASTERS
from app.keyboards.back import get_back_button
def get_masters_keyboard():
buttons = [
[InlineKeyboardButton(text=name, callback_data=key)]
for key, name in MASTERS.items()
]
def get_masters_keyboard(service_key=None):
buttons = []
svc_cats = {
"service_massage": "massage",
"service_spa": "spa",
"service_cosmetology": "cosmetology",
}
for key, master in MASTERS.items():
if service_key and "specialty" in master:
needed = svc_cats.get(service_key, "")
if needed and needed not in master["specialty"]:
continue
buttons.append([InlineKeyboardButton(text=master["name"], callback_data=key)])
buttons.append(get_back_button())
return InlineKeyboardMarkup(inline_keyboard=buttons)