From 8a81a1e2519e6294d3c205cd3de0a3a29b581735 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 19 Aug 2025 19:27:54 +0300 Subject: [PATCH] feat: update Telegram notification to list all services for orders - Modified the notification message format to include a list of all services associated with an order instead of just the first service. This change enhances clarity for both clients and masters by providing comprehensive service details in notifications. --- src/api/order/content-types/order/lifecycles.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/api/order/content-types/order/lifecycles.ts b/src/api/order/content-types/order/lifecycles.ts index 2ac7689..fc0d274 100644 --- a/src/api/order/content-types/order/lifecycles.ts +++ b/src/api/order/content-types/order/lifecycles.ts @@ -106,20 +106,24 @@ async function sendTelegramNotification(orderEntity: Order, isUpdate = false) { const clientName = order.client?.name || '-'; const masterName = slot.master?.name || '-'; - const serviceName = order.services?.[0]?.name || '-'; - + + // Формируем список всех услуг + const servicesList = order.services?.length + ? order.services.map(service => service.name).join(', ') + : '-'; + const messageForMaster = `${heading} Дата: ${date} Время: ${timeStartString} - ${timeEndString} Клиент: ${clientName} -Услуга: ${serviceName} +Услуги: ${servicesList} Статус: ${emojiForState} ${stateLabel}`; const messageForClient = `${heading} Дата: ${date} Время: ${timeStartString} - ${timeEndString} Мастер: ${masterName} -Услуга: ${serviceName} +Услуги: ${servicesList} Статус: ${emojiForState} ${stateLabel}`; if (masterTelegramId) {