-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(simulator): add CC 573 to retirement notice simulator (#3500)
- Loading branch information
Showing
6 changed files
with
244 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...du-travail-modeles/src/__test__/depart.mise.retraite.commerces.de.gros.references.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import Engine from "publicodes"; | ||
import { mergeModels } from "../internal/merger"; | ||
import { | ||
DepartRetraiteReferences, | ||
MiseRetraiteReferences, | ||
} from "./common/LegalReferences"; | ||
import { getReferences } from "../utils/GetReferences"; | ||
|
||
const engine = new Engine(mergeModels()); | ||
|
||
const MiseRetraiteNonCadresReferences = [ | ||
{ | ||
article: "Article 41", | ||
url: | ||
"https://www.legifrance.gouv.fr/conv_coll/id/KALIARTI000026801989/?idConteneur=KALICONT000005635373", | ||
}, | ||
]; | ||
const MiseRetraiteCadresReferences = [ | ||
{ | ||
article: "Avenant n°I relatif aux cadres Article 5", | ||
url: | ||
"https://www.legifrance.gouv.fr/conv_coll/id/KALIARTI000005836506/?idConteneur=KALICONT000005635373", | ||
}, | ||
]; | ||
|
||
test.each` | ||
retirement | category | expectedReferences | ||
${"départ"} | ${"Ouvriers"} | ${DepartRetraiteReferences} | ||
${"mise"} | ${"Ouvriers"} | ${MiseRetraiteReferences.concat(MiseRetraiteNonCadresReferences)} | ||
${"mise"} | ${"Employés"} | ${MiseRetraiteReferences.concat(MiseRetraiteNonCadresReferences)} | ||
${"mise"} | ${"Agents de maîtrise"} | ${MiseRetraiteReferences.concat(MiseRetraiteNonCadresReferences)} | ||
${"mise"} | ${"Techniciens"} | ${MiseRetraiteReferences.concat(MiseRetraiteNonCadresReferences)} | ||
${"mise"} | ${"Cadres"} | ${MiseRetraiteReferences.concat(MiseRetraiteCadresReferences)} | ||
`( | ||
"Vérification des références juridiques pour un $category en $retirement à la retraite", | ||
({ retirement, category, expectedReferences }) => { | ||
const result = getReferences( | ||
engine.setSituation({ | ||
"contrat salarié . convention collective": "'IDCC0573'", | ||
"contrat salarié . ancienneté": 6, | ||
"contrat salarié . mise à la retraite": | ||
retirement === "mise" ? "oui" : "non", | ||
"contrat salarié . convention collective . commerces de gros . catégorie professionnelle": `'${category}'`, | ||
}) | ||
); | ||
|
||
expect(result).toEqual(expect.arrayContaining(expectedReferences)); | ||
} | ||
); |
116 changes: 116 additions & 0 deletions
116
packages/code-du-travail-modeles/src/__test__/depart.mise.retraite.commerces.de.gros.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
import Engine from "publicodes"; | ||
import { mergeModels } from "../internal/merger"; | ||
import { getNotifications } from "../index"; | ||
|
||
const engine = new Engine(mergeModels()); | ||
|
||
test.each` | ||
seniority | expectedNotice | ||
${5} | ${0} | ||
${6} | ${1} | ||
${24} | ${2} | ||
`( | ||
"Pour un employé possédant $seniority mois d'ancienneté, son préavis de départ à la retraite devrait être $expectedNotice mois", | ||
({ seniority, expectedNotice }) => { | ||
const result = engine | ||
.setSituation({ | ||
"contrat salarié . convention collective": "'IDCC0573'", | ||
"contrat salarié . ancienneté": seniority, | ||
"contrat salarié . mise à la retraite": "non", | ||
}) | ||
.evaluate("contrat salarié . préavis de retraite"); | ||
|
||
expect(result.nodeValue).toEqual(expectedNotice); | ||
expect(result.unit?.numerators).toEqual(["mois"]); | ||
} | ||
); | ||
|
||
test.each` | ||
seniority | category | expectedNotice | ||
${5} | ${"Ouvriers"} | ${3} | ||
${6} | ${"Ouvriers"} | ${3} | ||
${24} | ${"Ouvriers"} | ${3} | ||
${5} | ${"Employés"} | ${3} | ||
${6} | ${"Employés"} | ${3} | ||
${24} | ${"Employés"} | ${3} | ||
${5} | ${"Agents de maîtrise"} | ${3} | ||
${6} | ${"Agents de maîtrise"} | ${3} | ||
${24} | ${"Agents de maîtrise"} | ${3} | ||
${5} | ${"Techniciens"} | ${3} | ||
${6} | ${"Techniciens"} | ${3} | ||
${24} | ${"Techniciens"} | ${3} | ||
${5} | ${"Cadres"} | ${6} | ||
${6} | ${"Cadres"} | ${6} | ||
${24} | ${"Cadres"} | ${6} | ||
`( | ||
"Pour un $category possédant $seniority mois d'ancienneté, son préavis de mise à la retraite devrait être $expectedNotice mois", | ||
({ seniority, category, expectedNotice }) => { | ||
const result = engine | ||
.setSituation({ | ||
"contrat salarié . convention collective": "'IDCC0573'", | ||
"contrat salarié . ancienneté": seniority, | ||
"contrat salarié . mise à la retraite": "oui", | ||
"contrat salarié . convention collective . commerces de gros . catégorie professionnelle": `'${category}'`, | ||
}) | ||
.evaluate("contrat salarié . préavis de retraite"); | ||
|
||
expect(result.nodeValue).toEqual(expectedNotice); | ||
expect(result.unit?.numerators).toEqual(["mois"]); | ||
} | ||
); | ||
|
||
test.each` | ||
seniority | ||
${5} | ||
${6} | ||
${24} | ||
`( | ||
"Pour un employé possédant $seniority mois d'ancienneté en départ à la retraite, on doit afficher une notification", | ||
({ seniority, expectedNotice }) => { | ||
const result = getNotifications( | ||
engine.setSituation({ | ||
"contrat salarié . convention collective": "'IDCC0573'", | ||
"contrat salarié . ancienneté": seniority, | ||
"contrat salarié . mise à la retraite": "non", | ||
}) | ||
); | ||
|
||
expect(result).toHaveLength(1); | ||
expect(result[0].description).toContain( | ||
`Pour les salariés qui relèvent de l'ancienne convention collective du commerce de gros de la confiserie, chocolaterie, biscuiterie et alimentation fine et des négociants-distributeurs de levure, la durée du préavis est égale à **3** mois, si le salarié` | ||
); | ||
} | ||
); | ||
|
||
test.each` | ||
seniority | category | ||
${5} | ${"Ouvriers"} | ||
${6} | ${"Ouvriers"} | ||
${24} | ${"Ouvriers"} | ||
${5} | ${"Employés"} | ||
${6} | ${"Employés"} | ||
${24} | ${"Employés"} | ||
${5} | ${"Agents de maîtrise"} | ||
${6} | ${"Agents de maîtrise"} | ||
${24} | ${"Agents de maîtrise"} | ||
${5} | ${"Techniciens"} | ||
${6} | ${"Techniciens"} | ||
${24} | ${"Techniciens"} | ||
${5} | ${"Cadres"} | ||
${6} | ${"Cadres"} | ||
${24} | ${"Cadres"} | ||
`( | ||
"Pour un $category possédant $seniority mois d'ancienneté en départ à la retraite, on ne doit pas afficher de notification", | ||
({ seniority, category, expectedNotice }) => { | ||
const result = getNotifications( | ||
engine.setSituation({ | ||
"contrat salarié . convention collective": "'IDCC0573'", | ||
"contrat salarié . ancienneté": seniority, | ||
"contrat salarié . mise à la retraite": "oui", | ||
"contrat salarié . convention collective . commerces de gros . catégorie professionnelle": `'${category}'`, | ||
}) | ||
); | ||
|
||
expect(result).toHaveLength(0); | ||
} | ||
); |
54 changes: 54 additions & 0 deletions
54
packages/code-du-travail-modeles/src/modeles/conventions/commerces_de_gros.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Convention collective nationale de commerces de gros du 23 juin 1970. | ||
contrat salarié . convention collective . commerces de gros: | ||
description: Convention collective nationale de commerces de gros du 23 juin 1970. | ||
applicable si: convention collective = 'IDCC0573' | ||
valeur: oui | ||
|
||
contrat salarié . convention collective . commerces de gros . catégorie professionnelle: | ||
question: Quelle est votre catégorie professionelle ? | ||
cdtn: | ||
type: liste | ||
valeurs: | ||
Ouvriers: "'Ouvriers'" | ||
Employés: "'Employés'" | ||
Agents de maîtrise: "'Agents de maîtrise'" | ||
Techniciens: "'Techniciens'" | ||
Cadres: "'Cadres'" | ||
|
||
contrat salarié . convention collective . commerces de gros . catégorie professionnelle . Non cadres: | ||
applicable si: | ||
une de ces conditions: | ||
- catégorie professionnelle = 'Ouvriers' | ||
- catégorie professionnelle = 'Employés' | ||
- catégorie professionnelle = 'Agents de maîtrise' | ||
- catégorie professionnelle = 'Techniciens' | ||
valeur: oui | ||
|
||
contrat salarié . convention collective . commerces de gros . catégorie professionnelle . Non cadres . préavis de retaite: | ||
applicable si: mise à la retraite | ||
remplace: contrat salarié . préavis de retraite collective | ||
valeur: 3 mois | ||
références: | ||
Article 41: https://www.legifrance.gouv.fr/conv_coll/id/KALIARTI000026801989/?idConteneur=KALICONT000005635373 | ||
|
||
contrat salarié . convention collective . commerces de gros . catégorie professionnelle . Cadres: | ||
applicable si: catégorie professionnelle = 'Cadres' | ||
valeur: oui | ||
|
||
contrat salarié . convention collective . commerces de gros . catégorie professionnelle . Cadres . préavis de retaite: | ||
applicable si: mise à la retraite | ||
remplace: contrat salarié . préavis de retraite collective | ||
valeur: 6 mois | ||
références: | ||
Avenant n°I relatif aux cadres Article 5: https://www.legifrance.gouv.fr/conv_coll/id/KALIARTI000005836506/?idConteneur=KALICONT000005635373 | ||
|
||
contrat salarié . convention collective . commerces de gros . notification départ à la retraite: | ||
applicable si: départ à la retraite | ||
type: notification | ||
description: | | ||
Pour les salariés qui relèvent de l'ancienne convention collective du commerce de gros de la confiserie, chocolaterie, biscuiterie et alimentation fine et des négociants-distributeurs de levure, la durée du préavis est égale à **3** mois, si le salarié : | ||
* a une ancienneté supérieure à 2 ans dans l'entreprise, | ||
* et ; souhaite prendre sa retraite à compter de 65 ans révolus, | ||
* et a un contrat de travail en cours d’exécution le 21 février 2019 qui dépend de l'ancienne convention collective. | ||
Le préavis se terminera au dernier jour du trimestre civil. | ||
valeur: oui |