Updated flows tree

This commit is contained in:
romanskijdev 2026-07-31 15:59:48 +03:00
parent e11acda672
commit e96f301350
2 changed files with 25 additions and 5 deletions

View File

@ -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(
"✅ <b>Заявка #%d согласована</b>\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(
"❌ <b>Заявка #%d отклонена</b>\n\n"+

View File

@ -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)