@socialgouv/modeles-social 4.120.0 → 4.121.0

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 (37) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bin/modeles/common/supported-agreements.js +1 -1
  3. package/bin/modeles/common/utils/__tests__/accumulate-absence-by-year.spec.js +1 -1
  4. package/bin/modeles/common/utils/seniority.js +17 -6
  5. package/bin/modeles/conventions/1527_immobilier/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  6. package/bin/modeles/conventions/176_industrie_pharmaceutique/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  7. package/bin/modeles/conventions/176_industrie_pharmaceutique/seniority.js +4 -1
  8. package/bin/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/formule.spec.js +486 -236
  9. package/bin/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/indemnite.spec.js +71 -30
  10. package/bin/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  11. package/bin/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/missing-args.spec.js +136 -0
  12. package/bin/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/references.spec.js +105 -46
  13. package/lib/modeles/common/supported-agreements.js +1 -1
  14. package/lib/modeles/common/utils/__tests__/accumulate-absence-by-year.spec.js +1 -1
  15. package/lib/modeles/common/utils/seniority.js +17 -6
  16. package/lib/modeles/conventions/1527_immobilier/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  17. package/lib/modeles/conventions/176_industrie_pharmaceutique/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  18. package/lib/modeles/conventions/176_industrie_pharmaceutique/seniority.js +4 -1
  19. package/lib/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/formule.spec.js +486 -236
  20. package/lib/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/indemnite.spec.js +71 -30
  21. package/lib/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  22. package/lib/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/missing-args.spec.js +136 -0
  23. package/lib/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/references.spec.js +105 -46
  24. package/lib/modeles/modeles-indemnite-licenciement.json +1040 -239
  25. package/package.json +2 -2
  26. package/src/modeles/base/indemnite-licenciement.yaml +2 -2
  27. package/src/modeles/common/supported-agreements.ts +1 -1
  28. package/src/modeles/common/utils/__tests__/accumulate-absence-by-year.spec.ts +1 -1
  29. package/src/modeles/common/utils/seniority.ts +25 -12
  30. package/src/modeles/conventions/1527_immobilier/__tests__/indemnite-licenciement/anciennete.spec.ts +2 -1
  31. package/src/modeles/conventions/176_industrie_pharmaceutique/__tests__/indemnite-licenciement/anciennete.spec.ts +6 -2
  32. package/src/modeles/conventions/176_industrie_pharmaceutique/seniority.ts +4 -1
  33. package/src/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/formule.spec.ts +540 -262
  34. package/src/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/indemnite.spec.ts +192 -86
  35. package/src/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/missing-args.spec.ts +190 -0
  36. package/src/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/references.spec.ts +185 -83
  37. package/src/modeles/conventions/275_transport_aerien_personnel_au_sol/indemnite-licenciement.yaml +568 -43
