diff --git a/service/telegram_service/scheduler/daily_reminder.go b/service/telegram_service/scheduler/daily_reminder.go
index 056cabc..4a9e0cc 100644
--- a/service/telegram_service/scheduler/daily_reminder.go
+++ b/service/telegram_service/scheduler/daily_reminder.go
@@ -140,6 +140,17 @@ func (dr *DailyReminder) sendReminderToUser(bot *tgbotapi.BotAPI, ctx context.Co
}
revisionsCount := len(revisions)
+ myPendingApprovals, _, err := dr.ipc.Database.Approval.GetApprovalsListDB(ctx, typescore.ListDbOptions{
+ Filtering: &typescore.Approval{
+ InitiatorID: &userID,
+ Status: utilscore.PointerToString("pending"),
+ },
+ })
+ if err != nil {
+ logrus.Errorf("DailyReminder: GetApprovalsListDB (my pending) for user=%d err=%v", userID, err)
+ }
+ myPendingCount := len(myPendingApprovals)
+
tasks, _, err := dr.ipc.Database.ApprovalTasks.GetApprovalTasksListDB(ctx, typescore.ListDbOptions{
Filtering: &typescore.ApprovalTask{
ExecutorID: &userID,
@@ -174,7 +185,7 @@ func (dr *DailyReminder) sendReminderToUser(bot *tgbotapi.BotAPI, ctx context.Co
approvalsCount := dr.countPendingApprovals(ctx, steps, additionalApprovers)
- hasPersonalItems := revisionsCount > 0 || tasksCount > 0 || approvalsCount > 0
+ hasPersonalItems := revisionsCount > 0 || tasksCount > 0 || approvalsCount > 0 || myPendingCount > 0
logrus.Infof("DailyReminder: userID=%d telegramID=%d — revisions=%d tasks=%d approvals=%d hasPersonalItems=%v absentTodayCount=%d",
userID, telegramID, revisionsCount, tasksCount, approvalsCount, hasPersonalItems, len(absentToday))
@@ -186,6 +197,9 @@ func (dr *DailyReminder) sendReminderToUser(bot *tgbotapi.BotAPI, ctx context.Co
text := "☀️ Доброе утро! Ежедневная сводка\n\n"
+ if myPendingCount > 0 {
+ text += fmt.Sprintf("Ваших заявок на согласовании: %d\n", myPendingCount)
+ }
if revisionsCount > 0 {
text += fmt.Sprintf("Заявок на доработке: %d\n", revisionsCount)
}