@socialgouv/modeles-social 4.128.0 → 4.129.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 +6 -0
- package/bin/modeles/base/__tests__/indemnite-licenciement/calculate.spec.js +1 -1
- package/bin/publicodes/IndemniteLicenciementPublicodes.d.ts +0 -1
- package/bin/publicodes/IndemniteLicenciementPublicodes.js +11 -34
- package/lib/modeles/base/__tests__/indemnite-licenciement/calculate.spec.js +1 -1
- package/lib/publicodes/IndemniteLicenciementPublicodes.d.ts +0 -1
- package/lib/publicodes/IndemniteLicenciementPublicodes.js +11 -34
- package/package.json +2 -2
- package/src/modeles/base/__tests__/indemnite-licenciement/calculate.spec.ts +1 -1
- package/src/publicodes/IndemniteLicenciementPublicodes.ts +12 -49
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
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.129.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.128.0...v4.129.0) (2024-03-13)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **indemnite-licenciement:** use calculate from information step ([#5675](https://github.com/SocialGouv/code-du-travail-numerique/issues/5675)) ([8534bfd](https://github.com/SocialGouv/code-du-travail-numerique/commit/8534bfd6d1f4afaa7f0166cc5c931c2489561136))
|
|
11
|
+
|
|
6
12
|
# [4.128.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.127.0...v4.128.0) (2024-03-11)
|
|
7
13
|
|
|
8
14
|
### Bug Fixes
|
|
@@ -28,7 +28,7 @@ describe("Test de la fonctionnalité 'calculate'", function () {
|
|
|
28
28
|
licenciementFauteGrave: "non",
|
|
29
29
|
typeContratTravail: "cdi",
|
|
30
30
|
}).missingArgs;
|
|
31
|
-
expect(missingArgs[0].name).toEqual("contrat salarié
|
|
31
|
+
expect(missingArgs[0].name).toEqual("contrat salarié - indemnité de licenciement - ancienneté en année");
|
|
32
32
|
});
|
|
33
33
|
test("Vérifier que l'ancienneté est bien calculé avec les congés", function () {
|
|
34
34
|
var _a;
|
|
@@ -5,7 +5,6 @@ import type { PublicodesData, PublicodesIndemniteLicenciementResult } from "./ty
|
|
|
5
5
|
declare class IndemniteLicenciementPublicodes extends PublicodesBase<PublicodesIndemniteLicenciementResult> implements Publicodes<PublicodesIndemniteLicenciementResult> {
|
|
6
6
|
constructor(models: any, idcc?: string);
|
|
7
7
|
getMissingArg(args: Record<string, string | undefined>, names: string[]): string | undefined;
|
|
8
|
-
mapMissingArg(name: string): PublicodesData<PublicodesIndemniteLicenciementResult>;
|
|
9
8
|
mapIneligibility(text: string): PublicodesData<PublicodesIndemniteLicenciementResult>;
|
|
10
9
|
removeNonPublicodeFields(args: Record<string, string | undefined>): Record<string, string | undefined>;
|
|
11
10
|
calculate(args: Record<string, string | undefined>, targetRule?: string): PublicodesData<PublicodesIndemniteLicenciementResult>;
|
|
@@ -46,21 +46,6 @@ var IndemniteLicenciementPublicodes = /** @class */ (function (_super) {
|
|
|
46
46
|
});
|
|
47
47
|
return missingArg;
|
|
48
48
|
};
|
|
49
|
-
IndemniteLicenciementPublicodes.prototype.mapMissingArg = function (name) {
|
|
50
|
-
return {
|
|
51
|
-
missingArgs: [
|
|
52
|
-
{
|
|
53
|
-
indice: 0,
|
|
54
|
-
name: name,
|
|
55
|
-
rawNode: {
|
|
56
|
-
nom: name,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
result: { value: 0 },
|
|
61
|
-
situation: [],
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
49
|
IndemniteLicenciementPublicodes.prototype.mapIneligibility = function (text) {
|
|
65
50
|
return {
|
|
66
51
|
ineligibility: text,
|
|
@@ -85,15 +70,11 @@ var IndemniteLicenciementPublicodes = /** @class */ (function (_super) {
|
|
|
85
70
|
if (ineligibility) {
|
|
86
71
|
return this.mapIneligibility(ineligibility);
|
|
87
72
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
]);
|
|
94
|
-
if (missingArg) {
|
|
95
|
-
return this.mapMissingArg(missingArg);
|
|
96
|
-
}
|
|
73
|
+
var missingArgSeniority = this.getMissingArg(args, [
|
|
74
|
+
"contrat salarié . indemnité de licenciement . date d'entrée",
|
|
75
|
+
"contrat salarié . indemnité de licenciement . date de sortie",
|
|
76
|
+
]);
|
|
77
|
+
if (!missingArgSeniority) {
|
|
97
78
|
var agreement = new common_1.SeniorityFactory().create(this.idcc);
|
|
98
79
|
var agreementSeniority = agreement.computeSeniority(agreement.mapSituation(args));
|
|
99
80
|
var legal = new common_1.SeniorityFactory().create(common_1.SupportedCcIndemniteLicenciement.default);
|
|
@@ -105,16 +86,12 @@ var IndemniteLicenciementPublicodes = /** @class */ (function (_super) {
|
|
|
105
86
|
newArgs = __assign(__assign(__assign({}, newArgs), { "contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année": agreementSeniority.value.toString() }), agreementSeniority.extraInfos);
|
|
106
87
|
}
|
|
107
88
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
]);
|
|
115
|
-
if (missingArg) {
|
|
116
|
-
return this.mapMissingArg(missingArg);
|
|
117
|
-
}
|
|
89
|
+
var missingArgRequiredSeniority = this.getMissingArg(args, [
|
|
90
|
+
"contrat salarié . indemnité de licenciement . date d'entrée",
|
|
91
|
+
"contrat salarié . indemnité de licenciement . date de sortie",
|
|
92
|
+
"contrat salarié . indemnité de licenciement . date de notification",
|
|
93
|
+
]);
|
|
94
|
+
if (!missingArgRequiredSeniority) {
|
|
118
95
|
var agreement = new common_1.SeniorityFactory().create(this.idcc);
|
|
119
96
|
var agreementRequiredSeniority = agreement.computeRequiredSeniority(agreement.mapRequiredSituation(args));
|
|
120
97
|
var legal = new common_1.SeniorityFactory().create(common_1.SupportedCcIndemniteLicenciement.default);
|
|
@@ -28,7 +28,7 @@ describe("Test de la fonctionnalité 'calculate'", function () {
|
|
|
28
28
|
licenciementFauteGrave: "non",
|
|
29
29
|
typeContratTravail: "cdi",
|
|
30
30
|
}).missingArgs;
|
|
31
|
-
expect(missingArgs[0].name).toEqual("contrat salarié
|
|
31
|
+
expect(missingArgs[0].name).toEqual("contrat salarié - indemnité de licenciement - ancienneté en année");
|
|
32
32
|
});
|
|
33
33
|
test("Vérifier que l'ancienneté est bien calculé avec les congés", function () {
|
|
34
34
|
var _a;
|
|
@@ -5,7 +5,6 @@ import type { PublicodesData, PublicodesIndemniteLicenciementResult } from "./ty
|
|
|
5
5
|
declare class IndemniteLicenciementPublicodes extends PublicodesBase<PublicodesIndemniteLicenciementResult> implements Publicodes<PublicodesIndemniteLicenciementResult> {
|
|
6
6
|
constructor(models: any, idcc?: string);
|
|
7
7
|
getMissingArg(args: Record<string, string | undefined>, names: string[]): string | undefined;
|
|
8
|
-
mapMissingArg(name: string): PublicodesData<PublicodesIndemniteLicenciementResult>;
|
|
9
8
|
mapIneligibility(text: string): PublicodesData<PublicodesIndemniteLicenciementResult>;
|
|
10
9
|
removeNonPublicodeFields(args: Record<string, string | undefined>): Record<string, string | undefined>;
|
|
11
10
|
calculate(args: Record<string, string | undefined>, targetRule?: string): PublicodesData<PublicodesIndemniteLicenciementResult>;
|
|
@@ -46,21 +46,6 @@ var IndemniteLicenciementPublicodes = /** @class */ (function (_super) {
|
|
|
46
46
|
});
|
|
47
47
|
return missingArg;
|
|
48
48
|
};
|
|
49
|
-
IndemniteLicenciementPublicodes.prototype.mapMissingArg = function (name) {
|
|
50
|
-
return {
|
|
51
|
-
missingArgs: [
|
|
52
|
-
{
|
|
53
|
-
indice: 0,
|
|
54
|
-
name: name,
|
|
55
|
-
rawNode: {
|
|
56
|
-
nom: name,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
result: { value: 0 },
|
|
61
|
-
situation: [],
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
49
|
IndemniteLicenciementPublicodes.prototype.mapIneligibility = function (text) {
|
|
65
50
|
return {
|
|
66
51
|
ineligibility: text,
|
|
@@ -85,15 +70,11 @@ var IndemniteLicenciementPublicodes = /** @class */ (function (_super) {
|
|
|
85
70
|
if (ineligibility) {
|
|
86
71
|
return this.mapIneligibility(ineligibility);
|
|
87
72
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
]);
|
|
94
|
-
if (missingArg) {
|
|
95
|
-
return this.mapMissingArg(missingArg);
|
|
96
|
-
}
|
|
73
|
+
var missingArgSeniority = this.getMissingArg(args, [
|
|
74
|
+
"contrat salarié . indemnité de licenciement . date d'entrée",
|
|
75
|
+
"contrat salarié . indemnité de licenciement . date de sortie",
|
|
76
|
+
]);
|
|
77
|
+
if (!missingArgSeniority) {
|
|
97
78
|
var agreement = new common_1.SeniorityFactory().create(this.idcc);
|
|
98
79
|
var agreementSeniority = agreement.computeSeniority(agreement.mapSituation(args));
|
|
99
80
|
var legal = new common_1.SeniorityFactory().create(common_1.SupportedCcIndemniteLicenciement.default);
|
|
@@ -105,16 +86,12 @@ var IndemniteLicenciementPublicodes = /** @class */ (function (_super) {
|
|
|
105
86
|
newArgs = __assign(__assign(__assign({}, newArgs), { "contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année": agreementSeniority.value.toString() }), agreementSeniority.extraInfos);
|
|
106
87
|
}
|
|
107
88
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
]);
|
|
115
|
-
if (missingArg) {
|
|
116
|
-
return this.mapMissingArg(missingArg);
|
|
117
|
-
}
|
|
89
|
+
var missingArgRequiredSeniority = this.getMissingArg(args, [
|
|
90
|
+
"contrat salarié . indemnité de licenciement . date d'entrée",
|
|
91
|
+
"contrat salarié . indemnité de licenciement . date de sortie",
|
|
92
|
+
"contrat salarié . indemnité de licenciement . date de notification",
|
|
93
|
+
]);
|
|
94
|
+
if (!missingArgRequiredSeniority) {
|
|
118
95
|
var agreement = new common_1.SeniorityFactory().create(this.idcc);
|
|
119
96
|
var agreementRequiredSeniority = agreement.computeRequiredSeniority(agreement.mapRequiredSituation(args));
|
|
120
97
|
var legal = new common_1.SeniorityFactory().create(common_1.SupportedCcIndemniteLicenciement.default);
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"access": "public",
|
|
5
5
|
"registry": "https://registry.npmjs.org/"
|
|
6
6
|
},
|
|
7
|
-
"version": "4.
|
|
7
|
+
"version": "4.129.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": "
|
|
53
|
+
"gitHead": "20c025f72dc1d2d8d17019e5c793e6aead52e629"
|
|
54
54
|
}
|
|
@@ -39,7 +39,7 @@ describe("Test de la fonctionnalité 'calculate'", () => {
|
|
|
39
39
|
typeContratTravail: "cdi",
|
|
40
40
|
});
|
|
41
41
|
expect(missingArgs[0].name).toEqual(
|
|
42
|
-
"contrat salarié
|
|
42
|
+
"contrat salarié - indemnité de licenciement - ancienneté en année"
|
|
43
43
|
);
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -45,24 +45,6 @@ class IndemniteLicenciementPublicodes
|
|
|
45
45
|
return missingArg;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
mapMissingArg(
|
|
49
|
-
name: string
|
|
50
|
-
): PublicodesData<PublicodesIndemniteLicenciementResult> {
|
|
51
|
-
return {
|
|
52
|
-
missingArgs: [
|
|
53
|
-
{
|
|
54
|
-
indice: 0,
|
|
55
|
-
name,
|
|
56
|
-
rawNode: {
|
|
57
|
-
nom: name,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
],
|
|
61
|
-
result: { value: 0 },
|
|
62
|
-
situation: [],
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
|
|
66
48
|
mapIneligibility(
|
|
67
49
|
text: string
|
|
68
50
|
): PublicodesData<PublicodesIndemniteLicenciementResult> {
|
|
@@ -98,21 +80,11 @@ class IndemniteLicenciementPublicodes
|
|
|
98
80
|
if (ineligibility) {
|
|
99
81
|
return this.mapIneligibility(ineligibility);
|
|
100
82
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année"
|
|
107
|
-
]
|
|
108
|
-
) {
|
|
109
|
-
const missingArg = this.getMissingArg(args, [
|
|
110
|
-
"contrat salarié . indemnité de licenciement . date d'entrée",
|
|
111
|
-
"contrat salarié . indemnité de licenciement . date de sortie",
|
|
112
|
-
]);
|
|
113
|
-
if (missingArg) {
|
|
114
|
-
return this.mapMissingArg(missingArg);
|
|
115
|
-
}
|
|
83
|
+
const missingArgSeniority = this.getMissingArg(args, [
|
|
84
|
+
"contrat salarié . indemnité de licenciement . date d'entrée",
|
|
85
|
+
"contrat salarié . indemnité de licenciement . date de sortie",
|
|
86
|
+
]);
|
|
87
|
+
if (!missingArgSeniority) {
|
|
116
88
|
const agreement = new SeniorityFactory().create(this.idcc);
|
|
117
89
|
const agreementSeniority = agreement.computeSeniority(
|
|
118
90
|
agreement.mapSituation(args)
|
|
@@ -138,22 +110,12 @@ class IndemniteLicenciementPublicodes
|
|
|
138
110
|
};
|
|
139
111
|
}
|
|
140
112
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
]
|
|
148
|
-
) {
|
|
149
|
-
const missingArg = this.getMissingArg(args, [
|
|
150
|
-
"contrat salarié . indemnité de licenciement . date d'entrée",
|
|
151
|
-
"contrat salarié . indemnité de licenciement . date de sortie",
|
|
152
|
-
"contrat salarié . indemnité de licenciement . date de notification",
|
|
153
|
-
]);
|
|
154
|
-
if (missingArg) {
|
|
155
|
-
return this.mapMissingArg(missingArg);
|
|
156
|
-
}
|
|
113
|
+
const missingArgRequiredSeniority = this.getMissingArg(args, [
|
|
114
|
+
"contrat salarié . indemnité de licenciement . date d'entrée",
|
|
115
|
+
"contrat salarié . indemnité de licenciement . date de sortie",
|
|
116
|
+
"contrat salarié . indemnité de licenciement . date de notification",
|
|
117
|
+
]);
|
|
118
|
+
if (!missingArgRequiredSeniority) {
|
|
157
119
|
const agreement = new SeniorityFactory().create(this.idcc);
|
|
158
120
|
const agreementRequiredSeniority = agreement.computeRequiredSeniority(
|
|
159
121
|
agreement.mapRequiredSituation(args)
|
|
@@ -175,6 +137,7 @@ class IndemniteLicenciementPublicodes
|
|
|
175
137
|
] = agreementRequiredSeniority.value.toString();
|
|
176
138
|
}
|
|
177
139
|
}
|
|
140
|
+
|
|
178
141
|
const ineligibilityWithSeniority =
|
|
179
142
|
ineligibilityInstance.getIneligibility(newArgs);
|
|
180
143
|
if (ineligibilityWithSeniority) {
|