@adminiumjs/manifest 0.3.79 → 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.
Files changed (144) hide show
  1. package/dist/change-guards.d.ts +2 -0
  2. package/dist/change-guards.d.ts.map +1 -1
  3. package/dist/change-guards.js +7 -2
  4. package/dist/change-guards.js.map +1 -1
  5. package/dist/compose.d.ts.map +1 -1
  6. package/dist/compose.js +3 -0
  7. package/dist/compose.js.map +1 -1
  8. package/dist/expiry-notice.d.ts +68 -0
  9. package/dist/expiry-notice.d.ts.map +1 -0
  10. package/dist/expiry-notice.js +75 -0
  11. package/dist/expiry-notice.js.map +1 -0
  12. package/dist/from-template.d.ts +52 -0
  13. package/dist/from-template.d.ts.map +1 -0
  14. package/dist/from-template.js +89 -0
  15. package/dist/from-template.js.map +1 -0
  16. package/dist/index.d.ts +10 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +10 -1
  19. package/dist/index.js.map +1 -1
  20. package/dist/instance.d.ts +2 -1
  21. package/dist/instance.d.ts.map +1 -1
  22. package/dist/instance.js +1 -0
  23. package/dist/instance.js.map +1 -1
  24. package/dist/leave/away.d.ts +67 -0
  25. package/dist/leave/away.d.ts.map +1 -0
  26. package/dist/leave/away.js +74 -0
  27. package/dist/leave/away.js.map +1 -0
  28. package/dist/leave/civil.d.ts +35 -0
  29. package/dist/leave/civil.d.ts.map +1 -0
  30. package/dist/leave/civil.js +75 -0
  31. package/dist/leave/civil.js.map +1 -0
  32. package/dist/leave/close-line.d.ts +91 -0
  33. package/dist/leave/close-line.d.ts.map +1 -0
  34. package/dist/leave/close-line.js +90 -0
  35. package/dist/leave/close-line.js.map +1 -0
  36. package/dist/leave/count.d.ts +82 -0
  37. package/dist/leave/count.d.ts.map +1 -0
  38. package/dist/leave/count.js +129 -0
  39. package/dist/leave/count.js.map +1 -0
  40. package/dist/leave/deciders.d.ts +81 -0
  41. package/dist/leave/deciders.d.ts.map +1 -0
  42. package/dist/leave/deciders.js +158 -0
  43. package/dist/leave/deciders.js.map +1 -0
  44. package/dist/leave/earning-year.d.ts +34 -0
  45. package/dist/leave/earning-year.d.ts.map +1 -0
  46. package/dist/leave/earning-year.js +113 -0
  47. package/dist/leave/earning-year.js.map +1 -0
  48. package/dist/leave/entitlement.d.ts +104 -0
  49. package/dist/leave/entitlement.d.ts.map +1 -0
  50. package/dist/leave/entitlement.js +59 -0
  51. package/dist/leave/entitlement.js.map +1 -0
  52. package/dist/leave/floors.d.ts +33 -0
  53. package/dist/leave/floors.d.ts.map +1 -0
  54. package/dist/leave/floors.js +55 -0
  55. package/dist/leave/floors.js.map +1 -0
  56. package/dist/leave/index.d.ts +26 -0
  57. package/dist/leave/index.d.ts.map +1 -0
  58. package/dist/leave/index.js +27 -0
  59. package/dist/leave/index.js.map +1 -0
  60. package/dist/leave/notice-gate.d.ts +41 -0
  61. package/dist/leave/notice-gate.d.ts.map +1 -0
  62. package/dist/leave/notice-gate.js +27 -0
  63. package/dist/leave/notice-gate.js.map +1 -0
  64. package/dist/leave/preset-czechia.d.ts +10 -0
  65. package/dist/leave/preset-czechia.d.ts.map +1 -0
  66. package/dist/leave/preset-czechia.js +69 -0
  67. package/dist/leave/preset-czechia.js.map +1 -0
  68. package/dist/leave/preset-denmark.d.ts +24 -0
  69. package/dist/leave/preset-denmark.d.ts.map +1 -0
  70. package/dist/leave/preset-denmark.js +31 -0
  71. package/dist/leave/preset-denmark.js.map +1 -0
  72. package/dist/leave/preset-england-wales.d.ts +10 -0
  73. package/dist/leave/preset-england-wales.d.ts.map +1 -0
  74. package/dist/leave/preset-england-wales.js +67 -0
  75. package/dist/leave/preset-england-wales.js.map +1 -0
  76. package/dist/leave/preset-france.d.ts +30 -0
  77. package/dist/leave/preset-france.d.ts.map +1 -0
  78. package/dist/leave/preset-france.js +31 -0
  79. package/dist/leave/preset-france.js.map +1 -0
  80. package/dist/leave/preset-germany.d.ts +30 -0
  81. package/dist/leave/preset-germany.d.ts.map +1 -0
  82. package/dist/leave/preset-germany.js +92 -0
  83. package/dist/leave/preset-germany.js.map +1 -0
  84. package/dist/leave/preset-us.d.ts +8 -0
  85. package/dist/leave/preset-us.d.ts.map +1 -0
  86. package/dist/leave/preset-us.js +48 -0
  87. package/dist/leave/preset-us.js.map +1 -0
  88. package/dist/leave/replay.d.ts +126 -0
  89. package/dist/leave/replay.d.ts.map +1 -0
  90. package/dist/leave/replay.js +158 -0
  91. package/dist/leave/replay.js.map +1 -0
  92. package/dist/leave/state.d.ts +64 -0
  93. package/dist/leave/state.d.ts.map +1 -0
  94. package/dist/leave/state.js +74 -0
  95. package/dist/leave/state.js.map +1 -0
  96. package/dist/leave/told.d.ts +37 -0
  97. package/dist/leave/told.d.ts.map +1 -0
  98. package/dist/leave/told.js +32 -0
  99. package/dist/leave/told.js.map +1 -0
  100. package/dist/leave/units.d.ts +21 -0
  101. package/dist/leave/units.d.ts.map +1 -0
  102. package/dist/leave/units.js +21 -0
  103. package/dist/leave/units.js.map +1 -0
  104. package/dist/leave-shape.d.ts +326 -0
  105. package/dist/leave-shape.d.ts.map +1 -0
  106. package/dist/leave-shape.js +166 -0
  107. package/dist/leave-shape.js.map +1 -0
  108. package/dist/leave-word.d.ts +90 -0
  109. package/dist/leave-word.d.ts.map +1 -0
  110. package/dist/leave-word.js +255 -0
  111. package/dist/leave-word.js.map +1 -0
  112. package/dist/outbox.d.ts +2 -0
  113. package/dist/outbox.d.ts.map +1 -1
  114. package/dist/outbox.js +5 -0
  115. package/dist/outbox.js.map +1 -1
  116. package/dist/person-import.d.ts +98 -0
  117. package/dist/person-import.d.ts.map +1 -0
  118. package/dist/person-import.js +270 -0
  119. package/dist/person-import.js.map +1 -0
  120. package/dist/record-classes.d.ts +99 -0
  121. package/dist/record-classes.d.ts.map +1 -0
  122. package/dist/record-classes.js +123 -0
  123. package/dist/record-classes.js.map +1 -0
  124. package/dist/removal.d.ts +1 -0
  125. package/dist/removal.d.ts.map +1 -1
  126. package/dist/removal.js +2 -0
  127. package/dist/removal.js.map +1 -1
  128. package/dist/roles.d.ts +23 -1
  129. package/dist/roles.d.ts.map +1 -1
  130. package/dist/roles.js +34 -5
  131. package/dist/roles.js.map +1 -1
  132. package/dist/schema.d.ts +625 -0
  133. package/dist/schema.d.ts.map +1 -1
  134. package/dist/schema.js +134 -14
  135. package/dist/schema.js.map +1 -1
  136. package/dist/staff-accounts.d.ts +102 -0
  137. package/dist/staff-accounts.d.ts.map +1 -0
  138. package/dist/staff-accounts.js +179 -0
  139. package/dist/staff-accounts.js.map +1 -0
  140. package/dist/words.d.ts +1 -1
  141. package/dist/words.d.ts.map +1 -1
  142. package/dist/words.js +85 -0
  143. package/dist/words.js.map +1 -1
  144. package/package.json +2 -2
