Refactor goals_progress_alert_renderer for enhanced department summary rendering

- Simplify multi-period department progress calculations by restructuring logic to render by period first.
- Add support for daily target calculations and timeframe-based target adjustments in `goals_criteria`.
- Introduce `countOperatingDaysInTimeframe` and related helper methods for improved alert scheduling and progress tracking.
This commit is contained in:
Jeppe Bundgaard
2026-01-29 20:20:05 +01:00
parent b3b12b58fd
commit cd2190d976
2 changed files with 133 additions and 76 deletions
@@ -643,4 +643,15 @@ class goals_criteria implements goals_criteria_i
$new_criteria->departments->set([(new \objects\departments_o())->select($department_id)]);
return $new_criteria;
}
public function getAlertDaysForDepartment(int $deptId): array
{
$alert_days = [];
foreach ($this->progress_alert_weekdays as $weekday) {
if ($weekday instanceof goals_criteria_progress_alert_weekday) {
$alert_days[] = $weekday;
}
}
return $alert_days;
}
}