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
weeksPrivate
4
weeksPublic
5
weeksTeacher
8
weeksInYear
52
minWeeksForProRata
4
Test vectors (7)
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 — CZ1 a full year at 40 hours: 160 hours, 20 days
given employerType
private
given weeklyHours
40
given daysPerWeek
5
given weeksWorked
52
given daysTaken
0
expect leaveHours
160
expect daysEntitled
20
Case 2 — CZ2 public employer: 5 weeks, 200 hours, 25 days
given employerType
public
given weeklyHours
40
given daysPerWeek
5
given weeksWorked
52
given daysTaken
0
expect leaveHours
200
expect daysEntitled
25
Case 3 — CZ3 a teacher: 8 weeks, 40 days
given employerType
teacher
given weeklyHours
40
given daysPerWeek
5
given weeksWorked
52
given daysTaken
0
expect daysEntitled
40
Case 4 — CZ4 26 weeks worked: half, 80 hours
given employerType
private
given weeklyHours
40
given daysPerWeek
5
given weeksWorked
26
given daysTaken
0
expect leaveHours
80
expect daysEntitled
10
Case 5 — CZ5 three weeks worked: no leave yet
given employerType
private
given weeklyHours
40
given daysPerWeek
5
given weeksWorked
3
given daysTaken
0
expect leaveHours
0
Case 6 — CZ6 part-time 20 hours over 4 days: 80 hours, still 16 days
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.