@@ -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,CAAC;AAE5I,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAapD,MAAM,MAAM,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAU,CAAC;AACnJ,MAAM,GAAG,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AACtE,MAAM,UAAU,GAAG,CAAC,IAAY,EAAE,KAAa,EAAY,EAAE,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK,CA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AAI,EAAE,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;KACjH,CAAC;AACJ,CAAC"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * What a person is granted for a year, as the lots a policy would post. Each
3
+ * lot is rounded ONCE: rounding per month is how 2.08 × 12 becomes 24.96.
4
+ *
5
+ * A year with a change of terms gives each term its share. When every term
6
+ * runs from the first of a month to the last of one, the share is whole
7
+ * months; otherwise it is calendar days, so a change in mid-month never loses
8
+ * that month to both sides.
9
+ */
10
+ import { type CivilDay } from './civil.js';
11
+ /** A share of full time, in thousandths (600 is three days of five). */
12
+ export interface EntitlementTerm {
13
+ from: CivilDay;
14
+ to: CivilDay | null;
15
+ share: number;
16
+ }
17
+ export interface EntitlementPerson {
18
+ started: CivilDay;
19
+ lastDay?: CivilDay | null | undefined;
20
+ terms: readonly EntitlementTerm[];
21
+ }
22
+ /** A lot earned as the year goes: one lot, rounded once, usable a period at a time. */
23
+ export interface EarnRule {
24
+ every: 'month';
25
+ from: CivilDay;
26
+ to: CivilDay;
27
+ }
28
+ export interface LotPlan {
29
+ kind: 'grant';
30
+ tier: 'statutory' | 'extra' | null;
31
+ usableFrom: CivilDay;
32
+ expiresOn: CivilDay | null;
33
+ amount: number;
34
+ rule: string;
35
+ earn?: EarnRule;
36
+ /** The location's public holidays on this person's days come out of this lot. */
37
+ holidaysWithin?: true;
38
+ }
39
+ /** One term's part of a year, and the fraction of the year it is. */
40
+ export interface TermPart {
41
+ from: CivilDay;
42
+ to: CivilDay;
43
+ share: number;
44
+ numerator: number;
45
+ denominator: number;
46
+ }
47
+ /** The person's terms inside a year, cut to when they work here. */
48
+ export declare function termsInYear(person: EntitlementPerson, year: number): {
49
+ from: CivilDay;
50
+ to: CivilDay;
51
+ share: number;
52
+ }[];
53
+ /** Each term's fraction of the year: whole months when the terms fall on month ends, else calendar days. */
54
+ export declare function termFractions(parts: readonly {
55
+ from: CivilDay;
56
+ to: CivilDay;
57
+ share: number;
58
+ }[], year: number): TermPart[];
59
+ /**
60
+ * How much of a lot is earned by the end of a day: a share for each whole
61
+ * period gone, rounded down, and the last period is exactly the whole lot. A
62
+ * lot with no rule is earned in full.
63
+ */
64
+ export declare function earnedBy(lot: {
65
+ amount: number;
66
+ earn?: EarnRule | null | undefined;
67
+ }, day: CivilDay): number;
68
+ /**
69
+ * A figure a preset starts with that no law sets. The setup screen shows it as
70
+ * a default for HR to confirm, never as a legal figure.
71
+ */
72
+ export interface PresetDefault {
73
+ field: string;
74
+ value: number;
75
+ isDefault: true;
76
+ legalFigure: false;
77
+ confirmBy: 'hr';
78
+ }
79
+ /** What a country's starting rules say beyond the lots. */
80
+ export interface LeavePreset {
81
+ key: string;
82
+ /** The figures still at their default, for the setup screen. */
83
+ defaults: readonly PresetDefault[];
84
+ /** How many days ahead a notice must go for days to lapse. */
85
+ minNoticeDays: number;
86
+ /** How long after a notice is sent it counts as read, when nobody saw it. */
87
+ graceDays: number;
88
+ /** What carries over without a reason, and to which month and day of the next year. */
89
+ carry: {
90
+ units: number | null;
91
+ until: string;
92
+ } | null;
93
+ /** How many months after the leave year a held lot goes to HR's list. Check with your adviser. */
94
+ holdLimitMonths: number | null;
95
+ /** Whether public holidays on this share of full time come out of the allowance. */
96
+ holidaysWithin: (share: number) => boolean;
97
+ lotsFor: (person: EntitlementPerson, year: number) => LotPlan[];
98
+ /** What the preset does not model, in plain words, for the setup screen and the adviser. */
99
+ limits?: readonly string[];
100
+ }
101
+ export declare const totalOf: (lots: readonly LotPlan[]) => number;
102
+ /** A proportion of a figure, rounded up once. */
103
+ export declare const shareOf: (base: number, part: Pick<TermPart, "numerator" | "denominator">) => number;
104
+ //# sourceMappingURL=entitlement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entitlement.d.ts","sourceRoot":"","sources":["../../src/leave/entitlement.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,OAA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CAC5B;AAED,eAAO,MAAM,OAAO,GAAI,MAAM,SAAS,OAAO,EAAE,KAAG,MAAwD,CAAC;AAE5G,iDAAiD;AACjD,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,EAAE,MAAM,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,aAAa,CAAC,KAAG,MAAyG,CAAC"}
@@ -0,0 +1,59 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * What a person is granted for a year, as the lots a policy would post. Each
4
+ * lot is rounded ONCE: rounding per month is how 2.08 × 12 becomes 24.96.
5
+ *
6
+ * A year with a change of terms gives each term its share. When every term
7
+ * runs from the first of a month to the last of one, the share is whole
8
+ * months; otherwise it is calendar days, so a change in mid-month never loses
9
+ * that month to both sides.
10
+ */
11
+ import { addDays, addMonths, daysBetween, daysInYear, earlierDay, fullMonths, isFirstOfMonth, isLastOfMonth, laterDay, yearEnd, yearStart } from './civil.js';
12
+ import { ceilDiv, floorDiv } from './units.js';
13
+ /** The person's terms inside a year, cut to when they work here. */
14
+ export function termsInYear(person, year) {
15
+ const first = laterDay(person.started, yearStart(year));
16
+ const last = person.lastDay === undefined || person.lastDay === null ? yearEnd(year) : earlierDay(person.lastDay, yearEnd(year));
17
+ const out = [];
18
+ for (const term of person.terms) {
19
+ const from = laterDay(term.from, first);
20
+ const to = term.to === null ? last : earlierDay(term.to, last);
21
+ if (from <= to)
22
+ out.push({ from, to, share: term.share });
23
+ }
24
+ return out.sort((a, b) => (a.from < b.from ? -1 : 1));
25
+ }
26
+ /** Each term's fraction of the year: whole months when the terms fall on month ends, else calendar days. */
27
+ export function termFractions(parts, year) {
28
+ const onMonths = parts.every((part) => isFirstOfMonth(part.from) && isLastOfMonth(part.to));
29
+ return parts.map((part) => (onMonths ? { ...part, numerator: fullMonths(part.from, part.to), denominator: 12 } : { ...part, numerator: daysBetween(part.from, part.to) + 1, denominator: daysInYear(year) }));
30
+ }
31
+ const periodsOf = (earn) => {
32
+ for (let count = 1; count <= 1200; count += 1)
33
+ if (addDays(addMonths(earn.from, count), -1) >= earn.to)
34
+ return count;
35
+ return 1200;
36
+ };
37
+ /**
38
+ * How much of a lot is earned by the end of a day: a share for each whole
39
+ * period gone, rounded down, and the last period is exactly the whole lot. A
40
+ * lot with no rule is earned in full.
41
+ */
42
+ export function earnedBy(lot, day) {
43
+ const earn = lot.earn;
44
+ if (earn === undefined || earn === null)
45
+ return lot.amount;
46
+ if (day < earn.from)
47
+ return 0;
48
+ if (day >= earn.to)
49
+ return lot.amount;
50
+ const periods = periodsOf(earn);
51
+ let gone = 0;
52
+ while (gone < periods && addDays(addMonths(earn.from, gone + 1), -1) <= day)
53
+ gone += 1;
54
+ return gone >= periods ? lot.amount : floorDiv(lot.amount * gone, periods);
55
+ }
56
+ export const totalOf = (lots) => lots.reduce((sum, lot) => sum + lot.amount, 0);
57
+ /** A proportion of a figure, rounded up once. */
58
+ export const shareOf = (base, part) => (part.numerator === part.denominator ? base : ceilDiv(base * part.numerator, part.denominator));
59
+ //# sourceMappingURL=entitlement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entitlement.js","sourceRoot":"","sources":["../../src/leave/entitlement.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;GAQG;AACH,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAiB,MAAM,YAAY,CAAC;AAC7K,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AA2C/C,oEAAoE;AACpE,MAAM,UAAU,WAAW,CAAC,MAAyB,EAAE,IAAY;IACjE,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,MAAM,IAAI,GAAG,MAAM,CAAC,OAAO,KAAK,SAAS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O,IAAI,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;AAC7E,CAAC;AAkCD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAwB,EAAU,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAE5G,iDAAiD;AACjD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAE,IAAiD,EAAU,EAAE,CAAC,CAAC,IAAI,CAAC,SAAS,KAAK,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The fewest days a year a country's law allows, against which a policy's own
3
+ * figure (`days_per_year`, a full-time year of five working days) is held. A
4
+ * preset takes the policy's figure as the contractual allowance and never
5
+ * goes below this; a lower figure is refused with the reason below.
6
+ *
7
+ * - England and Wales: 5.6 weeks, 28 days on five days a week, bank holidays
8
+ * included (a part-timer's share of it pro rata). The preset gives full
9
+ * timers the 8 bank holidays on top of the rest, so the default 33 is
10
+ * "25 days plus bank holidays".
11
+ * - Germany (BUrlG section 3): 24 working days on a six-day week, which is
12
+ * 20 on five; public holidays are never counted. The default 28 is 20
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.
20
+ *
21
+ * The United States has no federal minimum.
22
+ */
23
+ export interface StatutoryFloor {
24
+ /** The fewest days a year on five days a week. */
25
+ days: number;
26
+ /** Why a lower figure is refused, in plain words. */
27
+ reason: string;
28
+ }
29
+ /** The floor of a preset, or null when its country has none. */
30
+ export declare const statutoryFloorOf: (preset: string | null) => StatutoryFloor | null;
31
+ /** Why a policy's days a year are below its country's floor, or null when they are not (or no figure is given). */
32
+ export declare function belowStatutoryFloor(preset: string | null, daysPerYear: number | null): string | null;
33
+ //# sourceMappingURL=floors.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,55 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * The fewest days a year a country's law allows, against which a policy's own
4
+ * figure (`days_per_year`, a full-time year of five working days) is held. A
5
+ * preset takes the policy's figure as the contractual allowance and never
6
+ * goes below this; a lower figure is refused with the reason below.
7
+ *
8
+ * - England and Wales: 5.6 weeks, 28 days on five days a week, bank holidays
9
+ * included (a part-timer's share of it pro rata). The preset gives full
10
+ * timers the 8 bank holidays on top of the rest, so the default 33 is
11
+ * "25 days plus bank holidays".
12
+ * - Germany (BUrlG section 3): 24 working days on a six-day week, which is
13
+ * 20 on five; public holidays are never counted. The default 28 is 20
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.
21
+ *
22
+ * The United States has no federal minimum.
23
+ */
24
+ const FLOORS = {
25
+ 'england-wales': {
26
+ days: 28,
27
+ reason: 'England and Wales give at least 5.6 weeks a year: 28 days on five days a week, bank holidays included. Count the bank holidays in the figure (25 days plus bank holidays is 33).',
28
+ },
29
+ germany: {
30
+ days: 20,
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.',
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
+ },
45
+ };
46
+ /** The floor of a preset, or null when its country has none. */
47
+ export const statutoryFloorOf = (preset) => (preset === null ? null : (FLOORS[preset] ?? null));
48
+ /** Why a policy's days a year are below its country's floor, or null when they are not (or no figure is given). */
49
+ export function belowStatutoryFloor(preset, daysPerYear) {
50
+ const floor = statutoryFloorOf(preset);
51
+ if (floor === null || daysPerYear === null)
52
+ return null;
53
+ return daysPerYear < floor.days ? floor.reason : null;
54
+ }
55
+ //# sourceMappingURL=floors.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The pure leave core: no zod, no I/O, and no import but its own files and
3
+ * `../leave-shape.js`, so an app can vendor it and its demo can never disagree
4
+ * with the engine. Flat on purpose: the app's sync copies `leave/*.ts`.
5
+ */
6
+ export * from '../leave-shape.js';
7
+ export * from './units.js';
8
+ export * from './civil.js';
9
+ export * from './count.js';
10
+ export * from './entitlement.js';
11
+ export { englandWales, englandWalesWith, ENGLAND_WALES_DEFAULT_DAYS, ENGLAND_WALES_LIMITS } from './preset-england-wales.js';
12
+ export { germany, germanyWith, germanEntitlement, GERMANY_DEFAULT_DAYS, GERMANY_LIMITS, holdLimitDay } from './preset-germany.js';
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';
18
+ export { unitedStates, US_DEFAULT_DAYS, US_LIMITS } from './preset-us.js';
19
+ export * from './replay.js';
20
+ export * from './state.js';
21
+ export * from './deciders.js';
22
+ export * from './told.js';
23
+ export * from './away.js';
24
+ export * from './notice-gate.js';
25
+ export * from './close-line.js';
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC7H,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClI,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjG,OAAO,EAAE,OAAO,EAAE,WAAW,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"}
@@ -0,0 +1,27 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * The pure leave core: no zod, no I/O, and no import but its own files and
4
+ * `../leave-shape.js`, so an app can vendor it and its demo can never disagree
5
+ * with the engine. Flat on purpose: the app's sync copies `leave/*.ts`.
6
+ */
7
+ export * from '../leave-shape.js';
8
+ export * from './units.js';
9
+ export * from './civil.js';
10
+ export * from './count.js';
11
+ export * from './entitlement.js';
12
+ export { englandWales, englandWalesWith, ENGLAND_WALES_DEFAULT_DAYS, ENGLAND_WALES_LIMITS } from './preset-england-wales.js';
13
+ export { germany, germanyWith, germanEntitlement, GERMANY_DEFAULT_DAYS, GERMANY_LIMITS, holdLimitDay } from './preset-germany.js';
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';
19
+ export { unitedStates, US_DEFAULT_DAYS, US_LIMITS } from './preset-us.js';
20
+ export * from './replay.js';
21
+ export * from './state.js';
22
+ export * from './deciders.js';
23
+ export * from './told.js';
24
+ export * from './away.js';
25
+ export * from './notice-gate.js';
26
+ export * from './close-line.js';
27
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC7H,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAClI,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACjG,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,41 @@
1
+ /**
2
+ * THE GATE: days lapse only on all four of these. A notice proved to have
3
+ * reached the person, sent in good time, with no sickness or protected leave
4
+ * since, and for no more than it said. Whatever the gate does not let lapse is
5
+ * held: it stays the person's, and is spent first.
6
+ */
7
+ import { type CivilDay } from './civil.js';
8
+ /** A notice as the gate reads it. `proved` is the mail proof's answer, never the outbox's `sent`. */
9
+ export interface GateNotice {
10
+ id: string;
11
+ /** The day it went, in the person's location; empty until it has. */
12
+ sentOn: CivilDay | null;
13
+ /** What it said may lapse at year end. */
14
+ atRisk: number;
15
+ /** What it said carries over, and may lapse at `carryUntil`. */
16
+ carryUnits: number;
17
+ carryUntil: CivilDay | null;
18
+ proved: boolean;
19
+ /** Why it is not proved, for the screen. */
20
+ missing?: string | null | undefined;
21
+ }
22
+ export type GateStage = 'year-end' | 'carry' | 'held';
23
+ export type GateWhy = 'ok' | 'no-notice' | 'not-proved' | 'late' | 'away';
24
+ export interface GateInput {
25
+ stage: GateStage;
26
+ notice: GateNotice | null;
27
+ /** The day these units expire. For a held lot, the day its fresh notice takes effect. */
28
+ expires: CivilDay;
29
+ atRiskNow: number;
30
+ minNoticeDays: number;
31
+ /** Sickness or protected leave since the notice. */
32
+ away: boolean;
33
+ }
34
+ export interface GateAnswer {
35
+ lapse: number;
36
+ held: number;
37
+ why: GateWhy;
38
+ }
39
+ /** How much of what is at risk lapses, and why the rest does not. */
40
+ export declare function lapseGate(input: GateInput): GateAnswer;
41
+ //# sourceMappingURL=notice-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice-gate.d.ts","sourceRoot":"","sources":["../../src/leave/notice-gate.ts"],"names":[],"mappings":"AACA;;;;;GAKG;AACH,OAAO,EAAW,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEpD,qGAAqG;AACrG,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,qEAAqE;IACrE,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;IACxB,0CAA0C;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,MAAM,SAAS,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AACtD,MAAM,MAAM,OAAO,GAAG,IAAI,GAAG,WAAW,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE1E,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,yFAAyF;IACzF,OAAO,EAAE,QAAQ,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,OAAO,CAAC;CACd;AAED,qEAAqE;AACrE,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAWtD"}
@@ -0,0 +1,27 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * THE GATE: days lapse only on all four of these. A notice proved to have
4
+ * reached the person, sent in good time, with no sickness or protected leave
5
+ * since, and for no more than it said. Whatever the gate does not let lapse is
6
+ * held: it stays the person's, and is spent first.
7
+ */
8
+ import { addDays } from './civil.js';
9
+ /** How much of what is at risk lapses, and why the rest does not. */
10
+ export function lapseGate(input) {
11
+ const { notice, atRiskNow } = input;
12
+ const keep = (why) => ({ lapse: 0, held: atRiskNow, why });
13
+ if (atRiskNow <= 0)
14
+ return { lapse: 0, held: 0, why: 'ok' };
15
+ if (input.away)
16
+ return keep('away');
17
+ if (notice === null || notice.sentOn === null)
18
+ return keep('no-notice');
19
+ if (!notice.proved)
20
+ return keep('not-proved');
21
+ if (notice.sentOn > addDays(input.expires, -input.minNoticeDays))
22
+ return keep('late');
23
+ const said = input.stage === 'carry' ? notice.carryUnits : notice.atRisk;
24
+ const lapse = Math.min(atRiskNow, Math.max(said, 0));
25
+ return { lapse, held: atRiskNow - lapse, why: 'ok' };
26
+ }
27
+ //# sourceMappingURL=notice-gate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice-gate.js","sourceRoot":"","sources":["../../src/leave/notice-gate.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;GAKG;AACH,OAAO,EAAE,OAAO,EAAiB,MAAM,YAAY,CAAC;AAqCpD,qEAAqE;AACrE,MAAM,UAAU,SAAS,CAAC,KAAgB;IACxC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACpC,MAAM,IAAI,GAAG,CAAC,GAAY,EAAc,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;IAChF,IAAI,SAAS,IAAI,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;IAC5D,IAAI,KAAK,CAAC,IAAI;QAAE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;IACpC,IAAI,MAAM,KAAK,IAAI,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC;IACxE,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,IAAI,MAAM,CAAC,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;QAAE,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC;IACtF,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;IACzE,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IACrD,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;AACvD,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,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AS;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,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE;QACtC,eAAe,EAAE,IAAI;QACrB,cAAc,EAAE,GAAG,EAAE,CAAC,KAAK;QAC3B,OAAO,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC;QACvD,MAAM,EAAE,cAAc;KACvB,CAAC;AACJ,CAAC,CAAC;AAEF,6BAA6B;AAC7B,MAAM,CAAC,MAAM,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,10 @@
1
+ import { type LeavePreset } from './entitlement.js';
2
+ /** The days a year, bank holidays included, when a policy names none. */
3
+ export declare const ENGLAND_WALES_DEFAULT_DAYS = 33;
4
+ /** What this preset does not do, for the setup screen and the adviser. */
5
+ export declare const ENGLAND_WALES_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 englandWalesWith: (confirmed?: number | null) => LeavePreset;
8
+ /** On the default figure. */
9
+ export declare const englandWales: LeavePreset;
10
+ //# sourceMappingURL=preset-england-wales.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preset-england-wales.d.ts","sourceRoot":"","sources":["../../src/leave/preset-england-wales.ts"],"names":[],"mappings":"AAcA,OAAO,EAAgD,KAAK,WAAW,EAAgB,MAAM,kBAAkB,CAAC;AAGhH,yEAAyE;AACzE,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAyB7C,0EAA0E;AAC1E,eAAO,MAAM,oBAAoB,EAAE,SAAS,MAAM,EAQjD,CAAC;AAEF,mJAAmJ;AACnJ,eAAO,MAAM,gBAAgB,GAAI,YAAY,MAAM,GAAG,IAAI,KAAG,WAa5D,CAAC;AAEF,6BAA6B;AAC7B,eAAO,MAAM,YAAY,EAAE,WAAoC,CAAC"}