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.
This commit is contained in:
parent
3fb75f5765
commit
8a81a1e251
@ -106,20 +106,24 @@ async function sendTelegramNotification(orderEntity: Order, isUpdate = false) {
|
|||||||
|
|
||||||
const clientName = order.client?.name || '-';
|
const clientName = order.client?.name || '-';
|
||||||
const masterName = slot.master?.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}
|
const messageForMaster = `${heading}
|
||||||
<b>Дата:</b> ${date}
|
<b>Дата:</b> ${date}
|
||||||
<b>Время:</b> ${timeStartString} - ${timeEndString}
|
<b>Время:</b> ${timeStartString} - ${timeEndString}
|
||||||
<b>Клиент:</b> ${clientName}
|
<b>Клиент:</b> ${clientName}
|
||||||
<b>Услуга:</b> ${serviceName}
|
<b>Услуги:</b> ${servicesList}
|
||||||
<b>Статус:</b> ${emojiForState} ${stateLabel}`;
|
<b>Статус:</b> ${emojiForState} ${stateLabel}`;
|
||||||
|
|
||||||
const messageForClient = `${heading}
|
const messageForClient = `${heading}
|
||||||
<b>Дата:</b> ${date}
|
<b>Дата:</b> ${date}
|
||||||
<b>Время:</b> ${timeStartString} - ${timeEndString}
|
<b>Время:</b> ${timeStartString} - ${timeEndString}
|
||||||
<b>Мастер:</b> ${masterName}
|
<b>Мастер:</b> ${masterName}
|
||||||
<b>Услуга:</b> ${serviceName}
|
<b>Услуги:</b> ${servicesList}
|
||||||
<b>Статус:</b> ${emojiForState} ${stateLabel}`;
|
<b>Статус:</b> ${emojiForState} ${stateLabel}`;
|
||||||
|
|
||||||
if (masterTelegramId) {
|
if (masterTelegramId) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user