@adminiumjs/manifest 0.3.80 → 0.3.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/leave/earning-year.d.ts +34 -0
- package/dist/leave/earning-year.d.ts.map +1 -0
- package/dist/leave/earning-year.js +113 -0
- package/dist/leave/earning-year.js.map +1 -0
- package/dist/leave/floors.d.ts +6 -0
- package/dist/leave/floors.d.ts.map +1 -1
- package/dist/leave/floors.js +18 -0
- package/dist/leave/floors.js.map +1 -1
- package/dist/leave/index.d.ts +4 -0
- package/dist/leave/index.d.ts.map +1 -1
- package/dist/leave/index.js +4 -0
- package/dist/leave/index.js.map +1 -1
- package/dist/leave/preset-czechia.d.ts +10 -0
- package/dist/leave/preset-czechia.d.ts.map +1 -0
- package/dist/leave/preset-czechia.js +69 -0
- package/dist/leave/preset-czechia.js.map +1 -0
- package/dist/leave/preset-denmark.d.ts +24 -0
- package/dist/leave/preset-denmark.d.ts.map +1 -0
- package/dist/leave/preset-denmark.js +31 -0
- package/dist/leave/preset-denmark.js.map +1 -0
- package/dist/leave/preset-france.d.ts +30 -0
- package/dist/leave/preset-france.d.ts.map +1 -0
- package/dist/leave/preset-france.js +31 -0
- package/dist/leave/preset-france.js.map +1 -0
- package/dist/leave/told.d.ts +6 -1
- package/dist/leave/told.d.ts.map +1 -1
- package/dist/leave/told.js.map +1 -1
- package/dist/leave-shape.d.ts +3 -1
- package/dist/leave-shape.d.ts.map +1 -1
- package/dist/leave-shape.js +3 -1
- package/dist/leave-shape.js.map +1 -1
- package/dist/leave-word.d.ts +4 -0
- package/dist/leave-word.d.ts.map +1 -1
- package/dist/leave-word.js +20 -0
- package/dist/leave-word.js.map +1 -1
- package/dist/schema.d.ts +24 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/words.d.ts +1 -1
- package/dist/words.d.ts.map +1 -1
- package/dist/words.js +6 -1
- package/dist/words.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An earning year that does not start on 1 January (France's 1 June,
|
|
3
|
+
* Denmark's 1 September), posted the way the engine posts every year: by
|
|
4
|
+
* calendar year. A calendar year holds two pieces of two earning years. Its
|
|
5
|
+
* first months end the earning year begun the year before; its last months
|
|
6
|
+
* begin the next one. Both pieces of one earning year expire on the same
|
|
7
|
+
* 31 December, the one after that earning year ends, so the year-end close of
|
|
8
|
+
* that calendar year closes the whole earning year, and a day in the autumn
|
|
9
|
+
* can be spent from either year's days, the older first.
|
|
10
|
+
*
|
|
11
|
+
* An earning year is rounded ONCE, over the whole of it: its first piece is
|
|
12
|
+
* rounded up on its own, and its second is the whole less the first, so the
|
|
13
|
+
* two always add up to the year's figure. Both are earned month by month.
|
|
14
|
+
*/
|
|
15
|
+
import { type CivilDay } from './civil.js';
|
|
16
|
+
import type { EntitlementPerson, LotPlan } from './entitlement.js';
|
|
17
|
+
export interface EarningYearRule {
|
|
18
|
+
/** The month the earning year starts in: 6 for June, 9 for September. */
|
|
19
|
+
startMonth: number;
|
|
20
|
+
/** The days a year at full time. */
|
|
21
|
+
days: number;
|
|
22
|
+
/** `day`: the year's figure is rounded up to a whole day; `unit`: to a thousandth. */
|
|
23
|
+
roundTo: 'day' | 'unit';
|
|
24
|
+
/** The country, for the lot's rule text. */
|
|
25
|
+
label: string;
|
|
26
|
+
}
|
|
27
|
+
/** The earning year that starts in this calendar year. */
|
|
28
|
+
export declare function earningYear(startMonth: number, year: number): {
|
|
29
|
+
from: CivilDay;
|
|
30
|
+
to: CivilDay;
|
|
31
|
+
};
|
|
32
|
+
/** A calendar year's lots: the end of the earning year begun last year, then the start of this year's. */
|
|
33
|
+
export declare function earningYearLots(rule: EarningYearRule, person: EntitlementPerson, year: number): LotPlan[];
|
|
34
|
+
//# sourceMappingURL=earning-year.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"earning-year.d.ts","sourceRoot":"","sources":["../../src/leave/earning-year.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAmG,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC5I,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAGnE,MAAM,WAAW,eAAe;IAC9B,yEAAyE;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,4CAA4C;IAC5C,KAAK,EAAE,MAAM,CAAC;CACf;AAMD,0DAA0D;AAC1D,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,EAAE,EAAE,QAAQ,CAAA;CAAE,CAE9F;AAmFD,0GAA0G;AAC1G,wBAAgB,eAAe,CAAC,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,EAAE,CAOzG"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
/**
|
|
3
|
+
* An earning year that does not start on 1 January (France's 1 June,
|
|
4
|
+
* Denmark's 1 September), posted the way the engine posts every year: by
|
|
5
|
+
* calendar year. A calendar year holds two pieces of two earning years. Its
|
|
6
|
+
* first months end the earning year begun the year before; its last months
|
|
7
|
+
* begin the next one. Both pieces of one earning year expire on the same
|
|
8
|
+
* 31 December, the one after that earning year ends, so the year-end close of
|
|
9
|
+
* that calendar year closes the whole earning year, and a day in the autumn
|
|
10
|
+
* can be spent from either year's days, the older first.
|
|
11
|
+
*
|
|
12
|
+
* An earning year is rounded ONCE, over the whole of it: its first piece is
|
|
13
|
+
* rounded up on its own, and its second is the whole less the first, so the
|
|
14
|
+
* two always add up to the year's figure. Both are earned month by month.
|
|
15
|
+
*/
|
|
16
|
+
import { addDays, daysBetween, daysInMonth, earlierDay, isFirstOfMonth, isLastOfMonth, laterDay, yearEnd } from './civil.js';
|
|
17
|
+
import { ceilDiv, UNITS_PER_DAY } from './units.js';
|
|
18
|
+
const MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
19
|
+
const pad = (value) => String(value).padStart(2, '0');
|
|
20
|
+
const monthStart = (year, month) => `${String(year)}-${pad(month)}-01`;
|
|
21
|
+
/** The earning year that starts in this calendar year. */
|
|
22
|
+
export function earningYear(startMonth, year) {
|
|
23
|
+
return { from: monthStart(year, startMonth), to: addDays(monthStart(year + 1, startMonth), -1) };
|
|
24
|
+
}
|
|
25
|
+
/** The person's terms between two days, cut to when they work here. */
|
|
26
|
+
function termsBetween(person, from, to) {
|
|
27
|
+
const first = laterDay(person.started, from);
|
|
28
|
+
const last = person.lastDay === undefined || person.lastDay === null ? to : earlierDay(person.lastDay, to);
|
|
29
|
+
const out = [];
|
|
30
|
+
for (const term of person.terms) {
|
|
31
|
+
const start = laterDay(term.from, first);
|
|
32
|
+
const end = term.to === null ? last : earlierDay(term.to, last);
|
|
33
|
+
if (start <= end)
|
|
34
|
+
out.push({ from: start, to: end, share: term.share });
|
|
35
|
+
}
|
|
36
|
+
return out.sort((a, b) => (a.from < b.from ? -1 : 1));
|
|
37
|
+
}
|
|
38
|
+
/** The whole calendar months between two days, both counted, across a year's end too. */
|
|
39
|
+
function monthsCovered(from, to) {
|
|
40
|
+
let count = 0;
|
|
41
|
+
let year = Number(from.slice(0, 4));
|
|
42
|
+
let month = Number(from.slice(5, 7));
|
|
43
|
+
while (monthStart(year, month) <= to) {
|
|
44
|
+
const end = `${String(year)}-${pad(month)}-${pad(daysInMonth(year, month))}`;
|
|
45
|
+
if (from <= monthStart(year, month) && end <= to)
|
|
46
|
+
count += 1;
|
|
47
|
+
year += month === 12 ? 1 : 0;
|
|
48
|
+
month = month === 12 ? 1 : month + 1;
|
|
49
|
+
}
|
|
50
|
+
return count;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* What an earning year gives up to a day, as an exact fraction: whole months
|
|
54
|
+
* when every term runs from a month's first to a month's last, else calendar
|
|
55
|
+
* days, as the calendar-year presets share a year.
|
|
56
|
+
*/
|
|
57
|
+
function earnedUpTo(rule, person, window, cut) {
|
|
58
|
+
const parts = termsBetween(person, window.from, window.to);
|
|
59
|
+
const onMonths = parts.every((part) => isFirstOfMonth(part.from) && isLastOfMonth(part.to));
|
|
60
|
+
const over = onMonths ? 12 : daysBetween(window.from, window.to) + 1;
|
|
61
|
+
let units = 0;
|
|
62
|
+
for (const part of parts) {
|
|
63
|
+
if (part.from > cut)
|
|
64
|
+
continue;
|
|
65
|
+
const to = earlierDay(part.to, cut);
|
|
66
|
+
units += rule.days * part.share * (onMonths ? monthsCovered(part.from, to) : daysBetween(part.from, to) + 1);
|
|
67
|
+
}
|
|
68
|
+
return { units, over };
|
|
69
|
+
}
|
|
70
|
+
/** The whole earning year's figure, rounded once. */
|
|
71
|
+
function yearFigure(rule, person, window) {
|
|
72
|
+
const { units, over } = earnedUpTo(rule, person, window, window.to);
|
|
73
|
+
const exact = ceilDiv(units, over);
|
|
74
|
+
return rule.roundTo === 'day' ? ceilDiv(exact, UNITS_PER_DAY) * UNITS_PER_DAY : exact;
|
|
75
|
+
}
|
|
76
|
+
/** The earning year's first piece, to 31 December: the whole year's figure when nothing is earned after it. */
|
|
77
|
+
function firstPiece(rule, person, window) {
|
|
78
|
+
const end = yearEnd(Number(window.from.slice(0, 4)));
|
|
79
|
+
const after = termsBetween(person, addDays(end, 1), window.to);
|
|
80
|
+
if (after.length === 0)
|
|
81
|
+
return yearFigure(rule, person, window);
|
|
82
|
+
const { units, over } = earnedUpTo(rule, person, window, end);
|
|
83
|
+
return ceilDiv(units, over);
|
|
84
|
+
}
|
|
85
|
+
const nameOf = (window) => `${MONTHS[Number(window.from.slice(5, 7)) - 1]} ${window.from.slice(0, 4)} to ${MONTHS[Number(window.to.slice(5, 7)) - 1]} ${window.to.slice(0, 4)}`;
|
|
86
|
+
function lotOf(rule, person, window, piece, amount) {
|
|
87
|
+
const parts = termsBetween(person, piece.from, piece.to);
|
|
88
|
+
if (parts.length === 0 || amount <= 0)
|
|
89
|
+
return [];
|
|
90
|
+
const from = parts[0].from;
|
|
91
|
+
const to = parts.at(-1).to;
|
|
92
|
+
return [
|
|
93
|
+
{
|
|
94
|
+
kind: 'grant',
|
|
95
|
+
tier: null,
|
|
96
|
+
usableFrom: from,
|
|
97
|
+
expiresOn: yearEnd(Number(window.to.slice(0, 4))),
|
|
98
|
+
amount,
|
|
99
|
+
rule: `${rule.label} ${nameOf(window)}: ${String(rule.days)} days a year, earned monthly`,
|
|
100
|
+
earn: { every: 'month', from, to },
|
|
101
|
+
},
|
|
102
|
+
];
|
|
103
|
+
}
|
|
104
|
+
/** A calendar year's lots: the end of the earning year begun last year, then the start of this year's. */
|
|
105
|
+
export function earningYearLots(rule, person, year) {
|
|
106
|
+
const ending = earningYear(rule.startMonth, year - 1);
|
|
107
|
+
const starting = earningYear(rule.startMonth, year);
|
|
108
|
+
return [
|
|
109
|
+
...lotOf(rule, person, ending, { from: `${String(year)}-01-01`, to: ending.to }, yearFigure(rule, person, ending) - firstPiece(rule, person, ending)),
|
|
110
|
+
...lotOf(rule, person, starting, { from: starting.from, to: yearEnd(year) }, firstPiece(rule, person, starting)),
|
|
111
|
+
];
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=earning-year.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"earning-year.js","sourceRoot":"","sources":["../../src/leave/earning-year.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAiB,MAAM,YAAY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C,IAAI,CAAC,UAAU,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC;IACtD,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IACpD,OAAO;QACL,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACrJ,GAAG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;KACjH,CAAC;AACJ,CAAC"}
|
package/dist/leave/floors.d.ts
CHANGED
|
@@ -11,6 +11,12 @@
|
|
|
11
11
|
* - Germany (BUrlG section 3): 24 working days on a six-day week, which is
|
|
12
12
|
* 20 on five; public holidays are never counted. The default 28 is 20
|
|
13
13
|
* statutory and 8 extra.
|
|
14
|
+
* - France (Code du travail, L3141-3): 2.5 working days a month counted
|
|
15
|
+
* Monday to Saturday, at most 30 a year, which is 25 on five days.
|
|
16
|
+
* - Denmark (the Holiday Act, Ferieloven): 2.08 days for each month
|
|
17
|
+
* employed, 25 a holiday year.
|
|
18
|
+
* - Czechia (the Labour Code, section 212): at least 4 weeks a year, 20
|
|
19
|
+
* days on five days; 5 weeks for public employers.
|
|
14
20
|
*
|
|
15
21
|
* The United States has no federal minimum.
|
|
16
22
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floors.d.ts","sourceRoot":"","sources":["../../src/leave/floors.ts"],"names":[],"mappings":"AACA
|
|
1
|
+
{"version":3,"file":"floors.d.ts","sourceRoot":"","sources":["../../src/leave/floors.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,MAAM,WAAW,cAAc;IAC7B,kDAAkD;IAClD,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,MAAM,EAAE,MAAM,CAAC;CAChB;AAyBD,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,GAAI,QAAQ,MAAM,GAAG,IAAI,KAAG,cAAc,GAAG,IAA2D,CAAC;AAEtI,mHAAmH;AACnH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAIpG"}
|
package/dist/leave/floors.js
CHANGED
|
@@ -12,6 +12,12 @@
|
|
|
12
12
|
* - Germany (BUrlG section 3): 24 working days on a six-day week, which is
|
|
13
13
|
* 20 on five; public holidays are never counted. The default 28 is 20
|
|
14
14
|
* statutory and 8 extra.
|
|
15
|
+
* - France (Code du travail, L3141-3): 2.5 working days a month counted
|
|
16
|
+
* Monday to Saturday, at most 30 a year, which is 25 on five days.
|
|
17
|
+
* - Denmark (the Holiday Act, Ferieloven): 2.08 days for each month
|
|
18
|
+
* employed, 25 a holiday year.
|
|
19
|
+
* - Czechia (the Labour Code, section 212): at least 4 weeks a year, 20
|
|
20
|
+
* days on five days; 5 weeks for public employers.
|
|
15
21
|
*
|
|
16
22
|
* The United States has no federal minimum.
|
|
17
23
|
*/
|
|
@@ -24,6 +30,18 @@ const FLOORS = {
|
|
|
24
30
|
days: 20,
|
|
25
31
|
reason: 'Germany gives at least 24 working days a year on a six-day week (BUrlG), which is 20 on five days a week. Public holidays are not counted in the figure.',
|
|
26
32
|
},
|
|
33
|
+
france: {
|
|
34
|
+
days: 25,
|
|
35
|
+
reason: 'France gives 30 working days a year counted Monday to Saturday (2.5 a month, Code du travail), which is 25 on five days a week. Count the figure on five days a week.',
|
|
36
|
+
},
|
|
37
|
+
denmark: {
|
|
38
|
+
days: 25,
|
|
39
|
+
reason: 'Denmark gives 25 days of holiday a year, 2.08 for each month employed (the Holiday Act). Days an agreement adds on top count in the figure.',
|
|
40
|
+
},
|
|
41
|
+
czechia: {
|
|
42
|
+
days: 20,
|
|
43
|
+
reason: 'Czechia gives at least 4 weeks of leave a year (the Labour Code), which is 20 days on five days a week. Public employers give 5 weeks, 25 days.',
|
|
44
|
+
},
|
|
27
45
|
};
|
|
28
46
|
/** The floor of a preset, or null when its country has none. */
|
|
29
47
|
export const statutoryFloorOf = (preset) => (preset === null ? null : (FLOORS[preset] ?? null));
|
package/dist/leave/floors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floors.js","sourceRoot":"","sources":["../../src/leave/floors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC
|
|
1
|
+
{"version":3,"file":"floors.js","sourceRoot":"","sources":["../../src/leave/floors.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;;;;;;GAqBG;AASH,MAAM,MAAM,GAA6C;IACvD,eAAe,EAAE;QACf,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,kLAAkL;KAC3L;IACD,OAAO,EAAE;QACP,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,0JAA0J;KACnK;IACD,MAAM,EAAE;QACN,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,uKAAuK;KAChL;IACD,OAAO,EAAE;QACP,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,6IAA6I;KACtJ;IACD,OAAO,EAAE;QACP,IAAI,EAAE,EAAE;QACR,MAAM,EAAE,iJAAiJ;KAC1J;CACF,CAAC;AAEF,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,MAAqB,EAAyB,EAAE,CAAC,CAAC,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;AAEtI,mHAAmH;AACnH,MAAM,UAAU,mBAAmB,CAAC,MAAqB,EAAE,WAA0B;IACnF,MAAM,KAAK,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACvC,IAAI,KAAK,KAAK,IAAI,IAAI,WAAW,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACxD,OAAO,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACxD,CAAC"}
|
package/dist/leave/index.d.ts
CHANGED
|
@@ -11,6 +11,10 @@ export * from './entitlement.js';
|
|
|
11
11
|
export { englandWales, englandWalesWith, ENGLAND_WALES_DEFAULT_DAYS, ENGLAND_WALES_LIMITS } from './preset-england-wales.js';
|
|
12
12
|
export { germany, germanyWith, germanEntitlement, GERMANY_DEFAULT_DAYS, GERMANY_LIMITS, holdLimitDay } from './preset-germany.js';
|
|
13
13
|
export * from './floors.js';
|
|
14
|
+
export { france, franceWith, FRANCE_DEFAULT_DAYS, FRANCE_LIMITS } from './preset-france.js';
|
|
15
|
+
export { denmark, denmarkWith, DENMARK_DEFAULT_DAYS, DENMARK_LIMITS } from './preset-denmark.js';
|
|
16
|
+
export { czechia, czechiaWith, CZECHIA_DEFAULT_DAYS, CZECHIA_LIMITS } from './preset-czechia.js';
|
|
17
|
+
export { earningYear, earningYearLots, type EarningYearRule } from './earning-year.js';
|
|
14
18
|
export { unitedStates, US_DEFAULT_DAYS, US_LIMITS } from './preset-us.js';
|
|
15
19
|
export * from './replay.js';
|
|
16
20
|
export * from './state.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/leave/index.ts"],"names":[],"mappings":"AACA;;;;GAIG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,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W,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1E,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
package/dist/leave/index.js
CHANGED
|
@@ -12,6 +12,10 @@ export * from './entitlement.js';
|
|
|
12
12
|
export { englandWales, englandWalesWith, ENGLAND_WALES_DEFAULT_DAYS, ENGLAND_WALES_LIMITS } from './preset-england-wales.js';
|
|
13
13
|
export { germany, germanyWith, germanEntitlement, GERMANY_DEFAULT_DAYS, GERMANY_LIMITS, holdLimitDay } from './preset-germany.js';
|
|
14
14
|
export * from './floors.js';
|
|
15
|
+
export { france, franceWith, FRANCE_DEFAULT_DAYS, FRANCE_LIMITS } from './preset-france.js';
|
|
16
|
+
export { denmark, denmarkWith, DENMARK_DEFAULT_DAYS, DENMARK_LIMITS } from './preset-denmark.js';
|
|
17
|
+
export { czechia, czechiaWith, CZECHIA_DEFAULT_DAYS, CZECHIA_LIMITS } from './preset-czechia.js';
|
|
18
|
+
export { earningYear, earningYearLots } from './earning-year.js';
|
|
15
19
|
export { unitedStates, US_DEFAULT_DAYS, US_LIMITS } from './preset-us.js';
|
|
16
20
|
export * from './replay.js';
|
|
17
21
|
export * from './state.js';
|
package/dist/leave/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/leave/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;GAIG;AACH,cAAc,mBAAmB,CAAC;AAClC,cAAc,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jG,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,eAAe,EAAwB,MAAM,mBAAmB,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC1E,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type LeavePreset } from './entitlement.js';
|
|
2
|
+
/** The days a year when a policy names none: five weeks, which most employers give and public employers must. */
|
|
3
|
+
export declare const CZECHIA_DEFAULT_DAYS = 25;
|
|
4
|
+
/** What this preset does not do, for the setup screen and the adviser. */
|
|
5
|
+
export declare const CZECHIA_LIMITS: readonly string[];
|
|
6
|
+
/** The preset with a policy's own days a year; a figure below the floor counts as the floor, and none as the default, marked for HR to confirm. */
|
|
7
|
+
export declare const czechiaWith: (confirmed?: number | null) => LeavePreset;
|
|
8
|
+
/** On the default figure. */
|
|
9
|
+
export declare const czechia: LeavePreset;
|
|
10
|
+
//# sourceMappingURL=preset-czechia.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-czechia.d.ts","sourceRoot":"","sources":["../../src/leave/preset-czechia.ts"],"names":[],"mappings":"AAaA,OAAO,EAAuC,KAAK,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAIvG,iHAAiH;AACjH,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAMvC,0EAA0E;AAC1E,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAM3C,CAAC;AAwBF,mJAAmJ;AACnJ,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM,GAAG,IAAI,KAAG,WAavD,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,OAAO,EAAE,WAA+B,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
/**
|
|
3
|
+
* Czechia (the Labour Code, zákoník práce): a starting point, to check with
|
|
4
|
+
* your adviser. Not for shifts of unequal length or irregular schedules.
|
|
5
|
+
*
|
|
6
|
+
* The policy's days a year (25 when it names none, never below 20, four weeks
|
|
7
|
+
* on five days: `floors.ts`) × the share, on the calendar year. A whole year
|
|
8
|
+
* employed is the whole figure; a part year is a fifty-second of it for each
|
|
9
|
+
* whole week employed, and nothing under four weeks. A change of terms shares
|
|
10
|
+
* those weeks by calendar days. Everything left carries to the end of the
|
|
11
|
+
* next year. What it does not model is in `CZECHIA_LIMITS`.
|
|
12
|
+
*/
|
|
13
|
+
import { daysBetween, daysInYear, yearEnd } from './civil.js';
|
|
14
|
+
import { termsInYear } from './entitlement.js';
|
|
15
|
+
import { statutoryFloorOf } from './floors.js';
|
|
16
|
+
import { ceilDiv } from './units.js';
|
|
17
|
+
/** The days a year when a policy names none: five weeks, which most employers give and public employers must. */
|
|
18
|
+
export const CZECHIA_DEFAULT_DAYS = 25;
|
|
19
|
+
/** The weeks of a full year. */
|
|
20
|
+
const YEAR_WEEKS = 52;
|
|
21
|
+
/** The fewest weeks a part year must hold for any leave at all. */
|
|
22
|
+
const LEAST_WEEKS = 4;
|
|
23
|
+
/** What this preset does not do, for the setup screen and the adviser. */
|
|
24
|
+
export const CZECHIA_LIMITS = [
|
|
25
|
+
'Counts in days on a regular week. The Labour Code counts leave in hours, so for shifts of unequal length or an irregular schedule the preset is not right.',
|
|
26
|
+
'Counts every week employed as worked. Weeks the Labour Code does not count (unpaid leave, an unexcused absence, sickness or other absence beyond 20 weeks) still earn leave here, and weeks worked beyond 52 add nothing.',
|
|
27
|
+
'Does not hold public employers to their 5 weeks (25 days) or teachers to their 8: set the figure.',
|
|
28
|
+
'Rounds up to a thousandth of a day, not to the next whole hour.',
|
|
29
|
+
'Carries everything left to the end of the next year. The Labour Code names no day the right ends: check with your adviser before letting carried days lapse.',
|
|
30
|
+
];
|
|
31
|
+
const gcd = (a, b) => (b === 0 ? a : gcd(b, a % b));
|
|
32
|
+
const fraction = (share) => `${String(share / gcd(share, 1000))}/${String(1000 / gcd(share, 1000))}`;
|
|
33
|
+
function lotsWith(days, person, year) {
|
|
34
|
+
const parts = termsInYear(person, year);
|
|
35
|
+
const employed = parts.reduce((sum, part) => sum + daysBetween(part.from, part.to) + 1, 0);
|
|
36
|
+
const weeks = employed === daysInYear(year) ? YEAR_WEEKS : Math.min(YEAR_WEEKS, Math.floor(employed / 7));
|
|
37
|
+
if (weeks < LEAST_WEEKS)
|
|
38
|
+
return [];
|
|
39
|
+
return parts.map((part) => {
|
|
40
|
+
const span = daysBetween(part.from, part.to) + 1;
|
|
41
|
+
const share = part.share < 1000 ? ` × ${fraction(part.share)}` : '';
|
|
42
|
+
return {
|
|
43
|
+
kind: 'grant',
|
|
44
|
+
tier: null,
|
|
45
|
+
usableFrom: part.from,
|
|
46
|
+
expiresOn: yearEnd(year),
|
|
47
|
+
amount: ceilDiv(days * part.share * weeks * span, YEAR_WEEKS * employed),
|
|
48
|
+
rule: `Czechia ${String(year)}: ${String(days)} days${share}, ${String(weeks)} of 52 weeks`,
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
/** The preset with a policy's own days a year; a figure below the floor counts as the floor, and none as the default, marked for HR to confirm. */
|
|
53
|
+
export const czechiaWith = (confirmed) => {
|
|
54
|
+
const days = confirmed === undefined || confirmed === null ? CZECHIA_DEFAULT_DAYS : Math.max(confirmed, statutoryFloorOf('czechia').days);
|
|
55
|
+
return {
|
|
56
|
+
key: 'czechia',
|
|
57
|
+
defaults: confirmed === undefined || confirmed === null ? [{ field: 'days_per_year', value: CZECHIA_DEFAULT_DAYS, isDefault: true, legalFigure: false, confirmBy: 'hr' }] : [],
|
|
58
|
+
minNoticeDays: 90,
|
|
59
|
+
graceDays: 14,
|
|
60
|
+
carry: { units: null, until: '12-31' },
|
|
61
|
+
holdLimitMonths: null,
|
|
62
|
+
holidaysWithin: () => false,
|
|
63
|
+
lotsFor: (person, year) => lotsWith(days, person, year),
|
|
64
|
+
limits: CZECHIA_LIMITS,
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
/** On the default figure. */
|
|
68
|
+
export const czechia = czechiaWith(null);
|
|
69
|
+
//# sourceMappingURL=preset-czechia.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-czechia.js","sourceRoot":"","sources":["../../src/leave/preset-czechia.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;GAUG;AACH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAC9D,OAAO,EAAE,WAAW,EAA0D,MAAM,kBAAkB,CAAC;AACvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAErC,iHAAiH;AACjH,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AACvC,gCAAgC;AAChC,MAAM,UAAU,GAAG,EAAE,CAAC;AACtB,mEAAmE;AACnE,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C,4JAA4J;IAC5J,2NAA2N;IAC3N,mGAAmG;IACnG,iEAAiE;IACjE,8JAA8J;CAC/J,CAAC;AAEF,MAAM,GAAG,GAAG,CAAC,CAAS,EAAE,CAAS,EAAU,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;AAC5E,MAAM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AM,OAAO,GAAgB,WAAW,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Denmark (Ferieloven): a starting point, to check with your adviser.
|
|
3
|
+
*
|
|
4
|
+
* Concurrent holiday: the policy's days a year (25 when it names none, never
|
|
5
|
+
* below 25: `floors.ts`) × the share, earned month by month over the holiday
|
|
6
|
+
* year, 1 September to 31 August, and usable as they are earned. A holiday
|
|
7
|
+
* year's days can be taken to the 31 December after it ends, sixteen months
|
|
8
|
+
* in all, so an autumn day can come from two holiday years: the older goes
|
|
9
|
+
* first. The year is rounded once (25 × months / 12), never 2.08 × 12 = 24.96.
|
|
10
|
+
*
|
|
11
|
+
* Nothing carries without a reason: moving the fifth week on needs a written
|
|
12
|
+
* agreement, and a holiday hindrance such as sickness moves up to four weeks.
|
|
13
|
+
* Both are a reason HR records (`DENMARK_LIMITS`).
|
|
14
|
+
*/
|
|
15
|
+
import type { LeavePreset } from './entitlement.js';
|
|
16
|
+
/** The days a year when a policy names none: the Holiday Act's 25. */
|
|
17
|
+
export declare const DENMARK_DEFAULT_DAYS = 25;
|
|
18
|
+
/** What this preset does not do, for the setup screen and the adviser. */
|
|
19
|
+
export declare const DENMARK_LIMITS: readonly string[];
|
|
20
|
+
/** The preset with a policy's own days a year; a figure below the floor counts as the floor, and none as the default, marked for HR to confirm. */
|
|
21
|
+
export declare const denmarkWith: (confirmed?: number | null) => LeavePreset;
|
|
22
|
+
/** On the default figure. */
|
|
23
|
+
export declare const denmark: LeavePreset;
|
|
24
|
+
//# sourceMappingURL=preset-denmark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-denmark.d.ts","sourceRoot":"","sources":["../../src/leave/preset-denmark.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,sEAAsE;AACtE,eAAO,MAAM,oBAAoB,KAAK,CAAC;AAEvC,0EAA0E;AAC1E,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAM3C,CAAC;AAEF,mJAAmJ;AACnJ,eAAO,MAAM,WAAW,GAAI,YAAY,MAAM,GAAG,IAAI,KAAG,WAavD,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,OAAO,EAAE,WAA+B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
import { earningYearLots } from './earning-year.js';
|
|
3
|
+
import { statutoryFloorOf } from './floors.js';
|
|
4
|
+
/** The days a year when a policy names none: the Holiday Act's 25. */
|
|
5
|
+
export const DENMARK_DEFAULT_DAYS = 25;
|
|
6
|
+
/** What this preset does not do, for the setup screen and the adviser. */
|
|
7
|
+
export const DENMARK_LIMITS = [
|
|
8
|
+
'Does not carry the fifth week by itself: moving it to the next holiday period needs a written agreement by 31 December. Record it as a reason to carry, for no more than the days above 20.',
|
|
9
|
+
'Does not carry days a holiday hindrance (sickness, parental leave) kept someone from taking. Record a reason to carry them, up to four weeks.',
|
|
10
|
+
'Holds no holiday pay: what goes to the Labour Market Holiday Fund, or is paid out for the fifth week, is not worked out.',
|
|
11
|
+
'Earns in every month employed, and shares a part month by calendar days. It does not tell holiday with pay from holiday allowance.',
|
|
12
|
+
'Counts days an agreement adds (feriefridage) with the holiday, on the same rules. An agreement\'s own rules for them are not modelled.',
|
|
13
|
+
];
|
|
14
|
+
/** The preset with a policy's own days a year; a figure below the floor counts as the floor, and none as the default, marked for HR to confirm. */
|
|
15
|
+
export const denmarkWith = (confirmed) => {
|
|
16
|
+
const days = confirmed === undefined || confirmed === null ? DENMARK_DEFAULT_DAYS : Math.max(confirmed, statutoryFloorOf('denmark').days);
|
|
17
|
+
return {
|
|
18
|
+
key: 'denmark',
|
|
19
|
+
defaults: confirmed === undefined || confirmed === null ? [{ field: 'days_per_year', value: DENMARK_DEFAULT_DAYS, isDefault: true, legalFigure: false, confirmBy: 'hr' }] : [],
|
|
20
|
+
minNoticeDays: 90,
|
|
21
|
+
graceDays: 14,
|
|
22
|
+
carry: null,
|
|
23
|
+
holdLimitMonths: null,
|
|
24
|
+
holidaysWithin: () => false,
|
|
25
|
+
lotsFor: (person, year) => earningYearLots({ startMonth: 9, days, roundTo: 'unit', label: 'Denmark' }, person, year),
|
|
26
|
+
limits: DENMARK_LIMITS,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/** On the default figure. */
|
|
30
|
+
export const denmark = denmarkWith(null);
|
|
31
|
+
//# sourceMappingURL=preset-denmark.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-denmark.js","sourceRoot":"","sources":["../../src/leave/preset-denmark.ts"],"names":[],"mappings":";AAgBA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,sEAAsE;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAEvC,0EAA0E;AAC1E,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C,6LAA6L;IAC7L,+IAA+I;IAC/I,0HAA0H;IAC1H,oIAAoI;IACpI,wIAAwI;CACzI,CAAC;AAEF,mJAAmJ;AACnJ,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAyB,EAAe,EAAE;IACpE,MAAM,IAAI,GAAG,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,gBAAgB,CAAC,SAAS,CAAE,CAAC,IAAI,CAAC,CAAC;IAC3I,OAAO;QACL,GAAG,EAAE,SAAS;QACd,QAAQ,EAAE,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;QAC9K,aAAa,EAAE,EAAE;QACjB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,IAAI;QACX,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,GAAG,EAAE,CAAC,KAAK;QAC3B,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,eAAe,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC;QACpH,MAAM,EAAE,cAAc;KACvB,CAAC;AACJ,CAAC,CAAC;AAEF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,OAAO,GAAgB,WAAW,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* France (congés payés): a starting point, to check with your adviser.
|
|
3
|
+
*
|
|
4
|
+
* Counted in working days of a five-day week (jours ouvrés), the unit every
|
|
5
|
+
* preset's `days_per_year` is in: the law's 30 days counted Monday to
|
|
6
|
+
* Saturday (jours ouvrables) are 25 on five days. Counting 30 on a five-day
|
|
7
|
+
* pattern would give six weeks instead of five.
|
|
8
|
+
*
|
|
9
|
+
* The policy's days a year (25 when it names none, never below 25:
|
|
10
|
+
* `floors.ts`) × the share, earned month by month over the reference year,
|
|
11
|
+
* 1 June to 31 May, and that year's figure rounded up to a whole day. Days can
|
|
12
|
+
* be taken as they are earned. A reference year's days are kept to the
|
|
13
|
+
* 31 December after it ends, and what is left then carries to 31 May, so the
|
|
14
|
+
* days earned to 31 May 2027 can be taken to 31 May 2028.
|
|
15
|
+
*
|
|
16
|
+
* Not modelled (`FRANCE_LIMITS`): the extra days for taking leave outside
|
|
17
|
+
* 1 May to 31 October, earning at 2 days a month while sick, other absences
|
|
18
|
+
* that do not count as work, a taking period the firm sets differently, and
|
|
19
|
+
* the 15 months a person back from sickness has from their notice.
|
|
20
|
+
*/
|
|
21
|
+
import type { LeavePreset } from './entitlement.js';
|
|
22
|
+
/** The days a year when a policy names none: the law's five weeks. */
|
|
23
|
+
export declare const FRANCE_DEFAULT_DAYS = 25;
|
|
24
|
+
/** What this preset does not do, for the setup screen and the adviser. */
|
|
25
|
+
export declare const FRANCE_LIMITS: readonly string[];
|
|
26
|
+
/** The preset with a policy's own days a year; a figure below the floor counts as the floor, and none as the default, marked for HR to confirm. */
|
|
27
|
+
export declare const franceWith: (confirmed?: number | null) => LeavePreset;
|
|
28
|
+
/** On the default figure. */
|
|
29
|
+
export declare const france: LeavePreset;
|
|
30
|
+
//# sourceMappingURL=preset-france.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-france.d.ts","sourceRoot":"","sources":["../../src/leave/preset-france.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,sEAAsE;AACtE,eAAO,MAAM,mBAAmB,KAAK,CAAC;AAEtC,0EAA0E;AAC1E,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAM1C,CAAC;AAEF,mJAAmJ;AACnJ,eAAO,MAAM,UAAU,GAAI,YAAY,MAAM,GAAG,IAAI,KAAG,WAatD,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,MAAM,EAAE,WAA8B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
import { earningYearLots } from './earning-year.js';
|
|
3
|
+
import { statutoryFloorOf } from './floors.js';
|
|
4
|
+
/** The days a year when a policy names none: the law's five weeks. */
|
|
5
|
+
export const FRANCE_DEFAULT_DAYS = 25;
|
|
6
|
+
/** What this preset does not do, for the setup screen and the adviser. */
|
|
7
|
+
export const FRANCE_LIMITS = [
|
|
8
|
+
'Counts in working days of a five-day week (jours ouvrés): 25 a year, not 30 counted Monday to Saturday.',
|
|
9
|
+
'Does not add the one or two extra days for taking part of the main leave outside 1 May to 31 October (fractionnement). Add them by hand.',
|
|
10
|
+
'Earns the full rate in every month employed: it does not lower what is earned while sick (2 days a month counted Monday to Saturday) or on other absences that do not count as work.',
|
|
11
|
+
'Keeps a reference year\'s days to the 31 December after it ends and carries what is left to 31 May. A firm that sets another taking period must check its dates.',
|
|
12
|
+
'Does not count the 15 months a person back from sickness has to take their days from the notice they get on return. Record a reason to carry them.',
|
|
13
|
+
];
|
|
14
|
+
/** The preset with a policy's own days a year; a figure below the floor counts as the floor, and none as the default, marked for HR to confirm. */
|
|
15
|
+
export const franceWith = (confirmed) => {
|
|
16
|
+
const days = confirmed === undefined || confirmed === null ? FRANCE_DEFAULT_DAYS : Math.max(confirmed, statutoryFloorOf('france').days);
|
|
17
|
+
return {
|
|
18
|
+
key: 'france',
|
|
19
|
+
defaults: confirmed === undefined || confirmed === null ? [{ field: 'days_per_year', value: FRANCE_DEFAULT_DAYS, isDefault: true, legalFigure: false, confirmBy: 'hr' }] : [],
|
|
20
|
+
minNoticeDays: 90,
|
|
21
|
+
graceDays: 14,
|
|
22
|
+
carry: { units: null, until: '05-31' },
|
|
23
|
+
holdLimitMonths: null,
|
|
24
|
+
holidaysWithin: () => false,
|
|
25
|
+
lotsFor: (person, year) => earningYearLots({ startMonth: 6, days, roundTo: 'day', label: 'France' }, person, year),
|
|
26
|
+
limits: FRANCE_LIMITS,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
/** On the default figure. */
|
|
30
|
+
export const france = franceWith(null);
|
|
31
|
+
//# sourceMappingURL=preset-france.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preset-france.js","sourceRoot":"","sources":["../../src/leave/preset-france.ts"],"names":[],"mappings":";AAsB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IAAI,CAAC;QAClH,MAAM,EAAE,aAAa;KACtB,CAAC;AACJ,CAAC,CAAC;AAEF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,MAAM,GAAgB,UAAU,CAAC,IAAI,CAAC,CAAC"}
|
package/dist/leave/told.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* `decidersOf` never names one for it.
|
|
6
6
|
*/
|
|
7
7
|
import { type DeciderFacts, type DeciderRequest } from './deciders.js';
|
|
8
|
-
export type LeaveNoticeKind = 'asked' | 'step' | 'change-asked' | 'decided' | 'cancelled' | 'withdrawn' | 'sick-reported' | 'sick-ended' | 'recorded' | 'returned' | 'adjusted' | LeaveDailyNoticeKind;
|
|
8
|
+
export type LeaveNoticeKind = 'asked' | 'step' | 'change-asked' | 'decided' | 'cancelled' | 'withdrawn' | 'sick-reported' | 'sick-ended' | 'recorded' | 'returned' | 'adjusted' | LeaveDailyNoticeKind | LeaveWeeklyNoticeKind;
|
|
9
9
|
/**
|
|
10
10
|
* What the daily job tells, as time passes: a request has waited long enough
|
|
11
11
|
* for the next person up to decide it too (`waited`), a sick report's last day
|
|
@@ -13,6 +13,11 @@ export type LeaveNoticeKind = 'asked' | 'step' | 'change-asked' | 'decided' | 'c
|
|
|
13
13
|
* (`covering`, to the cover), and a leaver's last day has come (`days-owed`).
|
|
14
14
|
*/
|
|
15
15
|
export type LeaveDailyNoticeKind = 'waited' | 'still-off' | 'covering' | 'days-owed';
|
|
16
|
+
/**
|
|
17
|
+
* What the weekly job tells: a manager, who of their direct reports is away
|
|
18
|
+
* next week (`weekly`). It names people and days, each "Away", never a type.
|
|
19
|
+
*/
|
|
20
|
+
export type LeaveWeeklyNoticeKind = 'weekly';
|
|
16
21
|
/** Why this person is the one told. */
|
|
17
22
|
export type ToldReason = 'yours' | 'manager' | 'cover' | 'next-up' | 'hr';
|
|
18
23
|
export interface Told {
|
package/dist/leave/told.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"told.d.ts","sourceRoot":"","sources":["../../src/leave/told.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,OAAO,EAAc,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAEnF,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,eAAe,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"told.d.ts","sourceRoot":"","sources":["../../src/leave/told.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,OAAO,EAAc,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAEnF,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,cAAc,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,eAAe,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAE/N;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,WAAW,CAAC;AAErF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC;AAE7C,uCAAuC;AACvC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,IAAI,CAAC;AAE1E,MAAM,WAAW,IAAI;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;CACpB;AAKD,4DAA4D;AAC5D,wBAAgB,SAAS,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,EAAE,CAWrG;AAED,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAG1L"}
|
package/dist/leave/told.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"told.js","sourceRoot":"","sources":["../../src/leave/told.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAA0C,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"told.js","sourceRoot":"","sources":["../../src/leave/told.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;GAKG;AACH,OAAO,EAAE,UAAU,EAA0C,MAAM,eAAe,CAAC;AA0BnF,8JAA8J;AAC9J,MAAM,gBAAgB,GAAiC,IAAI,GAAG,CAAC,CAAC,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;AAEvJ,4DAA4D;AAC5D,MAAM,UAAU,SAAS,CAAC,IAAqB,EAAE,OAAuB,EAAE,KAAmB;IAC3F,IAAI,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC;QAAE,OAAO,CAAC,EAAE,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IACzF,2FAA2F;IAC3F,MAAM,KAAK,GAAmB,IAAI,KAAK,eAAe,IAAI,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,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|
8
8
|
*/
|
|
9
9
|
/** The first Adminium that reads the leave words. The release round sets the real version here, in this one edit. */
|
|
10
10
|
export declare const LEAVE_MIN = "0.3.80";
|
|
11
|
+
/** The first Adminium that reads the leave word's absence-by-team switch, which came a release after the word. */
|
|
12
|
+
export declare const LEAVE_TEAM_MIN = "0.3.81";
|
|
11
13
|
/** The app's own tables the leave rules read: people, their terms, the calendar and the policies. */
|
|
12
14
|
export declare const LEAVE_SETUP_KEYS: readonly ["people", "employment", "terms", "patterns", "patternDays", "positions", "locations", "days", "years", "groups", "types", "policies", "blocked", "limits", "sick", "notes"];
|
|
13
15
|
/** The tables only Adminium writes. */
|
|
@@ -240,7 +242,7 @@ export declare const LEAVE_SETUP_COLUMNS: {
|
|
|
240
242
|
readonly year: "int";
|
|
241
243
|
readonly confirmed_at: "time";
|
|
242
244
|
};
|
|
243
|
-
/** `preset`: `england-wales`, `germany` or `
|
|
245
|
+
/** `preset`: `england-wales`, `germany`, `us`, `france`, `denmark` or `czechia`. `days_per_year`: the policy's figure on five days a week; empty means HR has not confirmed the default. */
|
|
244
246
|
readonly groups: {
|
|
245
247
|
readonly id: "key";
|
|
246
248
|
readonly preset: "word";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"leave-shape.d.ts","sourceRoot":"","sources":["../src/leave-shape.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,qHAAqH;AACrH,eAAO,MAAM,SAAS,WAAW,CAAC;AAElC,qGAAqG;AACrG,eAAO,MAAM,gBAAgB,uLAAwL,CAAC;AAEtN,uCAAuC;AACvC,eAAO,MAAM,eAAe,+HAAgI,CAAC;AAE7J,0CAA0C;AAC1C,eAAO,MAAM,gBAAgB,2SAAqD,CAAC;AAEnF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,gBAAgB,CAAC,CAAC,MAAM,CAAC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAA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AAM,eAAe,EAAE,SAAS,YAAY,EAAyB,CAAC;AAE7E,2FAA2F;AAC3F,eAAO,MAAM,YAAY,0GAA2G,CAAC;AACrI,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,kEAAkE;AAClE,eAAO,MAAM,aAAa,EAAE,UAAsB,CAAC;AAEnD,6FAA6F;AAC7F,eAAO,MAAM,YAAY,EAAE,SAAS,UAAU,EAAyC,CAAC;AAExF;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,SAAS,UAAU,EAAE,CAAC,CAS3E,CAAC;AAEF,6FAA6F;AAC7F,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAiC,CAAC;AAEnF,qGAAqG;AACrG,eAAO,MAAM,aAAa,4KAA6K,CAAC"}
|
package/dist/leave-shape.js
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
/** The first Adminium that reads the leave words. The release round sets the real version here, in this one edit. */
|
|
11
11
|
export const LEAVE_MIN = '0.3.80';
|
|
12
|
+
/** The first Adminium that reads the leave word's absence-by-team switch, which came a release after the word. */
|
|
13
|
+
export const LEAVE_TEAM_MIN = '0.3.81';
|
|
12
14
|
/** The app's own tables the leave rules read: people, their terms, the calendar and the policies. */
|
|
13
15
|
export const LEAVE_SETUP_KEYS = ['people', 'employment', 'terms', 'patterns', 'patternDays', 'positions', 'locations', 'days', 'years', 'groups', 'types', 'policies', 'blocked', 'limits', 'sick', 'notes'];
|
|
14
16
|
/** The tables only Adminium writes. */
|
|
@@ -111,7 +113,7 @@ export const LEAVE_SETUP_COLUMNS = {
|
|
|
111
113
|
locations: { id: 'key', time_zone: 'text', policy_group_id: 'key' },
|
|
112
114
|
days: { location_id: 'key', day: 'day', name: 'text', kind: 'word' },
|
|
113
115
|
years: { location_id: 'key', year: 'int', confirmed_at: 'time' },
|
|
114
|
-
/** `preset`: `england-wales`, `germany` or `
|
|
116
|
+
/** `preset`: `england-wales`, `germany`, `us`, `france`, `denmark` or `czechia`. `days_per_year`: the policy's figure on five days a week; empty means HR has not confirmed the default. */
|
|
115
117
|
groups: { id: 'key', preset: 'word', days_per_year: 'int' },
|
|
116
118
|
/** `code`: `annual`, `sick`, `parental`, `unpaid`, `toil`. `kind`: `balance` or `tracked`. `visibility`: `as booked` or `discreet`. */
|
|
117
119
|
types: { id: 'key', code: 'word', kind: 'word', visibility: 'word', needs_approval: 'flag' },
|