package/CHANGELOG.md CHANGED
@@ -3,6 +3,20 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.121.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.120.1...v4.121.0) (2024-01-30)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **indemnite-licenciement:** retours sur l'ancienneté de la CC 176 ([#5552](https://github.com/SocialGouv/code-du-travail-numerique/issues/5552)) ([79a7a0f](https://github.com/SocialGouv/code-du-travail-numerique/commit/79a7a0f7ce55f56d309978c14a337a3980cd014d))
11
+
12
+ ### Features
13
+
14
+ - **indemnite-licenciement:** fusion de la CC 1391 dans la 275 ([#5567](https://github.com/SocialGouv/code-du-travail-numerique/issues/5567)) ([f39c76e](https://github.com/SocialGouv/code-du-travail-numerique/commit/f39c76e9f63dce419eb05f5f43e8882f6e56c055))
15
+
16
+ ## [4.120.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.120.0...v4.120.1) (2024-01-29)
17
+
18
+ **Note:** Version bump only for package @socialgouv/modeles-social
19
+
6
20
  # [4.120.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.119.1...v4.120.0) (2024-01-25)
7
21
 
8
22
  ### Bug Fixes
@@ -59,7 +59,7 @@ exports.INDEMNITE_LICENCIEMENT_PRODUCTION_READY_CC = [
59
59
  16, 29, 44, 413, 573, 650, 1090, 1351, 1486, 1501, 1518, 1527, 1596, 1597,
60
60
  1979, 2216, 2264, 2941, 3043, 3127, 3239, 1517, 2098, 2511, 2609, 787, 843,
61
61
  675, 1996, 1505, 1147, 1702, 1266, 1672, 275, 86, 2614, 2596, 1043, 1483,
62
- 1516, 1606, 2148, 1404, 292, 2120, 3248,
62
+ 1516, 1606, 2148, 1404, 292, 2120, 3248, 176,
63
63
  ];
64
64
  var getSupportedAgreement = function (idcc) {
65
65
  for (var _i = 0, _a = Object.values(SupportedCcIndemniteLicenciement); _i < _a.length; _i++) {
@@ -12,7 +12,7 @@ var date2021 = (0, date_fns_1.parse)("05/04/2021", "dd/MM/yyyy", new Date());
12
12
  var exitIn2020 = (0, date_fns_1.parse)("10/11/2020", "dd/MM/yyyy", new Date());
13
13
  var exitIn2021 = (0, date_fns_1.parse)("12/06/2021", "dd/MM/yyyy", new Date());
14
14
  describe("Accumulation d'absence par année", function () {
15
- test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n absences | years | expectedOutput\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n absences | years | expectedOutput\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), [], [], [], [{ durationInMonth: 1, motif: { value: 1 }, startedAt: "02/06/2020" }], [{ begin: date2020, end: exitIn2020 }], [{ totalAbsenceInMonth: 1, year: 2020 }], [{ durationInMonth: 1, motif: { value: 1 }, startedAt: "10/05/2020" }, { durationInMonth: 2, motif: { value: 1 }, startedAt: "10/07/2020" }], [{ begin: date2020, end: exitIn2020 }], [{ totalAbsenceInMonth: 3, year: 2020 }], [{ durationInMonth: 3, motif: { value: 1 }, startedAt: "10/07/2020" }, { durationInMonth: 2, motif: { value: 1 }, startedAt: "10/04/2021" }], [{ begin: date2020, end: date2021LessOneDay }, { begin: date2021, end: exitIn2021 }], [{ totalAbsenceInMonth: 3, year: 2020 }, { totalAbsenceInMonth: 2, year: 2021 }], [{ durationInMonth: 1, motif: { value: 1 }, startedAt: "20/03/2021" }], [{ begin: date2020, end: date2021LessOneDay }, { begin: date2021, end: exitIn2021 }], [{ totalAbsenceInMonth: 0.5, year: 2020 }, { totalAbsenceInMonth: 0.4666666666666667, year: 2021 }])("Avec $absences.length absence(s) et $years.length année(s) on attend $expectedOutput.length découpe(s) par année", function (_a) {
15
+ test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n absences | years | expectedOutput\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n absences | years | expectedOutput\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), [], [], [], [{ durationInMonth: 1, motif: { value: 1 }, startedAt: "02/06/2020" }], [{ begin: date2020, end: exitIn2020 }], [{ totalAbsenceInMonth: 1, year: 2020 }], [{ durationInMonth: 1, motif: { value: 1 }, startedAt: "10/05/2020" }, { durationInMonth: 2, motif: { value: 1 }, startedAt: "10/07/2020" }], [{ begin: date2020, end: exitIn2020 }], [{ totalAbsenceInMonth: 3, year: 2020 }], [{ durationInMonth: 3, motif: { value: 1 }, startedAt: "10/07/2020" }, { durationInMonth: 2, motif: { value: 1 }, startedAt: "10/04/2021" }], [{ begin: date2020, end: date2021LessOneDay }, { begin: date2021, end: exitIn2021 }], [{ totalAbsenceInMonth: 3, year: 2020 }, { totalAbsenceInMonth: 2, year: 2021 }], [{ durationInMonth: 1, motif: { value: 1 }, startedAt: "20/03/2021" }], [{ begin: date2020, end: date2021LessOneDay }, { begin: date2021, end: exitIn2021 }], [{ totalAbsenceInMonth: 0.47433264887063653, year: 2020 }, { totalAbsenceInMonth: 0.459958932238193, year: 2021 }])("Avec $absences.length absence(s) et $years.length année(s) on attend $expectedOutput.length découpe(s) par année", function (_a) {
16
16
  var absences = _a.absences, years = _a.years, expectedOutput = _a.expectedOutput;
17
17
  var result = (0, __1.accumulateAbsenceByYear)(absences, years);
18
18
  expect(result).toEqual(expectedOutput);
@@ -11,6 +11,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.splitByTwelveMonthsRolling = exports.accumulateAbsenceByYear = exports.splitBySeniorityCalendarYear = exports.splitBySeniorityYear = void 0;
13
13
  var date_fns_1 = require("date-fns");
14
+ var DAYS_IN_MONTH = 30.4375;
14
15
  var splitBySeniorityYear = function (begin, end) {
15
16
  if ((0, date_fns_1.isAfter)(begin, end)) {
16
17
  return [];
@@ -106,7 +107,6 @@ var splitByTwelveMonthsRollingRec = function (absences, currentYear, acc) {
106
107
  };
107
108
  return splitByTwelveMonthsRollingRec(absences, year, acc.concat(year));
108
109
  };
109
- var DAYS_IN_ONE_MONTH = 30;
110
110
  var absenceInYear = function (absence, year) {
111
111
  if (!absence.startedAt)
112
112
  return false;
@@ -114,7 +114,7 @@ var absenceInYear = function (absence, year) {
114
114
  return false;
115
115
  var absenceStartAt = (0, date_fns_1.parse)(absence.startedAt, "dd/MM/yyyy", new Date());
116
116
  var absenceEndAt = (0, date_fns_1.add)(absenceStartAt, {
117
- days: DAYS_IN_ONE_MONTH * absence.durationInMonth,
117
+ days: DAYS_IN_MONTH * absence.durationInMonth,
118
118
  });
119
119
  return (0, date_fns_1.areIntervalsOverlapping)({
120
120
  end: absenceEndAt,
@@ -128,12 +128,23 @@ var absenceDurationRatio = function (absence, year) {
128
128
  return 0;
129
129
  var absenceStartAt = (0, date_fns_1.parse)(absence.startedAt, "dd/MM/yyyy", new Date());
130
130
  var absenceEndAt = (0, date_fns_1.add)(absenceStartAt, {
131
- days: DAYS_IN_ONE_MONTH * absence.durationInMonth,
131
+ days: DAYS_IN_MONTH * absence.durationInMonth,
132
132
  });
133
133
  if (absenceStartAt >= year.begin && absenceEndAt <= year.end) {
134
134
  return absence.durationInMonth * absence.motif.value;
135
135
  }
136
- return (((0, date_fns_1.getOverlappingDaysInIntervals)({ end: absenceEndAt, start: absenceStartAt }, { end: year.end, start: year.begin }) /
137
- DAYS_IN_ONE_MONTH) *
138
- absence.motif.value);
136
+ var overlappingMonth = getOverlappingMonthsInterval({ end: absenceEndAt, start: absenceStartAt }, { end: year.end, start: year.begin });
137
+ return overlappingMonth * absence.motif.value;
138
+ };
139
+ var getOverlappingMonthsInterval = function (r1, r2) {
140
+ if ((0, date_fns_1.areIntervalsOverlapping)(r1, r2)) {
141
+ var start = (0, date_fns_1.max)([r1.start, r2.start]);
142
+ var end = (0, date_fns_1.min)([r1.end, r2.end]);
143
+ var diffInMonths = (0, date_fns_1.differenceInCalendarMonths)(end, start);
144
+ var startDateWithDifferenceInMonths = (0, date_fns_1.addMonths)(start, diffInMonths);
145
+ var diffInDays = (0, date_fns_1.differenceInDays)(end, startDateWithDifferenceInMonths);
146
+ return diffInMonths + diffInDays / DAYS_IN_MONTH;
147
+ }
148
+ else
149
+ return 0;
139
150
  };
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  var common_1 = require("../../../../common");
8
8
  describe("CC 1527", function () {
9
9
  describe("Calcul de l'ancienneté", function () {
10
- test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", " | ", "\n "], ["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", " | ", " | ", " | ", " | ", "\n "])), [], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 1, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/03/2020" }], "20/02/2020", "20/02/2021", 1 - 1 / 12, [{ durationInMonth: 0.99, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/03/2018" }, { durationInMonth: 0.5, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "06/03/2019" }, { durationInMonth: 0.8, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "08/05/2020" }], "20/02/2018", "20/02/2021", 3, [{ durationInMonth: 0.2, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/03/2018" }, { durationInMonth: 0.3, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/09/2018" }, { durationInMonth: 0.5, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/04/2019" }, { durationInMonth: 0.5, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "06/08/2019" }, { durationInMonth: 2, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "08/09/2020" }], "20/02/2018", "20/02/2021", 3 - 3 / 12, [{ durationInMonth: 1, motif: { key: common_1.MotifKeys.congesSabbatique } }], "20/01/2022", "20/02/2023", 1)("$#) Calcul de l'ancienneté avec $entryDate et $exitDate en attendant $expectedAnciennete an", function (_a) {
10
+ test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "], ["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "])), [], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 1, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/03/2020" }], "20/02/2020", "20/02/2021", 1 - 1 / 12, [{ durationInMonth: 0.99, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/03/2018" }, { durationInMonth: 0.5, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "06/03/2019" }, { durationInMonth: 0.8, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "08/05/2020" }], "20/02/2018", "20/02/2021", 3, [{ durationInMonth: 0.2, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/03/2018" }, { durationInMonth: 0.3, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/09/2018" }, { durationInMonth: 0.5, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "05/04/2019" }, { durationInMonth: 0.5, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "06/08/2019" }, { durationInMonth: 2, motif: { key: common_1.MotifKeys.congesSansSolde, value: 1 }, startedAt: "08/09/2020" }], "20/02/2018", "20/02/2021", 3 - 3 / 12, [{ durationInMonth: 1, motif: { key: common_1.MotifKeys.congesSabbatique } }], "20/01/2022", "20/02/2023", 1)("$#) Calcul de l'ancienneté avec $entryDate et $exitDate en attendant $expectedAnciennete an", function (_a) {
11
11
  var absences = _a.absences, entryDate = _a.entryDate, exitDate = _a.exitDate, expectedAnciennete = _a.expectedAnciennete;
12
12
  var seniority = new common_1.SeniorityFactory().create(common_1.SupportedCcIndemniteLicenciement.IDCC1527);
13
13
  var result = seniority.computeSeniority({
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  var common_1 = require("../../../../common");
8
8
  describe("CC 176", function () {
9
9
  describe("Calcul de l'ancienneté", function () {
10
- test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "], ["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "])), [], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 5, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "20/04/2020" }], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 7, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "01/04/2020" }], "20/02/2020", "20/02/2021", 11 / 12, [{ durationInMonth: 4, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "01/03/2020" }, { durationInMonth: 3, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "01/10/2020" }], "01/08/2020", "01/08/2021", 11 / 12)("Calcul de l'ancienneté avec $entryDate et $exitDate en attendant $expectedAnciennete an", function (_a) {
10
+ test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "], ["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "])), [], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 5, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "20/04/2020" }], "20/02/2020", "20/02/2021", 1, [{ durationInMonth: 7, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "01/03/2020" }], "20/02/2020", "20/02/2022", 17 / 12, [{ durationInMonth: 3, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "01/08/2020" }, { durationInMonth: 4, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "01/03/2020" }], "20/02/2020", "20/02/2022", 17 / 12, [{ durationInMonth: 7, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "01/11/2020" }], "20/02/2020", "20/02/2022", 2, [{ durationInMonth: 6, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "01/07/2021" }], "01/01/2020", "01/01/2023", 3, [{ durationInMonth: 7, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "01/07/2021" }], "01/01/2020", "01/01/2023", 3, [{ durationInMonth: 7, motif: { key: common_1.MotifKeys.maladieNonPro, value: 1 }, startedAt: "15/06/2021" }], "01/01/2020", "01/01/2023", 2.4561943874058865)("Calcul de l'ancienneté avec $entryDate et $exitDate en attendant $expectedAnciennete an", function (_a) {
11
11
  var absences = _a.absences, entryDate = _a.entryDate, exitDate = _a.exitDate, expectedAnciennete = _a.expectedAnciennete;
12
12
  var seniority = new common_1.SeniorityFactory().create(common_1.SupportedCcIndemniteLicenciement.IDCC0176);
13
13
  var result = seniority.computeSeniority({
@@ -21,7 +21,10 @@ var getTotalAbsenceNonPro = function (dEntree, dSortie, absencePeriods) {
21
21
  var years = (0, common_1.splitBySeniorityCalendarYear)(dEntree, dSortie);
22
22
  var absencesBySeniorityYear = (0, common_1.accumulateAbsenceByYear)(absences, years);
23
23
  return absencesBySeniorityYear.reduce(function (total, item) {
24
- return total + Math.max(item.totalAbsenceInMonth - 6, 0);
24
+ if (item.totalAbsenceInMonth <= 6) {
25
+ return total;
26
+ }
27
+ return total + item.totalAbsenceInMonth;
25
28
  }, 0);
26
29
  };
27
30
  var Seniority176 = /** @class */ (function () {