How the Poland urlop wypoczynkowy calculator is verified

Inputs

InputFieldType
Years of employment (total, any employer)serviceYearsnumber
Working time as a % of full timeemploymentPercentnumber
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)
Full Time DaysfullTimeDays($n(serviceYears) >= $const.serviceThresholdYears ? $const.daysFrom10Years : $const.daysUnder10Years)
Proportional DaysproportionalDaysfullTimeDays * $n(employmentPercent) / 100
Days EntitleddaysEntitled$clampFloorCap($ceil(proportionalDays), 0, fullTimeDays)
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
daysUnder10Years20
daysFrom10Years26
serviceThresholdYears10

Test vectors (9)

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 — L1 under ten years' employment, full time: 20 days

given serviceYears5
given employmentPercent100
given daysTaken0
expect fullTimeDays20
expect daysEntitled20

Case 2 — L2 at ten years it steps to 26 — there is nothing in between

given serviceYears10
given employmentPercent100
given daysTaken0
expect fullTimeDays26
expect daysEntitled26

Case 3 — L3 nine years is still the lower band: “co najmniej 10 lat” is at least ten

given serviceYears9
given employmentPercent100
given daysTaken0
expect fullTimeDays20
expect daysEntitled20

Case 4 — L4 3/4 etatu on the 26-day band is 19.5, which § 2 rounds UP to 20

given serviceYears12
given employmentPercent75
given daysTaken0
expect proportionalDays19.5
expect daysEntitled20

Case 5 — L5 half time on the 20-day band is exactly 10, so the round-up changes nothing

given serviceYears3
given employmentPercent50
given daysTaken0
expect proportionalDays10
expect daysEntitled10

Case 6 — L6 a third of full time on the lower band: 6.667 rounds up to 7

given serviceYears3
given employmentPercent33
given daysTaken0
expect daysEntitled7

Case 7 — L7 § 3's ceiling: the pro-rated figure can never exceed § 1's

given serviceYears30
given employmentPercent100
given daysTaken0
expect daysEntitled26

Case 8 — L8 days already taken come off the remainder, and it never goes negative

given serviceYears12
given employmentPercent100
given daysTaken30
expect daysRemaining0

Case 9 — L9 days taken below the entitlement leave the balance

given serviceYears12
given employmentPercent100
given daysTaken6
expect daysEntitled26
expect daysRemaining20

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 Poland urlop wypoczynkowy calculator

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