How the Greece κανονική άδεια calculator is verified

Inputs

InputFieldType
Working-week systemweekSystemstring
Completed years with your current employerserviceYearsnumber
Total years of service with any employeranyEmployerYearsnumber
Months worked so far (first year only)monthsInFirstYearnumber
Working days already takendaysTakennumber

The formula

Each derived value below is computed by the Valem engine from the expression shown, in this order. Nothing else runs — there is no hidden code path.

Derived valueFieldFormula (JSONata)
Completed YearscompletedYears$floor($n(serviceYears))
Days EntitleddaysEntitled($y := completedYears; $a := $floor($n(anyEmployerYears)); $t := $y > $a ? $y : $a; $base := weekSystem = 'six' ? $const.baseSix : $const.baseFive; $cap := weekSystem = 'six' ? $const.capSix : $const.capFive; $m := $n(monthsInFirstYear); $m := $m > 12 ? 12 : ($m < 0 ? 0 : $m); $t >= $const.longServiceYears ? (weekSystem = 'six' ? $const.longSix : $const.longFive) : (($y >= $const.sameEmployerYears or $a >= $const.anyEmployerYearsThreshold) ? (weekSystem = 'six' ? $const.tenYearSix : $const.tenYearFive) : ($y < 1 ? $round($base * $m / 12, 1) : ($base + $y - 1 > $cap ? $cap : $base + $y - 1))))
Days RemainingdaysRemaining($r := daysEntitled - $n(daysTaken); $r < 0 ? 0 : $round($r, 1))

Rates and thresholds

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.

ConstantValue
baseFive20
baseSix24
capFive22
capSix26
tenYearFive25
tenYearSix30
sameEmployerYears10
anyEmployerYearsThreshold12
longServiceYears25
longFive26
longSix31

Test vectors (10)

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 — GR1 half of the first year on a five-day week: 10 days

given weekSystemfive
given serviceYears0
given anyEmployerYears0
given monthsInFirstYear6
given daysTaken0
expect daysEntitled10

Case 2 — GR2 one completed year: 20

given weekSystemfive
given serviceYears1
given anyEmployerYears1
given monthsInFirstYear12
given daysTaken0
expect daysEntitled20

Case 3 — GR3 two years: 21

given weekSystemfive
given serviceYears2
given anyEmployerYears2
given monthsInFirstYear12
given daysTaken0
expect daysEntitled21

Case 4 — GR4 three years reaches 22 and stays there

given weekSystemfive
given serviceYears7
given anyEmployerYears7
given monthsInFirstYear12
given daysTaken0
expect daysEntitled22

Case 5 — GR5 ten years with the same employer: 25

given weekSystemfive
given serviceYears10
given anyEmployerYears10
given monthsInFirstYear12
given daysTaken0
expect daysEntitled25

Case 6 — GR6 twelve years with any employer: 25 even after only 3 with this one

given weekSystemfive
given serviceYears3
given anyEmployerYears12
given monthsInFirstYear12
given daysTaken0
expect daysEntitled25

Case 7 — GR7 twenty-five years: 26

given weekSystemfive
given serviceYears25
given anyEmployerYears25
given monthsInFirstYear12
given daysTaken0
expect daysEntitled26

Case 8 — GR8 six-day week: 24, then 26, then 31

given weekSystemsix
given serviceYears30
given anyEmployerYears30
given monthsInFirstYear12
given daysTaken0
expect daysEntitled31

Case 9 — GR9 six-day week, one year: 24

given weekSystemsix
given serviceYears1
given anyEmployerYears1
given monthsInFirstYear12
given daysTaken0
expect daysEntitled24

Case 10 — GR10 days taken never push the remainder negative

given weekSystemfive
given serviceYears1
given anyEmployerYears1
given monthsInFirstYear12
given daysTaken40
expect daysRemaining0

Sources

Check it yourself — and reuse it

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.

← Back to the Greece κανονική άδεια calculator

Built with Valem — a live, verifiable calculator you can fork and embed.