Refactor Slack notifications and enhance departmental progress calculation

- Replace `send_webhook_message` with `send_message` for improved Slack notification rendering using `goals_progress_alert_renderer`.
- Add methods for calculating and retrieving departmental progress and distribution in `goals_criteria`.
- Update `renderDanishPeriodSummary` and Slack cron logic to support departmental-specific summaries.
- Include departmental progress in serialized goal objects for better reporting.
This commit is contained in:
Jeppe Bundgaard
2026-01-29 18:30:04 +01:00
parent 8972db3469
commit 84bfbdad25
5 changed files with 60 additions and 7 deletions
+1 -1
View File
@@ -248,7 +248,7 @@ function GoalsProgressAlertsCron(): void
if (!$dept->exists()) { continue; }
$webhook = (string)$dept->slack_webhook->value();
if (empty($webhook)) { continue; }
(new Slack())->send_webhook_message((string)$message, $webhook);
(new Slack())->send_webhook_message((string)goals_progress_alert_renderer::render($criteria, $dept), $webhook);
$sentToDept = true;
}
}