feat: enhance Telegram notification heading for order updates
- Updated the heading emoji logic to display a checkered flag for completed orders and a pencil for updates, improving clarity in notifications. - Added specific handling for completed records in the notification heading to differentiate between updated and completed statuses.
This commit is contained in:
parent
2c968e9899
commit
4adc7aa6c7
@ -69,13 +69,20 @@ async function sendTelegramNotification(orderEntity: Order, isUpdate = false) {
|
||||
const emojiForState = EMOJI_MAP[state] || '';
|
||||
const stateLabel = STATE_MAP[state] || state;
|
||||
|
||||
// Эмодзи в заголовке: карандаш при обновлении, иначе эмодзи статуса
|
||||
const headingEmoji = isUpdate ? '✏️' : emojiForState;
|
||||
// Эмодзи в заголовке: карандаш при обновлении, флаг для завершенных, иначе эмодзи статуса
|
||||
const headingEmoji = isUpdate
|
||||
? (state === 'completed' ? '🏁' : '✏️')
|
||||
: emojiForState;
|
||||
|
||||
let heading = '';
|
||||
|
||||
if (isUpdate) {
|
||||
heading = `${headingEmoji} <b>Запись изменена</b>`;
|
||||
// Специальная обработка для завершенных записей
|
||||
if (state === 'completed') {
|
||||
heading = `${headingEmoji} <b>Запись завершена</b>`;
|
||||
} else {
|
||||
heading = `${headingEmoji} <b>Запись изменена</b>`;
|
||||
}
|
||||
} else {
|
||||
const isApproved = state === 'approved';
|
||||
const creationText = isApproved
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user