How the Slovakia dovolenka calculator is verified

Inputs

InputFieldType
Days you work per weekdaysPerWeeknumber
Age you reach by the end of this calendar yearageAtYearEndnumber
You permanently care for a childcaresForChildboolean
You are a teacher, university lecturer or researcher under § 103(3)educationOrResearchRoleboolean
Full calendar months of continuous employment this yearmonthsWorkednumber
Days actually worked this yeardaysWorkedInYearnumber
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)
Weeks EntitledweeksEntitled(educationOrResearchRole = true ? $const.weeksEducationResearch : (($n(ageAtYearEnd) >= $const.ageThresholdYears or caresForChild = true) ? $const.weeksFromAgeOrChildCare : $const.baseWeeks))
Full Year DaysfullYearDaysweeksEntitled * $n(daysPerWeek)
Days EntitleddaysEntitled($full := fullYearDays; $gate := $n(daysWorkedInYear) >= $const.qualifyingDaysForYearLeave; $m := $clampFloorCap($n(monthsWorked), 0, $const.monthsPerYear); $byMonth := $full * $m / $const.monthsPerYear; $twelfths := $floor($n(daysWorkedInYear) / $const.daysPerTwelfth); $byWorkedDays := $full * $twelfths / $const.monthsPerYear; $raw := $gate ? $byMonth : $byWorkedDays; $round($clampFloorCap($raw, 0, $full), 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
baseWeeks4
weeksFromAgeOrChildCare5
weeksEducationResearch8
ageThresholdYears33
qualifyingDaysForYearLeave60
daysPerTwelfth21
monthsPerYear12

Test vectors (12)

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 the basic four weeks on a five-day week is 20 days

given daysPerWeek5
given ageAtYearEnd30
given caresForChildno
given educationOrResearchRoleno
given monthsWorked12
given daysWorkedInYear250
given daysTaken0
expect weeksEntitled4
expect fullYearDays20
expect daysEntitled20

Case 2 — N2 reaching 33 by the year end is five weeks, so 25

given daysPerWeek5
given ageAtYearEnd33
given caresForChildno
given educationOrResearchRoleno
given monthsWorked12
given daysWorkedInYear250
given daysTaken0
expect weeksEntitled5
expect daysEntitled25

Case 3 — N3 the band is AT 33, so 32 is still on four weeks

given daysPerWeek5
given ageAtYearEnd32
given caresForChildno
given educationOrResearchRoleno
given monthsWorked12
given daysWorkedInYear250
given daysTaken0
expect weeksEntitled4
expect daysEntitled20

Case 4 — N4 caring for a child gives the same five weeks at any age

given daysPerWeek5
given ageAtYearEnd24
given caresForChildyes
given educationOrResearchRoleno
given monthsWorked12
given daysWorkedInYear250
given daysTaken0
expect weeksEntitled5
expect daysEntitled25

Case 5 — N5 a teacher gets eight weeks, which beats the age band rather than adding to it

given daysPerWeek5
given ageAtYearEnd40
given caresForChildno
given educationOrResearchRoleyes
given monthsWorked12
given daysWorkedInYear250
given daysTaken0
expect weeksEntitled8
expect daysEntitled40

Case 6 — N6 half a year of employment is six twelfths under § 102

given daysPerWeek5
given ageAtYearEnd30
given caresForChildno
given educationOrResearchRoleno
given monthsWorked6
given daysWorkedInYear125
given daysTaken0
expect daysEntitled10

Case 7 — N7 below § 101's 60 days, § 105 pays per 21 worked days, not per month

given daysPerWeek5
given ageAtYearEnd30
given caresForChildno
given educationOrResearchRoleno
given monthsWorked5
given daysWorkedInYear50
given daysTaken0
expect daysEntitled3.3

Case 8 — N8 at exactly 60 worked days the month rule takes over

given daysPerWeek5
given ageAtYearEnd30
given caresForChildno
given educationOrResearchRoleno
given monthsWorked3
given daysWorkedInYear60
given daysTaken0
expect daysEntitled5

Case 9 — N9 fewer than 21 worked days earns nothing under § 105

given daysPerWeek5
given ageAtYearEnd30
given caresForChildno
given educationOrResearchRoleno
given monthsWorked0
given daysWorkedInYear20
given daysTaken0
expect daysEntitled0

Case 10 — N10 a six-day week gets more days out of the same four weeks

given daysPerWeek6
given ageAtYearEnd30
given caresForChildno
given educationOrResearchRoleno
given monthsWorked12
given daysWorkedInYear300
given daysTaken0
expect daysEntitled24

Case 11 — N11 days already taken come off the remainder

given daysPerWeek5
given ageAtYearEnd33
given caresForChildno
given educationOrResearchRoleno
given monthsWorked12
given daysWorkedInYear250
given daysTaken10
expect daysRemaining15

Case 12 — N12 taking more than the entitlement never goes negative

given daysPerWeek5
given ageAtYearEnd30
given caresForChildno
given educationOrResearchRoleno
given monthsWorked12
given daysWorkedInYear250
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 Slovakia dovolenka calculator

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