From e96f301350e218d4a7814fb6bc27553051a80ec2 Mon Sep 17 00:00:00 2001 From: romanskijdev Date: Fri, 31 Jul 2026 15:59:48 +0300 Subject: [PATCH] Updated flows tree --- .../handlers/approval/notify.go | 22 ++++++++++++++----- .../handlers/approval/selection_approver.go | 8 +++++++ 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/service/telegram_service/handlers/approval/notify.go b/service/telegram_service/handlers/approval/notify.go index 68bb02a..73c8c86 100644 --- a/service/telegram_service/handlers/approval/notify.go +++ b/service/telegram_service/handlers/approval/notify.go @@ -189,7 +189,15 @@ func (n *Notifier) NotifyInitiatorApproved( ctx := context.Background() - card := n.topic.FormatApproverMessage(initiator, collected) + initiatorCollected := make(map[string]string, len(collected)) + for k, v := range collected { + if k == "instructions" { + continue + } + initiatorCollected[k] = v + } + + card := n.topic.FormatApproverMessage(initiator, initiatorCollected) text := fmt.Sprintf( "✅ Заявка #%d согласована\n"+ @@ -229,11 +237,15 @@ func (n *Notifier) NotifyInitiatorRejected( approverName = *approver.FullName } - content := collected["content"] - if content == "" { - content = "—" + initiatorCollected := make(map[string]string, len(collected)) + for k, v := range collected { + if k == "instructions" { + continue + } + initiatorCollected[k] = v } - card := n.topic.FormatApproverMessage(initiator, collected) + + card := n.topic.FormatApproverMessage(initiator, initiatorCollected) text := fmt.Sprintf( "❌ Заявка #%d отклонена\n\n"+ diff --git a/service/telegram_service/handlers/approval/selection_approver.go b/service/telegram_service/handlers/approval/selection_approver.go index d018c28..589fa43 100644 --- a/service/telegram_service/handlers/approval/selection_approver.go +++ b/service/telegram_service/handlers/approval/selection_approver.go @@ -244,6 +244,14 @@ func (h *Handler) finalizeAndSubmit(bot *tgbotapi.BotAPI, ctx context.Context, c logrus.Errorf("finalizeAndSubmit: GetUserByTelegramIDDB err=%v", err) } + initiatorCollected := make(map[string]string, len(flowState.Collected)) + for k, v := range flowState.Collected { + if k == "instructions" { + continue + } + initiatorCollected[k] = v + } + var card string if topic != nil { card = topic.FormatApproverMessage(initiator, flowState.Collected)