Several named time measures per shift, selectable per rule, with a period for balance rules
R
Roni
Context: in public transport one duty has several time measures that matter: spread (start to end), paid time, overtime, night time, driving time. Contracts, labour law and fairness rules each depend on a different one. Timefold offers one alternative measure per shift (loggedTime), and only contract period rules use it.
Gap:
Only one alternative measure per shift, so a contract can’t cap paid time while another rule uses a different measure.
balanceTimeWorkedRules always balances shift duration, never loggedTime.
balanceTimeWorkedRules balances over the whole planning window. With a four-week run, one driver can take all the overtime in week 1 and none in week 2 and still look balanced.
rollingWindowRules support only minutesWorkedLimit.
Request:
Named time measures on the shift:
"timeMeasures": { "paid": "PT420M", "overtime": "PT60M", "night": "PT0M" }
A measure selector on every time-based rule (period rules, rolling-window rules, weekend rules, balance time worked), with shift duration as the default:
{ "id": "maxPaidPerDay", "period": "DAY", "minutesLoggedMax": 480, "timeMeasure": "paid" }
A period on balanceTimeWorkedRules, using the same values as period rules (DAY, WEEK, MONTH, custom periods), so balancing happens within each period instead of only over the whole window:
"balanceTimeWorkedRules": [
{ "id": "fairPaidTimePerWeek", "timeMeasure": "paid", "period": "WEEK",
"includeEmployeeTags": ["full-time"] }
]
Historic values per measure for balance rules, following the employeeToPublishedMinutesWorked pattern, for continuous planning.
Compatibility: loggedTime stays as an alias for a default measure, and a balance rule without period keeps today’s behaviour over the whole window, so existing models keep working.
Use cases this unlocks:
Paid-time limits: cap paid time per day and week, and cap spread separately (Italian nastro).
Daily overtime fairness: balance the overtime measure.
Weekly overtime fairness: balance paid time per WEEK, adjusted for FTE. Because contracted hours scale with FTE, evening out paid time per week evens out weekly overtime, with no separate overtime rule needed.
Impact: this applies to every customer with time-based labour rules, which in public transport means almost all of them. We can calculate every measure per duty on our side. We only need the rules to point at them.
Log In