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
daysPerYear
30
daysPerMonthFirstYear
2
minServiceMonths
6
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 — U1 a full year of service gives 30
given serviceMonths
24
given monthsWorked
12
given daysTaken
0
expect daysEntitled
30
Case 2 — U2 six months or less in the first year gives nothing yet
given serviceMonths
6
given monthsWorked
12
given daysTaken
0
expect daysEntitled
0
Case 3 — U3 seven months is two days a month: 14
given serviceMonths
7
given monthsWorked
12
given daysTaken
0
expect daysEntitled
14
Case 4 — U4 eleven months is 22 — not eleven twelfths of 30
given serviceMonths
11
given monthsWorked
12
given daysTaken
0
expect daysEntitled
22
Case 5 — U5 the first completed year gives the full 30
given serviceMonths
12
given monthsWorked
12
given daysTaken
0
expect daysEntitled
30
Case 6 — U6 a final part year of five months is 12.5
given serviceMonths
41
given monthsWorked
5
given daysTaken
0
expect daysEntitled
12.5
Case 7 — U7 days taken come off the remainder
given serviceMonths
24
given monthsWorked
12
given daysTaken
12
expect daysRemaining
18
Case 8 — U8 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.