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
minServiceYears
1
midServiceYears
10
longServiceYears
20
daysShort
5
daysMid
10
daysLong
15
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 — L2 one full year: 5 days
given serviceYears
1
given daysTaken
0
expect daysEntitled
5
Case 2 — L1 under a year of work: no annual leave yet
given serviceYears
0
given daysTaken
0
expect daysEntitled
0
Case 3 — L3 nine years is still the 5-day band (“不满10年”)
given serviceYears
9
given daysTaken
0
expect daysEntitled
5
Case 4 — L4 ten years steps to 10 days (“已满10年”)
given serviceYears
10
given daysTaken
0
expect daysEntitled
10
Case 5 — L5 nineteen years: still 10
given serviceYears
19
given daysTaken
0
expect daysEntitled
10
Case 6 — L6 twenty years and beyond: 15, the ceiling
given serviceYears
30
given daysTaken
0
expect daysEntitled
15
Case 7 — L7 days taken come off the remainder and it never goes negative
given serviceYears
12
given daysTaken
14
expect daysEntitled
10
expect daysRemaining
0
Case 8 — L8 days taken below the entitlement leave the balance
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.