@futdevpro/fsm-dynamo 1.20.185 → 1.20.186

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.
@@ -0,0 +1,83 @@
1
+ import { DyFM_HuHoliday } from '../../_models/interfaces/hu-holiday.interface';
2
+ /**
3
+ * BFR-CREDIT-144 — the Hungarian public-holiday calendar, shared by every FDP product
4
+ * (withdrawal deadlines, working-day counters, morning packages).
5
+ *
6
+ * Source: Act I of 2012 (Mt.) 102. § (1). Year gates:
7
+ * - Good Friday is a public holiday from 2017 (`goodFridaySince`);
8
+ * - December 24 is a public holiday from 2026 (`christmasEveSince`, T/714, passed 2026-11-03).
9
+ *
10
+ * Easter Sunday and Whit Sunday fall on a Sunday, so they are not listed.
11
+ * The ministerial working-day swaps (a Saturday worked for a bridge day) are NOT applied:
12
+ * `isWorkingDay` is "a weekday that is not a public holiday".
13
+ *
14
+ * Every day is a `YYYY-MM-DD` string, read as a calendar day (no time zone involved).
15
+ * The util is pure, it keeps no state and no cache.
16
+ *
17
+ * @example
18
+ * DyFM_HuCalendar_Util.isWorkingDay('2026-12-24'); // false (from 2026)
19
+ * DyFM_HuCalendar_Util.workingDayOnOrAfter('2026-12-24'); // '2026-12-28'
20
+ */
21
+ export declare class DyFM_HuCalendar_Util {
22
+ /** The first year in which Good Friday is a public holiday. */
23
+ static readonly goodFridaySince: number;
24
+ /** The first year in which December 24 is a public holiday. */
25
+ static readonly christmasEveSince: number;
26
+ /**
27
+ * The public holidays of a year, with their Hungarian names, in calendar order.
28
+ * @param year the calendar year (e.g. `2026`)
29
+ * @returns the holidays of the year, sorted by day
30
+ */
31
+ static namedHolidaysOf(year: number): DyFM_HuHoliday[];
32
+ /**
33
+ * The public holidays of a year, as sorted `YYYY-MM-DD` days.
34
+ * @param year the calendar year (e.g. `2026`)
35
+ * @returns the days of the year's public holidays
36
+ */
37
+ static holidaysOf(year: number): string[];
38
+ /**
39
+ * Whether the day is a Hungarian public holiday.
40
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
41
+ */
42
+ static isHoliday(day: string): boolean;
43
+ /**
44
+ * Whether the day is a working day: Monday to Friday, and not a public holiday.
45
+ * The working-day swaps are not applied.
46
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
47
+ */
48
+ static isWorkingDay(day: string): boolean;
49
+ /**
50
+ * The day itself if it is a working day, otherwise the first working day after it
51
+ * (e.g. a deadline that ends on a non-working day moves to the next working day).
52
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
53
+ */
54
+ static workingDayOnOrAfter(day: string): string;
55
+ /**
56
+ * The first working day strictly after the day.
57
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
58
+ */
59
+ static nextWorkingDay(day: string): string;
60
+ /**
61
+ * Easter Sunday of a year (Gregorian calendar).
62
+ * @param year the calendar year (e.g. `2026`)
63
+ * @returns the `YYYY-MM-DD` day of Easter Sunday
64
+ */
65
+ static easterSunday(year: number): string;
66
+ /**
67
+ * Easter Sunday as a UTC midnight timestamp — the anonymous Gregorian algorithm (Meeus/Jones/Butcher).
68
+ * @param year the calendar year
69
+ */
70
+ private static easterSundayMs;
71
+ /**
72
+ * A strict `YYYY-MM-DD` day as a UTC midnight timestamp.
73
+ * @param day the day to read
74
+ * @throws Error if the text is not `YYYY-MM-DD` or the day does not exist (e.g. `2026-02-30`)
75
+ */
76
+ private static parse;
77
+ /**
78
+ * A UTC midnight timestamp as a `YYYY-MM-DD` day.
79
+ * @param ms the timestamp
80
+ */
81
+ private static iso;
82
+ }
83
+ //# sourceMappingURL=hu-calendar.util.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hu-calendar.util.d.ts","sourceRoot":"","sources":["../../../src/_collections/utils/hu-calendar.util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAK/E;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,oBAAoB;IAC/B,+DAA+D;IAC/D,MAAM,CAAC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAQ;IAC/C,+DAA+D;IAC/D,MAAM,CAAC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAQ;IAEjD;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,EAAE;IA6BtD;;;;OAIG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE;IAIzC;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAMtC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAUzC;;;;OAIG;IACH,MAAM,CAAC,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAW/C;;;OAGG;IACH,MAAM,CAAC,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAI1C;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAIzC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAmB7B;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,KAAK;IAiBpB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,GAAG;CAGnB"}
@@ -0,0 +1,163 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DyFM_HuCalendar_Util = void 0;
4
+ /** One day in milliseconds. */
5
+ const dayMs = 24 * 60 * 60 * 1000;
6
+ /**
7
+ * BFR-CREDIT-144 — the Hungarian public-holiday calendar, shared by every FDP product
8
+ * (withdrawal deadlines, working-day counters, morning packages).
9
+ *
10
+ * Source: Act I of 2012 (Mt.) 102. § (1). Year gates:
11
+ * - Good Friday is a public holiday from 2017 (`goodFridaySince`);
12
+ * - December 24 is a public holiday from 2026 (`christmasEveSince`, T/714, passed 2026-11-03).
13
+ *
14
+ * Easter Sunday and Whit Sunday fall on a Sunday, so they are not listed.
15
+ * The ministerial working-day swaps (a Saturday worked for a bridge day) are NOT applied:
16
+ * `isWorkingDay` is "a weekday that is not a public holiday".
17
+ *
18
+ * Every day is a `YYYY-MM-DD` string, read as a calendar day (no time zone involved).
19
+ * The util is pure, it keeps no state and no cache.
20
+ *
21
+ * @example
22
+ * DyFM_HuCalendar_Util.isWorkingDay('2026-12-24'); // false (from 2026)
23
+ * DyFM_HuCalendar_Util.workingDayOnOrAfter('2026-12-24'); // '2026-12-28'
24
+ */
25
+ class DyFM_HuCalendar_Util {
26
+ /** The first year in which Good Friday is a public holiday. */
27
+ static goodFridaySince = 2017;
28
+ /** The first year in which December 24 is a public holiday. */
29
+ static christmasEveSince = 2026;
30
+ /**
31
+ * The public holidays of a year, with their Hungarian names, in calendar order.
32
+ * @param year the calendar year (e.g. `2026`)
33
+ * @returns the holidays of the year, sorted by day
34
+ */
35
+ static namedHolidaysOf(year) {
36
+ // the Easter-bound days are offsets from Easter Sunday
37
+ const easterMs = this.easterSundayMs(year);
38
+ const holidays = [
39
+ { day: `${year}-01-01`, name: 'újév' },
40
+ { day: `${year}-03-15`, name: 'nemzeti ünnep (március 15.)' },
41
+ { day: this.iso(easterMs + dayMs), name: 'húsvéthétfő' },
42
+ { day: `${year}-05-01`, name: 'a munka ünnepe' },
43
+ { day: this.iso(easterMs + 50 * dayMs), name: 'pünkösdhétfő' },
44
+ { day: `${year}-08-20`, name: 'államalapítás ünnepe' },
45
+ { day: `${year}-10-23`, name: 'nemzeti ünnep (október 23.)' },
46
+ { day: `${year}-11-01`, name: 'mindenszentek' },
47
+ { day: `${year}-12-25`, name: 'karácsony' },
48
+ { day: `${year}-12-26`, name: 'karácsony másnapja' },
49
+ ];
50
+ // the days gated by year
51
+ if (year >= this.goodFridaySince) {
52
+ holidays.push({ day: this.iso(easterMs - 2 * dayMs), name: 'nagypéntek' });
53
+ }
54
+ if (year >= this.christmasEveSince) {
55
+ holidays.push({ day: `${year}-12-24`, name: 'szenteste (december 24.)' });
56
+ }
57
+ // `YYYY-MM-DD` sorts in calendar order as text too
58
+ return holidays.sort((a, b) => a.day.localeCompare(b.day));
59
+ }
60
+ /**
61
+ * The public holidays of a year, as sorted `YYYY-MM-DD` days.
62
+ * @param year the calendar year (e.g. `2026`)
63
+ * @returns the days of the year's public holidays
64
+ */
65
+ static holidaysOf(year) {
66
+ return this.namedHolidaysOf(year).map((holiday) => holiday.day);
67
+ }
68
+ /**
69
+ * Whether the day is a Hungarian public holiday.
70
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
71
+ */
72
+ static isHoliday(day) {
73
+ const ms = this.parse(day);
74
+ return this.holidaysOf(new Date(ms).getUTCFullYear()).includes(day);
75
+ }
76
+ /**
77
+ * Whether the day is a working day: Monday to Friday, and not a public holiday.
78
+ * The working-day swaps are not applied.
79
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
80
+ */
81
+ static isWorkingDay(day) {
82
+ const weekDay = new Date(this.parse(day)).getUTCDay();
83
+ if (weekDay === 0 || weekDay === 6) {
84
+ return false;
85
+ }
86
+ return !this.isHoliday(day);
87
+ }
88
+ /**
89
+ * The day itself if it is a working day, otherwise the first working day after it
90
+ * (e.g. a deadline that ends on a non-working day moves to the next working day).
91
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
92
+ */
93
+ static workingDayOnOrAfter(day) {
94
+ // step forward day by day until a working day
95
+ let ms = this.parse(day);
96
+ while (!this.isWorkingDay(this.iso(ms))) {
97
+ ms += dayMs;
98
+ }
99
+ return this.iso(ms);
100
+ }
101
+ /**
102
+ * The first working day strictly after the day.
103
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
104
+ */
105
+ static nextWorkingDay(day) {
106
+ return this.workingDayOnOrAfter(this.iso(this.parse(day) + dayMs));
107
+ }
108
+ /**
109
+ * Easter Sunday of a year (Gregorian calendar).
110
+ * @param year the calendar year (e.g. `2026`)
111
+ * @returns the `YYYY-MM-DD` day of Easter Sunday
112
+ */
113
+ static easterSunday(year) {
114
+ return this.iso(this.easterSundayMs(year));
115
+ }
116
+ /**
117
+ * Easter Sunday as a UTC midnight timestamp — the anonymous Gregorian algorithm (Meeus/Jones/Butcher).
118
+ * @param year the calendar year
119
+ */
120
+ static easterSundayMs(year) {
121
+ const a = year % 19;
122
+ const b = Math.floor(year / 100);
123
+ const c = year % 100;
124
+ const d = Math.floor(b / 4);
125
+ const e = b % 4;
126
+ const f = Math.floor((b + 8) / 25);
127
+ const g = Math.floor((b - f + 1) / 3);
128
+ const h = (19 * a + b - d - g + 15) % 30;
129
+ const i = Math.floor(c / 4);
130
+ const k = c % 4;
131
+ const l = (32 + 2 * e + 2 * i - h - k) % 7;
132
+ const m = Math.floor((a + 11 * h + 22 * l) / 451);
133
+ const month = Math.floor((h + l - 7 * m + 114) / 31);
134
+ const dayOfMonth = ((h + l - 7 * m + 114) % 31) + 1;
135
+ return Date.UTC(year, month - 1, dayOfMonth);
136
+ }
137
+ /**
138
+ * A strict `YYYY-MM-DD` day as a UTC midnight timestamp.
139
+ * @param day the day to read
140
+ * @throws Error if the text is not `YYYY-MM-DD` or the day does not exist (e.g. `2026-02-30`)
141
+ */
142
+ static parse(day) {
143
+ const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(day);
144
+ if (!match) {
145
+ throw new Error(`DyFM_HuCalendar_Util: not a YYYY-MM-DD day: "${day}"`);
146
+ }
147
+ // Date.UTC rolls a nonexistent day over (02-30 => 03-02), so read it back to check
148
+ const ms = Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]));
149
+ if (this.iso(ms) !== day) {
150
+ throw new Error(`DyFM_HuCalendar_Util: no such day: "${day}"`);
151
+ }
152
+ return ms;
153
+ }
154
+ /**
155
+ * A UTC midnight timestamp as a `YYYY-MM-DD` day.
156
+ * @param ms the timestamp
157
+ */
158
+ static iso(ms) {
159
+ return new Date(ms).toISOString().slice(0, 10);
160
+ }
161
+ }
162
+ exports.DyFM_HuCalendar_Util = DyFM_HuCalendar_Util;
163
+ //# sourceMappingURL=hu-calendar.util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hu-calendar.util.js","sourceRoot":"","sources":["../../../src/_collections/utils/hu-calendar.util.ts"],"names":[],"mappings":";;;AAEA,+BAA+B;AAC/B,MAAM,KAAK,GAAW,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAa,oBAAoB;IAC/B,+DAA+D;IAC/D,MAAM,CAAU,eAAe,GAAW,IAAI,CAAC;IAC/C,+DAA+D;IAC/D,MAAM,CAAU,iBAAiB,GAAW,IAAI,CAAC;IAEjD;;;;OAIG;IACH,MAAM,CAAC,eAAe,CAAC,IAAY;QACjC,uDAAuD;QACvD,MAAM,QAAQ,GAAW,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;QACnD,MAAM,QAAQ,GAAqB;YACjC,EAAE,GAAG,EAAE,GAAG,IAAI,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE;YACtC,EAAE,GAAG,EAAE,GAAG,IAAI,QAAQ,EAAE,IAAI,EAAE,6BAA6B,EAAE;YAC7D,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE;YACxD,EAAE,GAAG,EAAE,GAAG,IAAI,QAAQ,EAAE,IAAI,EAAE,gBAAgB,EAAE;YAChD,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,QAAQ,GAAG,EAAE,GAAG,KAAK,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE;YAC9D,EAAE,GAAG,EAAE,GAAG,IAAI,QAAQ,EAAE,IAAI,EAAE,sBAAsB,EAAE;YACtD,EAAE,GAAG,EAAE,GAAG,IAAI,QAAQ,EAAE,IAAI,EAAE,6BAA6B,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AI,EAAE,KAAK,GAAG,CAAC,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,KAAK,CAAC,GAAW;QAC9B,MAAM,KAAK,GAA2B,2BAA2B,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAE5E,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,MAAM,IAAI,KAAK,CAAC,gDAAgD,GAAG,GAAG,CAAC,CAAC;QAC1E,CAAC;QAED,mFAAmF;QACnF,MAAM,EAAE,GAAW,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAEtF,IAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,KAAK,GAAG,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,uCAAuC,GAAG,GAAG,CAAC,CAAC;QACjE,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,GAAG,CAAC,EAAU;QAC3B,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IACjD,CAAC;;AA9JH,oDA+JC"}
@@ -0,0 +1,8 @@
1
+ /** BFR-CREDIT-144 — one Hungarian public holiday (`DyFM_HuCalendar_Util.namedHolidaysOf`). */
2
+ export interface DyFM_HuHoliday {
3
+ /** The calendar day, `YYYY-MM-DD`. */
4
+ day: string;
5
+ /** Its Hungarian name (e.g. `nagypéntek`). */
6
+ name: string;
7
+ }
8
+ //# sourceMappingURL=hu-holiday.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hu-holiday.interface.d.ts","sourceRoot":"","sources":["../../../src/_models/interfaces/hu-holiday.interface.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=hu-holiday.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hu-holiday.interface.js","sourceRoot":"","sources":["../../../src/_models/interfaces/hu-holiday.interface.ts"],"names":[],"mappings":""}
package/build/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export * from './_collections/utils/log.util';
12
12
  export * from './_collections/utils/round-list.util';
