The expressions above read these as $const. They are the figures the annual refresh replaces, so they live as data rather than being written into the formulas — which is what makes a year-on-year change a one-line diff instead of an edit to arithmetic.
Constant
Value
daysPerWorkedMonth
2
halfMonthThreshold
0.5
freeSaturdays
5
monthsPerYear
12
workingDaysPerWeek
5
Test vectors (8)
Every case is executed against this model on each build, by the Java engine and independently by a JavaScript one. A mismatch of a single cent fails the build, so the page cannot ship advertising a figure the model no longer produces.
Case 1 — N1 a full leave year is 24 orlofsdagar, which is 4,8 Monday-to-Friday weeks
given monthsWorked
12
given daysTaken
0
expect countedMonths
12
expect orlofsdagarEntitled
24
expect weeksOfLeave
4.8
expect daysEntitled
24
Case 2 — N2 six months earns half of it
given monthsWorked
6
given daysTaken
0
expect orlofsdagarEntitled
12
expect daysEntitled
12
Case 3 — N3 half a month rounds UP to a whole month
given monthsWorked
7.5
given daysTaken
0
expect countedMonths
8
expect orlofsdagarEntitled
16
Case 4 — N4 just under half a month counts for nothing
given monthsWorked
7.4
given daysTaken
0
expect countedMonths
7
expect orlofsdagarEntitled
14
Case 5 — N5 the threshold is AT a half, so exactly .5 rounds up
given monthsWorked
0.5
given daysTaken
0
expect countedMonths
1
expect orlofsdagarEntitled
2
Case 6 — N6 under half a month in total earns nothing at all
given monthsWorked
0.4
given daysTaken
0
expect countedMonths
0
expect daysEntitled
0
Case 7 — N7 days already taken come off the remainder
given monthsWorked
12
given daysTaken
10
expect daysRemaining
14
Case 8 — N8 taking more than the entitlement never goes negative
The whole model as JSON — inputs, outputs, formulas, vectors and sources in one re-runnable document.
This model is published under CC BY 4.0: use it, adapt it, build on it, with attribution. The licence covers the model — the expression of each rule and the arrangement of the catalog. The rates and thresholds are law, and nobody licenses those; the sources above are where they come from.