Add support for per-department custom daily targets

- Introduced `department_daily_targets` field in criteria, renderer, and API to define daily target overrides for departments.
- Enhanced daily target logic to honor per-department overrides while maintaining backward compatibility.
- Updated SMS, email, and Slack renderers for consistent enforcement of text length limits with fallback to non-mbstring functions.
- Refactored order item update logic to improve database interaction safety by using setters.
This commit is contained in:
Jeppe Bundgaard
2026-02-25 13:03:04 +01:00
parent 5cc311ae32
commit ffc5d6bc21
7 changed files with 167 additions and 16 deletions
+12
View File
@@ -8386,6 +8386,18 @@ components:
For backward-compatibility the API also accepts camelCase `progressAlertTimeOfDay` on input.
pattern: '^([01]\d|2[0-3]):[0-5]\d(?:Z|[+-](?:[01]\d|2[0-3]):?[0-5]\d)$'
example: "14:30+02:00"
department_daily_targets:
type: object
description: |
Optional per-department custom daily targets. Keys are department IDs and values are non-negative integers representing the target per operating day for that department.
If omitted, the daily target is split evenly across selected departments. The canonical field name is snake_case `department_daily_targets`.
For backward-compatibility the API also accepts camelCase `departmentDailyTargets` on input.
additionalProperties:
type: integer
minimum: 0
example:
"12": 3
"15": 5
DepartmentGoal:
type: object