13
13
  export * from './_collections/utils/secret-mask.util';
14
14
  export * from './_collections/utils/doc-only-path.util';
15
+ export * from './_collections/utils/hu-calendar.util';
15
16
  export * from './_collections/utils/object.util';
16
17
  export * from './_collections/utils/require-env.util';
17
18
  export * from './_collections/utils/stack.util';
@@ -73,6 +74,7 @@ export * from './_models/data-models/errors.data-model';
73
74
  export * from './_models/data-models/metadata.data-model';
74
75
  export * from './_models/interfaces/box-bounds.interface';
75
76
  export * from './_models/interfaces/error-defaults.interface';
77
+ export * from './_models/interfaces/hu-holiday.interface';
76
78
  export * from './_models/interfaces/public-error-body.interface';
77
79
  export * from './_models/interfaces/operation-authz-result.interface';
78
80
  export * from './_models/interfaces/operation-authz.interface';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,wCAAwC,CAAC;AACvD,cAAc,sCAAsC,CAAC;AAGrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iDAAiD,CAAC;AAChE,cAA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C;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,6CAA6C,CAAC;AAC5D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wDAAwD,CAAC;AACvE,cAAc,wCAAwC,CAAC;AAGvD,cAAc,gEAAgE,CAAC;AAC/E,cAAc,4DAA4D,CAAC;AAG3E,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC"}
