@socialgouv/modeles-social 4.107.0 → 4.108.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,16 @@
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.108.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.107.0...v4.108.0) (2023-09-11)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **indemnite-licenciement:** retours sur la cc 2216 ([#5356](https://github.com/SocialGouv/code-du-travail-numerique/issues/5356)) ([4687586](https://github.com/SocialGouv/code-du-travail-numerique/commit/46875866aa63c57ee7dc80af25284e9f6824cc3f))
11
+
12
+ ### Features
13
+
14
+ - modifier le nom d'une catégorie pro CC 44 ([#5342](https://github.com/SocialGouv/code-du-travail-numerique/issues/5342)) ([e60ca0a](https://github.com/SocialGouv/code-du-travail-numerique/commit/e60ca0a5bc6ef08c9d48ba910a9fb329b47a751d))
15
+
6
16
  # [4.107.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.106.0...v4.107.0) (2023-08-25)
7
17
 
8
18
  ### Bug Fixes
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  var common_1 = require("../../../../common");
8
8
  describe("CC 2216", 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 ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "], ["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "])), [], "20/02/2020", "20/02/2021", 1, [{ motif: { motif: { key: common_1.MotifKeys.maladieNonPro } } }, { motif: { key: common_1.MotifKeys.accidentTrajet } }, { motif: { key: common_1.MotifKeys.congesSabbatique } }, { motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { motif: { key: common_1.MotifKeys.congesParentalEducation } }, { motif: { key: common_1.MotifKeys.congesSansSolde } }, { motif: { key: common_1.MotifKeys.greve } }, { 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.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: "1", 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: "1", 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", 0.9166666666666666, [{ 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: "1", 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", 0.9166666666666666, [{ 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: "1", 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", 0.9583333333333334, [{ 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: "1", 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", 0.9166666666666666, [{ 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: "1", motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 0.9166666666666666, [{ 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: "1", motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 0.9166666666666666, [{ 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.maladieNonPro } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesParentalEducation } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesSansSolde } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.miseAPied } }], "20/01/2021", "20/02/2021", -0.375, [{ 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 11, 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 40.916666666666664, [{ durationInMonth: 11, 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 40.916666666666664, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 40.916666666666664, [{ durationInMonth: 1, motif: { key: common_1.MotifKeys.congesSabbatique } }], "01/01/2022", "01/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 ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "], ["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "])), [], "20/02/2020", "20/02/2021", 1, [{ motif: { motif: { key: common_1.MotifKeys.maladieNonPro } } }, { motif: { key: common_1.MotifKeys.accidentTrajet } }, { motif: { key: common_1.MotifKeys.congesSabbatique } }, { motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { motif: { key: common_1.MotifKeys.congesParentalEducation } }, { motif: { key: common_1.MotifKeys.congesSansSolde } }, { motif: { key: common_1.MotifKeys.greve } }, { 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.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: "1", 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: "1", 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", 0.9166666666666666, [{ 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: "1", 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", 0.9166666666666666, [{ 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: "1", 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", 0.9583333333333334, [{ 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: "1", 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", 0.9166666666666666, [{ 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: "1", motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 0.9166666666666666, [{ 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: "1", motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 0.9166666666666666, [{ 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.maladieNonPro } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesParentalEducation } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesSansSolde } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.miseAPied } }], "20/01/2021", "20/02/2021", -0.375, [{ 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 11, 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 41.916666666666664, [{ durationInMonth: 11, 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 41.916666666666664, [{ durationInMonth: 6, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 6, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 1, 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 } }], "01/01/1979", "01/01/2021", 41.916666666666664, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 40.916666666666664, [{ durationInMonth: 1, motif: { key: common_1.MotifKeys.congesSabbatique } }], "01/01/2022", "01/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.IDCC2216);
13
13
  var result = seniority.computeSeniority({
@@ -23,18 +23,45 @@ var Seniority2216 = /** @class */ (function () {
23
23
  var _this = this;
24
24
  var dEntree = (0, common_1.parseDate)(from);
25
25
  var dSortie = (0, date_fns_1.addDays)((0, common_1.parseDate)(to), 1);
26
- var totalAbsence = absences.reduce(function (total, item) {
26
+ var totalAbsenceWithoutNonProEtAccidentTrajet = absences.reduce(function (total, item) {
27
27
  var m = _this.getMotifs().find(function (motif) { return motif.key === item.motif.key; });
28
28
  if (item.durationInMonth === undefined ||
29
29
  !m ||
30
- (item.motif.key === motif_keys_1.MotifKeys.maladieNonPro &&
31
- item.durationInMonth <= 12) ||
32
- (item.motif.key === motif_keys_1.MotifKeys.accidentTrajet &&
33
- item.durationInMonth <= 12)) {
30
+ item.motif.key === motif_keys_1.MotifKeys.maladieNonPro ||
31
+ item.motif.key === motif_keys_1.MotifKeys.accidentTrajet) {
34
32
  return total;
35
33
  }
36
34
  return total + item.durationInMonth * m.value;
37
35
  }, 0);
36
+ var absencesMaladieNonPro = absences.filter(function (m) { return m.motif.key === motif_keys_1.MotifKeys.maladieNonPro; });
37
+ var totalMonthAbsenceMaladieNonPro = absencesMaladieNonPro.reduce(function (total, item) {
38
+ if (item.durationInMonth === undefined) {
39
+ return total;
40
+ }
41
+ return total + item.durationInMonth;
42
+ }, 0);
43
+ var absenceNonPro = Math.max(totalMonthAbsenceMaladieNonPro - 12, 0);
44
+ var maladieNonProMotifValue = 0;
45
+ var maladieNonProMotif = this.getMotifs().find(function (m) { return m.key === motif_keys_1.MotifKeys.maladieNonPro; });
46
+ if (maladieNonProMotif) {
47
+ maladieNonProMotifValue = maladieNonProMotif.value;
48
+ }
49
+ var absencesTrajet = absences.filter(function (m) { return m.motif.key === motif_keys_1.MotifKeys.accidentTrajet; });
50
+ var totalMonthAbsenceTrajet = absencesTrajet.reduce(function (total, item) {
51
+ if (item.durationInMonth === undefined) {
52
+ return total;
53
+ }
54
+ return total + item.durationInMonth;
55
+ }, 0);
56
+ var absenceTrajet = Math.max(totalMonthAbsenceTrajet - 12, 0);
57
+ var trajetMotifValue = 0;
58
+ var trajetProMotif = this.getMotifs().find(function (m) { return m.key === motif_keys_1.MotifKeys.maladieNonPro; });
59
+ if (trajetProMotif) {
60
+ trajetMotifValue = trajetProMotif.value;
61
+ }
62
+ var totalAbsence = absenceNonPro * maladieNonProMotifValue +
63
+ absenceTrajet * trajetMotifValue +
64
+ totalAbsenceWithoutNonProEtAccidentTrajet;
38
65
  return {
39
66
  value: ((0, date_fns_1.differenceInMonths)(dSortie, dEntree) - totalAbsence) / 12,
40
67
  };
@@ -546,7 +546,7 @@
546
546
  },
547
547
  {
548
548
  "criteria": {
549
- "catégorie professionnelle": "14| Ouvriers, collaborateurs et tehniciens",
549
+ "catégorie professionnelle": "14| Ouvriers et collaborateurs",
550
550
  "coefficient": "1| Inférieur à 160"
551
551
  },
552
552
  "type": "préavis de Démission",
@@ -560,7 +560,7 @@
560
560
  },
561
561
  {
562
562
  "criteria": {
563
- "catégorie professionnelle": "14| Ouvriers, collaborateurs et tehniciens",
563
+ "catégorie professionnelle": "14| Ouvriers et collaborateurs",
564
564
  "coefficient": "2| Entre 160 (inclus) et 175"
565
565
  },
566
566
  "type": "préavis de Démission",
@@ -574,7 +574,7 @@
574
574
  },
575
575
  {
576
576
  "criteria": {
577
- "catégorie professionnelle": "14| Ouvriers, collaborateurs et tehniciens",
577
+ "catégorie professionnelle": "14| Ouvriers et collaborateurs",
578
578
  "coefficient": "8| 190 et plus"
579
579
  },
580
580
  "type": "préavis de Démission",
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  var common_1 = require("../../../../common");
8
8
  describe("CC 2216", 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 ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "], ["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "])), [], "20/02/2020", "20/02/2021", 1, [{ motif: { motif: { key: common_1.MotifKeys.maladieNonPro } } }, { motif: { key: common_1.MotifKeys.accidentTrajet } }, { motif: { key: common_1.MotifKeys.congesSabbatique } }, { motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { motif: { key: common_1.MotifKeys.congesParentalEducation } }, { motif: { key: common_1.MotifKeys.congesSansSolde } }, { motif: { key: common_1.MotifKeys.greve } }, { 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.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: "1", 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: "1", 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", 0.9166666666666666, [{ 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: "1", 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", 0.9166666666666666, [{ 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: "1", 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", 0.9583333333333334, [{ 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: "1", 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", 0.9166666666666666, [{ 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: "1", motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 0.9166666666666666, [{ 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: "1", motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 0.9166666666666666, [{ 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.maladieNonPro } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesParentalEducation } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesSansSolde } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.miseAPied } }], "20/01/2021", "20/02/2021", -0.375, [{ 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 11, 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 40.916666666666664, [{ durationInMonth: 11, 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 40.916666666666664, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 40.916666666666664, [{ durationInMonth: 1, motif: { key: common_1.MotifKeys.congesSabbatique } }], "01/01/2022", "01/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 ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "], ["\n absences | entryDate | exitDate | expectedAnciennete\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "])), [], "20/02/2020", "20/02/2021", 1, [{ motif: { motif: { key: common_1.MotifKeys.maladieNonPro } } }, { motif: { key: common_1.MotifKeys.accidentTrajet } }, { motif: { key: common_1.MotifKeys.congesSabbatique } }, { motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { motif: { key: common_1.MotifKeys.congesParentalEducation } }, { motif: { key: common_1.MotifKeys.congesSansSolde } }, { motif: { key: common_1.MotifKeys.greve } }, { 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.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: "1", 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: "1", 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", 0.9166666666666666, [{ 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: "1", 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", 0.9166666666666666, [{ 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: "1", 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", 0.9583333333333334, [{ 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: "1", 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", 0.9166666666666666, [{ 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: "1", motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 0.9166666666666666, [{ 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: "1", motif: { key: common_1.MotifKeys.miseAPied } }], "20/02/2020", "20/02/2021", 0.9166666666666666, [{ 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.maladieNonPro } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesCreationEntreprise } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesParentalEducation } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.congesSansSolde } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.greve } }, { durationInMonth: "1", motif: { key: common_1.MotifKeys.miseAPied } }], "20/01/2021", "20/02/2021", -0.375, [{ 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 11, 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 41.916666666666664, [{ durationInMonth: 11, 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 } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 41.916666666666664, [{ durationInMonth: 6, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 6, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 1, 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 } }], "01/01/1979", "01/01/2021", 41.916666666666664, [{ durationInMonth: 0, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 13, 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 } }], "01/01/1979", "01/01/2021", 40.916666666666664, [{ durationInMonth: 1, motif: { key: common_1.MotifKeys.congesSabbatique } }], "01/01/2022", "01/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.IDCC2216);
13
13
  var result = seniority.computeSeniority({
@@ -23,18 +23,45 @@ var Seniority2216 = /** @class */ (function () {
23
23
  var _this = this;
24
24
  var dEntree = (0, common_1.parseDate)(from);
25
25
  var dSortie = (0, date_fns_1.addDays)((0, common_1.parseDate)(to), 1);
26
- var totalAbsence = absences.reduce(function (total, item) {
26
+ var totalAbsenceWithoutNonProEtAccidentTrajet = absences.reduce(function (total, item) {
27
27
  var m = _this.getMotifs().find(function (motif) { return motif.key === item.motif.key; });
28
28
  if (item.durationInMonth === undefined ||
29
29
  !m ||
30
- (item.motif.key === motif_keys_1.MotifKeys.maladieNonPro &&
31
- item.durationInMonth <= 12) ||
32
- (item.motif.key === motif_keys_1.MotifKeys.accidentTrajet &&
33
- item.durationInMonth <= 12)) {
30
+ item.motif.key === motif_keys_1.MotifKeys.maladieNonPro ||
31
+ item.motif.key === motif_keys_1.MotifKeys.accidentTrajet) {
34
32
  return total;
35
33
  }
36
34
  return total + item.durationInMonth * m.value;
37
35
  }, 0);
36
+ var absencesMaladieNonPro = absences.filter(function (m) { return m.motif.key === motif_keys_1.MotifKeys.maladieNonPro; });
37
+ var totalMonthAbsenceMaladieNonPro = absencesMaladieNonPro.reduce(function (total, item) {
38
+ if (item.durationInMonth === undefined) {
39
+ return total;
40
+ }
41
+ return total + item.durationInMonth;
42
+ }, 0);
43
+ var absenceNonPro = Math.max(totalMonthAbsenceMaladieNonPro - 12, 0);
44
+ var maladieNonProMotifValue = 0;
45
+ var maladieNonProMotif = this.getMotifs().find(function (m) { return m.key === motif_keys_1.MotifKeys.maladieNonPro; });
46
+ if (maladieNonProMotif) {
47
+ maladieNonProMotifValue = maladieNonProMotif.value;
48
+ }
49
+ var absencesTrajet = absences.filter(function (m) { return m.motif.key === motif_keys_1.MotifKeys.accidentTrajet; });
50
+ var totalMonthAbsenceTrajet = absencesTrajet.reduce(function (total, item) {
51
+ if (item.durationInMonth === undefined) {
52
+ return total;
53
+ }
54
+ return total + item.durationInMonth;
55
+ }, 0);
56
+ var absenceTrajet = Math.max(totalMonthAbsenceTrajet - 12, 0);
57
+ var trajetMotifValue = 0;
58
+ var trajetProMotif = this.getMotifs().find(function (m) { return m.key === motif_keys_1.MotifKeys.maladieNonPro; });
59
+ if (trajetProMotif) {
60
+ trajetMotifValue = trajetProMotif.value;
61
+ }
62
+ var totalAbsence = absenceNonPro * maladieNonProMotifValue +
63
+ absenceTrajet * trajetMotifValue +
64
+ totalAbsenceWithoutNonProEtAccidentTrajet;
38
65
  return {
39
66
  value: ((0, date_fns_1.differenceInMonths)(dSortie, dEntree) - totalAbsence) / 12,
40
67
  };
@@ -546,7 +546,7 @@
546
546
  },
547
547
  {
548
548
  "criteria": {
549
- "catégorie professionnelle": "14| Ouvriers, collaborateurs et tehniciens",
549
+ "catégorie professionnelle": "14| Ouvriers et collaborateurs",
550
550
  "coefficient": "1| Inférieur à 160"
551
551
  },
552
552
  "type": "préavis de Démission",
@@ -560,7 +560,7 @@
560
560
  },
561
561
  {
562
562
  "criteria": {
563
- "catégorie professionnelle": "14| Ouvriers, collaborateurs et tehniciens",
563
+ "catégorie professionnelle": "14| Ouvriers et collaborateurs",
564
564
  "coefficient": "2| Entre 160 (inclus) et 175"
565
565
  },
566
566
  "type": "préavis de Démission",
@@ -574,7 +574,7 @@
574
574
  },
575
575
  {
576
576
  "criteria": {
577
- "catégorie professionnelle": "14| Ouvriers, collaborateurs et tehniciens",
577
+ "catégorie professionnelle": "14| Ouvriers et collaborateurs",
578
578
  "coefficient": "8| 190 et plus"
579
579
  },
580
580
  "type": "préavis de Démission",
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "access": "public",
5
5
  "registry": "https://registry.npmjs.org/"
6
6
  },
7
- "version": "4.107.0",
7
+ "version": "4.108.0",
8
8
  "description": "Les règles publicodes des simulateurs de code du travail numérique",
9
9
  "main": "./lib/index.js",
10
10
  "types": "./lib/index.d.ts",
@@ -50,5 +50,5 @@
50
50
  "yarn lint --fix --quiet"
51
51
  ]
52
52
  },
53
- "gitHead": "8d408c253e92f2e1b66a23a45262bf7d00195df2"
53
+ "gitHead": "d004e7cc2e651ce0b82adfa130a7d58923b08df5"
54
54
  }
@@ -7,27 +7,28 @@ import {
7
7
  describe("CC 2216", () => {
8
8
  describe("Calcul de l'ancienneté", () => {
9
9
  test.each`
10
- absences | entryDate | exitDate | expectedAnciennete
11
- ${[]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
12
- ${[{ motif: { motif: { key: MotifKeys.maladieNonPro } } }, { motif: { key: MotifKeys.accidentTrajet } }, { motif: { key: MotifKeys.congesSabbatique } }, { motif: { key: MotifKeys.congesCreationEntreprise } }, { motif: { key: MotifKeys.congesParentalEducation } }, { motif: { key: MotifKeys.congesSansSolde } }, { motif: { key: MotifKeys.greve } }, { motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
13
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
14
- ${[{ durationInMonth: "1", motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
15
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: "1", motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
16
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: "1", motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
17
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
18
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: "1", motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9583333333333334}
19
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: "1", motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
20
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: "1", motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
21
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: "1", motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
22
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
23
- ${[{ durationInMonth: "1", motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: "1", motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: "1", motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: "1", motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: "1", motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: "1", motif: { key: MotifKeys.greve } }, { durationInMonth: "1", motif: { key: MotifKeys.miseAPied } }]} | ${"20/01/2021"} | ${"20/02/2021"} | ${-0.375}
24
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${42}
25
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 11, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${42}
26
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 13, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${40.916666666666664}
27
- ${[{ durationInMonth: 11, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${42}
28
- ${[{ durationInMonth: 13, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${40.916666666666664}
29
- ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 13, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${40.916666666666664}
30
- ${[{ durationInMonth: 1, motif: { key: MotifKeys.congesSabbatique } }]} | ${"01/01/2022"} | ${"01/02/2023"} | ${1}
10
+ absences | entryDate | exitDate | expectedAnciennete
11
+ ${[]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
12
+ ${[{ motif: { motif: { key: MotifKeys.maladieNonPro } } }, { motif: { key: MotifKeys.accidentTrajet } }, { motif: { key: MotifKeys.congesSabbatique } }, { motif: { key: MotifKeys.congesCreationEntreprise } }, { motif: { key: MotifKeys.congesParentalEducation } }, { motif: { key: MotifKeys.congesSansSolde } }, { motif: { key: MotifKeys.greve } }, { motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
13
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
14
+ ${[{ durationInMonth: "1", motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
15
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: "1", motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
16
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: "1", motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
17
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
18
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: "1", motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9583333333333334}
19
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: "1", motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
20
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: "1", motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
21
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: "1", motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${0.9166666666666666}
22
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"20/02/2020"} | ${"20/02/2021"} | ${1}
23
+ ${[{ durationInMonth: "1", motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: "1", motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: "1", motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: "1", motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: "1", motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: "1", motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: "1", motif: { key: MotifKeys.greve } }, { durationInMonth: "1", motif: { key: MotifKeys.miseAPied } }]} | ${"20/01/2021"} | ${"20/02/2021"} | ${-0.375}
24
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${42}
25
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 11, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${42}
26
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 13, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${41.916666666666664}
27
+ ${[{ durationInMonth: 11, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${42}
28
+ ${[{ durationInMonth: 13, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${41.916666666666664}
29
+ ${[{ durationInMonth: 6, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 6, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 1, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${41.916666666666664}
30
+ ${[{ durationInMonth: 0, motif: { key: MotifKeys.maladieNonPro } }, { durationInMonth: 0, motif: { key: MotifKeys.accidentTrajet } }, { durationInMonth: 13, motif: { key: MotifKeys.congesSabbatique } }, { durationInMonth: 0, motif: { key: MotifKeys.congesCreationEntreprise } }, { durationInMonth: 0, motif: { key: MotifKeys.congesParentalEducation } }, { durationInMonth: 0, motif: { key: MotifKeys.congesSansSolde } }, { durationInMonth: 0, motif: { key: MotifKeys.greve } }, { durationInMonth: 0, motif: { key: MotifKeys.miseAPied } }]} | ${"01/01/1979"} | ${"01/01/2021"} | ${40.916666666666664}
31
+ ${[{ durationInMonth: 1, motif: { key: MotifKeys.congesSabbatique } }]} | ${"01/01/2022"} | ${"01/02/2023"} | ${1}
31
32
  `(
32
33
  "Calcul de l'ancienneté avec $entryDate et $exitDate en attendant $expectedAnciennete an",
33
34
  ({ absences, entryDate, exitDate, expectedAnciennete }) => {
@@ -45,21 +45,74 @@ export class Seniority2216
45
45
  const dEntree = parseDate(from);
46
46
  const dSortie = addDays(parseDate(to), 1);
47
47
 
48
- const totalAbsence = absences.reduce((total, item) => {
49
- const m = this.getMotifs().find((motif) => motif.key === item.motif.key);
50
- if (
51
- item.durationInMonth === undefined ||
52
- !m ||
53
- (item.motif.key === MotifKeys.maladieNonPro &&
54
- item.durationInMonth <= 12) ||
55
- (item.motif.key === MotifKeys.accidentTrajet &&
56
- item.durationInMonth <= 12)
57
- ) {
48
+ const totalAbsenceWithoutNonProEtAccidentTrajet = absences.reduce(
49
+ (total, item) => {
50
+ const m = this.getMotifs().find(
51
+ (motif) => motif.key === item.motif.key
52
+ );
53
+ if (
54
+ item.durationInMonth === undefined ||
55
+ !m ||
56
+ item.motif.key === MotifKeys.maladieNonPro ||
57
+ item.motif.key === MotifKeys.accidentTrajet
58
+ ) {
59
+ return total;
60
+ }
61
+ return total + item.durationInMonth * m.value;
62
+ },
63
+ 0
64
+ );
65
+
66
+ const absencesMaladieNonPro = absences.filter(
67
+ (m) => m.motif.key === MotifKeys.maladieNonPro
68
+ );
69
+
70
+ const totalMonthAbsenceMaladieNonPro = absencesMaladieNonPro.reduce(
71
+ (total, item) => {
72
+ if (item.durationInMonth === undefined) {
73
+ return total;
74
+ }
75
+ return total + item.durationInMonth;
76
+ },
77
+ 0
78
+ );
79
+
80
+ const absenceNonPro = Math.max(totalMonthAbsenceMaladieNonPro - 12, 0);
81
+
82
+ let maladieNonProMotifValue = 0;
83
+ const maladieNonProMotif = this.getMotifs().find(
84
+ (m) => m.key === MotifKeys.maladieNonPro
85
+ );
86
+ if (maladieNonProMotif) {
87
+ maladieNonProMotifValue = maladieNonProMotif.value;
88
+ }
89
+
90
+ const absencesTrajet = absences.filter(
91
+ (m) => m.motif.key === MotifKeys.accidentTrajet
92
+ );
93
+
94
+ const totalMonthAbsenceTrajet = absencesTrajet.reduce((total, item) => {
95
+ if (item.durationInMonth === undefined) {
58
96
  return total;
59
97
  }
60
- return total + item.durationInMonth * m.value;
98
+ return total + item.durationInMonth;
61
99
  }, 0);
62
100
 
101
+ const absenceTrajet = Math.max(totalMonthAbsenceTrajet - 12, 0);
102
+
103
+ let trajetMotifValue = 0;
104
+ const trajetProMotif = this.getMotifs().find(
105
+ (m) => m.key === MotifKeys.maladieNonPro
106
+ );
107
+ if (trajetProMotif) {
108
+ trajetMotifValue = trajetProMotif.value;
109
+ }
110
+
111
+ const totalAbsence =
112
+ absenceNonPro * maladieNonProMotifValue +
113
+ absenceTrajet * trajetMotifValue +
114
+ totalAbsenceWithoutNonProEtAccidentTrajet;
115
+
63
116
  return {
64
117
  value: (differenceInMonths(dSortie, dEntree) - totalAbsence) / 12,
65
118
  };
@@ -546,7 +546,7 @@
546
546
  },
547
547
  {
548
548
  "criteria": {
549
- "catégorie professionnelle": "14| Ouvriers, collaborateurs et tehniciens",
549
+ "catégorie professionnelle": "14| Ouvriers et collaborateurs",
550
550
  "coefficient": "1| Inférieur à 160"
551
551
  },
552
552
  "type": "préavis de Démission",
@@ -560,7 +560,7 @@
560
560
  },
561
561
  {
562
562
  "criteria": {
563
- "catégorie professionnelle": "14| Ouvriers, collaborateurs et tehniciens",
563
+ "catégorie professionnelle": "14| Ouvriers et collaborateurs",
564
564
  "coefficient": "2| Entre 160 (inclus) et 175"
565
565
  },
566
566
  "type": "préavis de Démission",
@@ -574,7 +574,7 @@
574
574
  },
575
575
  {
576
576
  "criteria": {
577
- "catégorie professionnelle": "14| Ouvriers, collaborateurs et tehniciens",
577
+ "catégorie professionnelle": "14| Ouvriers et collaborateurs",
578
578
  "coefficient": "8| 190 et plus"
579
579
  },
580
580
  "type": "préavis de Démission",