package/build/index.js CHANGED
@@ -18,6 +18,7 @@ tslib_1.__exportStar(require("./_collections/utils/log.util"), exports);
18
18
  tslib_1.__exportStar(require("./_collections/utils/round-list.util"), exports);
19
19
  tslib_1.__exportStar(require("./_collections/utils/secret-mask.util"), exports);
20
20
  tslib_1.__exportStar(require("./_collections/utils/doc-only-path.util"), exports);
21
+ tslib_1.__exportStar(require("./_collections/utils/hu-calendar.util"), exports);
21
22
  tslib_1.__exportStar(require("./_collections/utils/object.util"), exports);
22
23
  tslib_1.__exportStar(require("./_collections/utils/require-env.util"), exports);
23
24
  tslib_1.__exportStar(require("./_collections/utils/stack.util"), exports);
@@ -89,6 +90,7 @@ tslib_1.__exportStar(require("./_models/data-models/metadata.data-model"), expor
89
90
  // models/INTERFACES
90
91
  tslib_1.__exportStar(require("./_models/interfaces/box-bounds.interface"), exports);
91
92
  tslib_1.__exportStar(require("./_models/interfaces/error-defaults.interface"), exports);
93
+ tslib_1.__exportStar(require("./_models/interfaces/hu-holiday.interface"), exports);
92
94
  tslib_1.__exportStar(require("./_models/interfaces/public-error-body.interface"), exports);
93
95
  tslib_1.__exportStar(require("./_models/interfaces/operation-authz-result.interface"), exports);
94
96
  tslib_1.__exportStar(require("./_models/interfaces/operation-authz.interface"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,cAAc;AACd,wBAAwB;AACxB,oFAA0D;AAC1D,wFAA8D;AAC9D,yFAA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,gFAAsD;AACtD,mFAAyD;AACzD,iFAAuD;AAEvD,aAAa;AACb,4EAAkD;AAClD,6EAAmD;AACnD,gFAAsD;AAEtD,aAAa;AACb,yEAA+C;AAC/C,mEAAyC;AACzC,2EAAiD;AAGjD,SAAS;AACT,wBAAwB;AACxB,mGAAyE;AACzE,qGAA2E;AAC3E,sGAA4E;AAC5E,wGAA8E;AAC9E,uFAA6D;AAC7D,mGAAyE;AACzE,oGAA0E;AAC1E,sFAA4D;AAC5D,qFAA2D;AAC3D,yFAA+D;AAC/D,6FAAmE;AACnE,+FAAqE;AACrE,gHAAsF;AACtF,4GAAkF;AAElF,6BAA6B;AAC7B,0GAAgF;AAChF,mGAAyE;AACzE,iGAAuE;AAEvE,qBAAqB;AACrB,kFAAwD;AACxD,oFAA0D;AAE1D,oBAAoB;AACpB,oFAA0D;AAC1D,wFAA8D;AAC9D,oFAA0D;AAC1D,2FAAiE;AACjE,gGAAsE;AACtE,yFAA+D;AAC/D,8FAAoE;AACpE,4FAAkE;AAClE,8FAAoE;AACpE,+FAAqE;AACrE,mGAAyE;AACzE,kGAAwE;AACxE,+FAAqE;AACrE,gGAAsE;AACtE,+EAAqD;AACrD,uFAA6D;AAC7D,wFAA8D;AAC9D,sFAA4D;AAC5D,uFAA6D;AAC7D,iGAAuE;AACvE,iFAAuD;AAEvD,gCAAgC;AAChC,yGAA+E;AAC/E,qGAA2E;AAE3E,eAAe;AACf,yEAA+C;AAC/C,uEAA6C;AAC7C,yEAA+C;AAC/C,uEAA6C"}
@@ -0,0 +1,158 @@
1
+ /** One day in milliseconds. */
2
+ const dayMs = 24 * 60 * 60 * 1000;
3
+ /**
4
+ * BFR-CREDIT-144 — the Hungarian public-holiday calendar, shared by every FDP product
5
+ * (withdrawal deadlines, working-day counters, morning packages).
6
+ *
7
+ * Source: Act I of 2012 (Mt.) 102. § (1). Year gates:
8
+ * - Good Friday is a public holiday from 2017 (`goodFridaySince`);
9
+ * - December 24 is a public holiday from 2026 (`christmasEveSince`, T/714, passed 2026-11-03).
10
+ *
11
+ * Easter Sunday and Whit Sunday fall on a Sunday, so they are not listed.
12
+ * The ministerial working-day swaps (a Saturday worked for a bridge day) are NOT applied:
13
+ * `isWorkingDay` is "a weekday that is not a public holiday".
14
+ *
15
+ * Every day is a `YYYY-MM-DD` string, read as a calendar day (no time zone involved).
16
+ * The util is pure, it keeps no state and no cache.
17
+ *
18
+ * @example
19
+ * DyFM_HuCalendar_Util.isWorkingDay('2026-12-24'); // false (from 2026)
20
+ * DyFM_HuCalendar_Util.workingDayOnOrAfter('2026-12-24'); // '2026-12-28'
21
+ */
22
+ export class DyFM_HuCalendar_Util {
23
+ /** The first year in which Good Friday is a public holiday. */
24
+ static goodFridaySince = 2017;
25
+ /** The first year in which December 24 is a public holiday. */
26
+ static christmasEveSince = 2026;
27
+ /**
28
+ * The public holidays of a year, with their Hungarian names, in calendar order.
29
+ * @param year the calendar year (e.g. `2026`)
30
+ * @returns the holidays of the year, sorted by day
31
+ */
32
+ static namedHolidaysOf(year) {
33
+ // the Easter-bound days are offsets from Easter Sunday
34
+ const easterMs = this.easterSundayMs(year);
35
+ const holidays = [
36
+ { day: `${year}-01-01`, name: 'újév' },
37
+ { day: `${year}-03-15`, name: 'nemzeti ünnep (március 15.)' },
38
+ { day: this.iso(easterMs + dayMs), name: 'húsvéthétfő' },
39
+ { day: `${year}-05-01`, name: 'a munka ünnepe' },
40
+ { day: this.iso(easterMs + 50 * dayMs), name: 'pünkösdhétfő' },
41
+ { day: `${year}-08-20`, name: 'államalapítás ünnepe' },
42
+ { day: `${year}-10-23`, name: 'nemzeti ünnep (október 23.)' },
43
+ { day: `${year}-11-01`, name: 'mindenszentek' },
44
+ { day: `${year}-12-25`, name: 'karácsony' },
45
+ { day: `${year}-12-26`, name: 'karácsony másnapja' },
46
+ ];
47
+ // the days gated by year
48
+ if (year >= this.goodFridaySince) {
49
+ holidays.push({ day: this.iso(easterMs - 2 * dayMs), name: 'nagypéntek' });
50
+ }
51
+ if (year >= this.christmasEveSince) {
52
+ holidays.push({ day: `${year}-12-24`, name: 'szenteste (december 24.)' });
53
+ }
54
+ // `YYYY-MM-DD` sorts in calendar order as text too
55
+ return holidays.sort((a, b) => a.day.localeCompare(b.day));
56
+ }
57
+ /**
58
+ * The public holidays of a year, as sorted `YYYY-MM-DD` days.
59
+ * @param year the calendar year (e.g. `2026`)
60
+ * @returns the days of the year's public holidays
61
+ */
62
+ static holidaysOf(year) {
63
+ return this.namedHolidaysOf(year).map((holiday) => holiday.day);
64
+ }
65
+ /**
66
+ * Whether the day is a Hungarian public holiday.
67
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
68
+ */
69
+ static isHoliday(day) {
70
+ const ms = this.parse(day);
71
+ return this.holidaysOf(new Date(ms).getUTCFullYear()).includes(day);
72
+ }
73
+ /**
74
+ * Whether the day is a working day: Monday to Friday, and not a public holiday.
75
+ * The working-day swaps are not applied.
76
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
77
+ */
78
+ static isWorkingDay(day) {
79
+ const weekDay = new Date(this.parse(day)).getUTCDay();
80
+ if (weekDay === 0 || weekDay === 6) {
81
+ return false;
82
+ }
83
+ return !this.isHoliday(day);
84
+ }
85
+ /**
86
+ * The day itself if it is a working day, otherwise the first working day after it
87
+ * (e.g. a deadline that ends on a non-working day moves to the next working day).
88
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
89
+ */
90
+ static workingDayOnOrAfter(day) {
91
+ // step forward day by day until a working day
92
+ let ms = this.parse(day);
93
+ while (!this.isWorkingDay(this.iso(ms))) {
94
+ ms += dayMs;
95
+ }
96
+ return this.iso(ms);
97
+ }
98
+ /**
99
+ * The first working day strictly after the day.
100
+ * @param day a `YYYY-MM-DD` day; throws on an invalid or nonexistent day
101
+ */
102
+ static nextWorkingDay(day) {
103
+ return this.workingDayOnOrAfter(this.iso(this.parse(day) + dayMs));
104
+ }
105
+ /**
106
+ * Easter Sunday of a year (Gregorian calendar).
107
+ * @param year the calendar year (e.g. `2026`)
108
+ * @returns the `YYYY-MM-DD` day of Easter Sunday
109
+ */
110
+ static easterSunday(year) {
111
+ return this.iso(this.easterSundayMs(year));
112
+ }
113
+ /**
114
+ * Easter Sunday as a UTC midnight timestamp — the anonymous Gregorian algorithm (Meeus/Jones/Butcher).
115
+ * @param year the calendar year
116
+ */
117
+ static easterSundayMs(year) {
118
+ const a = year % 19;
119
+ const b = Math.floor(year / 100);
120
+ const c = year % 100;
121
+ const d = Math.floor(b / 4);
122
+ const e = b % 4;
123
+ const f = Math.floor((b + 8) / 25);
124
+ const g = Math.floor((b - f + 1) / 3);
125
+ const h = (19 * a + b - d - g + 15) % 30;
126
+ const i = Math.floor(c / 4);
127
+ const k = c % 4;
128
+ const l = (32 + 2 * e + 2 * i - h - k) % 7;
129
+ const m = Math.floor((a + 11 * h + 22 * l) / 451);
130
+ const month = Math.floor((h + l - 7 * m + 114) / 31);
131
+ const dayOfMonth = ((h + l - 7 * m + 114) % 31) + 1;
132
+ return Date.UTC(year, month - 1, dayOfMonth);
133
+ }
134
+ /**
135
+ * A strict `YYYY-MM-DD` day as a UTC midnight timestamp.
136
+ * @param day the day to read
137
+ * @throws Error if the text is not `YYYY-MM-DD` or the day does not exist (e.g. `2026-02-30`)
138
+ */
139
+ static parse(day) {
140
+ const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(day);
141
+ if (!match) {
142
+ throw new Error(`DyFM_HuCalendar_Util: not a YYYY-MM-DD day: "${day}"`);
143
+ }
144
+ // Date.UTC rolls a nonexistent day over (02-30 => 03-02), so read it back to check
145
+ const ms = Date.UTC(Number(match[1]), Number(match[2]) - 1, Number(match[3]));
146
+ if (this.iso(ms) !== day) {
147
+ throw new Error(`DyFM_HuCalendar_Util: no such day: "${day}"`);
148
+ }
149
+ return ms;
150
+ }
151
+ /**
152
+ * A UTC midnight timestamp as a `YYYY-MM-DD` day.
153
+ * @param ms the timestamp
154
+ */
155
+ static iso(ms) {
156
+ return new Date(ms).toISOString().slice(0, 10);
157
+ }
158
+ }
@@ -15,6 +15,7 @@ export * from './_collections/utils/log.util';
15
15
  export * from './_collections/utils/round-list.util';
16
16
  export * from './_collections/utils/secret-mask.util';
17
17
  export * from './_collections/utils/doc-only-path.util';
18
+ export * from './_collections/utils/hu-calendar.util';
18
19
  export * from './_collections/utils/object.util';
19
20
  export * from './_collections/utils/require-env.util';
20
21
  export * from './_collections/utils/stack.util';
@@ -86,6 +87,7 @@ export * from './_models/data-models/metadata.data-model';
86
87
  // models/INTERFACES
87
88
  export * from './_models/interfaces/box-bounds.interface';
88
89
  export * from './_models/interfaces/error-defaults.interface';
90
+ export * from './_models/interfaces/hu-holiday.interface';
89
91
  export * from './_models/interfaces/public-error-body.interface';
90
92
  export * from './_models/interfaces/operation-authz-result.interface';
91
93
  export * from './_models/interfaces/operation-authz.interface';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@futdevpro/fsm-dynamo",
3
- "version": "1.20.185",
3
+ "version": "1.20.186",
4
4
  "description": "Full Stack Model Collection for Dynamic (NodeJS-Typescript) Framework called Dynamo, by Future Development Ltd.",
5
5
  "DyBu_settings": {
6
6
  "packageType": "full-stack-package",