@socialgouv/modeles-social 4.98.0 → 4.99.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (353) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/bin/__test__/common/publicode-matcher.d.ts +1 -0
  3. package/bin/__test__/common/publicode-matcher.js +23 -0
  4. package/bin/modeles/common/factory/salary.js +10 -2
  5. package/bin/modeles/common/factory/seniority.js +4 -0
  6. package/bin/modeles/common/supported-agreements.d.ts +4 -0
  7. package/bin/modeles/common/supported-agreements.js +5 -0
  8. package/bin/modeles/common/types/salary.d.ts +2 -2
  9. package/bin/modeles/common/types/seniority.d.ts +2 -1
  10. package/bin/modeles/common/utils/__tests__/accumulate-absence-by-year.spec.js +1 -1
  11. package/bin/modeles/common/utils/__tests__/array.test.js +29 -0
  12. package/bin/modeles/common/utils/__tests__/formule.spec.js +15 -0
  13. package/bin/modeles/common/utils/array.d.ts +1 -0
  14. package/bin/modeles/common/utils/array.js +19 -1
  15. package/bin/modeles/common/utils/common.d.ts +0 -3
  16. package/bin/modeles/common/utils/common.js +1 -13
  17. package/bin/modeles/common/utils/formula.js +1 -1
  18. package/bin/modeles/common/utils/seniority.js +4 -2
  19. package/bin/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/formule.spec.js +51 -0
  20. package/bin/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/indemnite.spec.js +26 -0
  21. package/bin/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/references.spec.js +29 -0
  22. package/bin/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/anciennete.spec.js +23 -1
  23. package/bin/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/formule.spec.js +36 -17
  24. package/bin/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/indemnite.spec.js +41 -19
  25. package/bin/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/missing-args.spec.js +53 -0
  26. package/bin/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/references.spec.js +74 -4
  27. package/bin/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/preavis-retraite/depart-mise.spec.js +4 -3
  28. package/bin/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/preavis-retraite/references.spec.js +18 -10
  29. package/bin/modeles/conventions/1486_bureaux_etudes_techniques/seniority.js +4 -0
  30. package/bin/modeles/conventions/1501_restauration_rapide/__tests__/indemnite-licenciement/formule.spec.js +2 -0
  31. package/bin/modeles/conventions/1501_restauration_rapide/__tests__/indemnite-licenciement/indemnite.spec.js +21 -2
  32. package/bin/modeles/conventions/1516_organismes_formation/__tests__/indemnite-licenciement/formule.spec.js +1 -1
  33. package/bin/modeles/conventions/1516_organismes_formation/__tests__/indemnite-licenciement/indemnite.spec.js +1 -1
  34. package/bin/modeles/conventions/1516_organismes_formation/__tests__/indemnite-licenciement/salaire-ref.spec.js +101 -69
  35. package/bin/modeles/conventions/1516_organismes_formation/salary.js +8 -6
  36. package/bin/modeles/conventions/1527_immobilier/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  37. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/anciennete.spec.d.ts +1 -0
  38. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/anciennete.spec.js +23 -0
  39. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/formule.spec.d.ts +1 -0
  40. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/formule.spec.js +38 -0
  41. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/indemnite.spec.d.ts +1 -0
  42. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/indemnite.spec.js +40 -0
  43. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/references.spec.d.ts +1 -0
  44. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/references.spec.js +41 -0
  45. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/salaire-ref.spec.d.ts +1 -0
  46. package/bin/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/salaire-ref.spec.js +54 -0
  47. package/bin/modeles/conventions/1606_bricolage/index.d.ts +2 -0
  48. package/bin/modeles/conventions/1606_bricolage/index.js +18 -0
  49. package/bin/modeles/conventions/1606_bricolage/salary.d.ts +9 -0
  50. package/bin/modeles/conventions/1606_bricolage/salary.js +19 -0
  51. package/bin/modeles/conventions/1606_bricolage/seniority.d.ts +6 -0
  52. package/bin/modeles/conventions/1606_bricolage/seniority.js +35 -0
  53. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/anciennete.spec.d.ts +1 -0
  54. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/anciennete.spec.js +38 -0
  55. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/formule.spec.d.ts +1 -0
  56. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/formule.spec.js +56 -0
  57. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/indemnite.spec.d.ts +1 -0
  58. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/indemnite.spec.js +55 -0
  59. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  60. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/missing-args.spec.js +93 -0
  61. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/notifications.spec.d.ts +1 -0
  62. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/notifications.spec.js +37 -0
  63. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/references.spec.d.ts +1 -0
  64. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/references.spec.js +81 -0
  65. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/salaire-ref.spec.d.ts +1 -0
  66. package/bin/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/salaire-ref.spec.js +68 -0
  67. package/bin/modeles/conventions/1672_societes_assurances/__tests__/preavis-retraite/depart-mise.spec.js +1 -2
  68. package/bin/modeles/conventions/1672_societes_assurances/index.d.ts +2 -0
  69. package/bin/modeles/conventions/1672_societes_assurances/index.js +18 -0
  70. package/bin/modeles/conventions/1672_societes_assurances/salary.d.ts +8 -0
  71. package/bin/modeles/conventions/1672_societes_assurances/salary.js +26 -0
  72. package/bin/modeles/conventions/1672_societes_assurances/seniority.d.ts +12 -0
  73. package/bin/modeles/conventions/1672_societes_assurances/seniority.js +111 -0
  74. package/bin/modeles/conventions/16_transports_routiers/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  75. package/bin/modeles/conventions/1702_ouvriers_travaux_public/__tests__/indemnite-licenciement/formule.spec.js +2 -0
  76. package/bin/modeles/conventions/1702_ouvriers_travaux_public/__tests__/indemnite-licenciement/indemnite.spec.js +16 -0
  77. package/bin/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  78. package/bin/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/formule.spec.js +1 -0
  79. package/bin/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/indemnite.spec.js +16 -0
  80. package/bin/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/references.spec.js +1 -0
  81. package/bin/modeles/conventions/2098_personnel_presta_service_tertiaire/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  82. package/bin/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/formule.spec.d.ts +1 -0
  83. package/bin/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/formule.spec.js +24 -0
  84. package/bin/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/indemnite.spec.d.ts +1 -0
  85. package/bin/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/indemnite.spec.js +27 -0
  86. package/bin/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/references.spec.d.ts +1 -0
  87. package/bin/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/references.spec.js +30 -0
  88. package/bin/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/salaire-ref.spec.d.ts +1 -0
  89. package/bin/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/salaire-ref.spec.js +47 -0
  90. package/bin/modeles/conventions/2148_telecommunications/index.d.ts +1 -0
  91. package/bin/modeles/conventions/2148_telecommunications/index.js +17 -0
  92. package/bin/modeles/conventions/2148_telecommunications/salary.d.ts +13 -0
  93. package/bin/modeles/conventions/2148_telecommunications/salary.js +32 -0
  94. package/bin/modeles/conventions/2216_commerces_detail_alimentation/__tests__/indemnite-licenciement/formule.spec.js +1 -0
  95. package/bin/modeles/conventions/2216_commerces_detail_alimentation/__tests__/indemnite-licenciement/indemnite.spec.js +32 -18
  96. package/bin/modeles/conventions/2216_commerces_detail_alimentation/__tests__/indemnite-licenciement/r/303/251f/303/251rences.spec.js +1 -0
  97. package/bin/modeles/conventions/2596_coiffure/__tests__/indemnite-licenciement/formule.spec.js +2 -2
  98. package/bin/modeles/conventions/2596_coiffure/__tests__/indemnite-licenciement/indemnite.spec.js +2 -2
  99. package/bin/modeles/conventions/2596_coiffure/__tests__/indemnite-licenciement/references.spec.js +2 -2
  100. package/bin/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/formule.spec.js +51 -28
  101. package/bin/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/indemnite.spec.js +2 -2
  102. package/bin/modeles/conventions/2941_aide_accompagnement_soins_services_domicile/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  103. package/bin/modeles/conventions/413_handicap/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  104. package/bin/modeles/conventions/44_industries_chimiques/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  105. package/bin/modeles/conventions/573_commerces_de_gros/__tests__/indemnite-licenciement/indemnite.spec.js +18 -3
  106. package/bin/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/formule.spec.js +9 -7
  107. package/bin/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/indemnite.spec.js +67 -18
  108. package/bin/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  109. package/bin/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/missing-args.spec.js +16 -0
  110. package/bin/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/references.spec.js +4 -3
  111. package/bin/modeles/conventions/index.d.ts +3 -0
  112. package/bin/modeles/conventions/index.js +3 -0
  113. package/bin/publicodes/types.d.ts +0 -1
  114. package/bin/publicodes/types.js +0 -1
  115. package/bin/simulators/heure-recherche-emploi/heures-recherche-emploi.data.json +10 -10
  116. package/bin/simulators/preavis-demission/preavis-demission.data.json +12 -12
  117. package/bin/simulators/preavis-licenciement/preavis-licenciement.data.json +10 -10
  118. package/jest.config.js +4 -1
  119. package/lib/modeles/common/factory/salary.js +10 -2
  120. package/lib/modeles/common/factory/seniority.js +4 -0
  121. package/lib/modeles/common/supported-agreements.d.ts +4 -0
  122. package/lib/modeles/common/supported-agreements.js +5 -0
  123. package/lib/modeles/common/types/salary.d.ts +2 -2
  124. package/lib/modeles/common/types/seniority.d.ts +2 -1
  125. package/lib/modeles/common/utils/__tests__/accumulate-absence-by-year.spec.js +1 -1
  126. package/lib/modeles/common/utils/__tests__/array.test.js +29 -0
  127. package/lib/modeles/common/utils/__tests__/formule.spec.js +15 -0
  128. package/lib/modeles/common/utils/array.d.ts +1 -0
  129. package/lib/modeles/common/utils/array.js +19 -1
  130. package/lib/modeles/common/utils/ccn-supported.json +4 -4
  131. package/lib/modeles/common/utils/common.d.ts +0 -3
  132. package/lib/modeles/common/utils/common.js +1 -13
  133. package/lib/modeles/common/utils/formula.js +1 -1
  134. package/lib/modeles/common/utils/seniority.js +4 -2
  135. package/lib/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/formule.spec.d.ts +1 -0
  136. package/lib/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/formule.spec.js +51 -0
  137. package/lib/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/indemnite.spec.d.ts +1 -0
  138. package/lib/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/indemnite.spec.js +26 -0
  139. package/lib/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/references.spec.d.ts +1 -0
  140. package/lib/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/references.spec.js +29 -0
  141. package/lib/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/anciennete.spec.js +23 -1
  142. package/lib/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/formule.spec.js +36 -17
  143. package/lib/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/indemnite.spec.js +41 -19
  144. package/lib/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  145. package/lib/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/missing-args.spec.js +53 -0
  146. package/lib/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/references.spec.js +74 -4
  147. package/lib/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/preavis-retraite/depart-mise.spec.js +4 -3
  148. package/lib/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/preavis-retraite/references.spec.js +18 -10
  149. package/lib/modeles/conventions/1486_bureaux_etudes_techniques/seniority.js +4 -0
  150. package/lib/modeles/conventions/1501_restauration_rapide/__tests__/indemnite-licenciement/formule.spec.js +2 -0
  151. package/lib/modeles/conventions/1501_restauration_rapide/__tests__/indemnite-licenciement/indemnite.spec.js +21 -2
  152. package/lib/modeles/conventions/1516_organismes_formation/__tests__/indemnite-licenciement/formule.spec.js +1 -1
  153. package/lib/modeles/conventions/1516_organismes_formation/__tests__/indemnite-licenciement/indemnite.spec.js +1 -1
  154. package/lib/modeles/conventions/1516_organismes_formation/__tests__/indemnite-licenciement/salaire-ref.spec.js +101 -69
  155. package/lib/modeles/conventions/1516_organismes_formation/salary.js +8 -6
  156. package/lib/modeles/conventions/1527_immobilier/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  157. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/anciennete.spec.d.ts +1 -0
  158. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/anciennete.spec.js +23 -0
  159. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/formule.spec.d.ts +1 -0
  160. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/formule.spec.js +38 -0
  161. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/indemnite.spec.d.ts +1 -0
  162. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/indemnite.spec.js +40 -0
  163. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/references.spec.d.ts +1 -0
  164. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/references.spec.js +41 -0
  165. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/salaire-ref.spec.d.ts +1 -0
  166. package/lib/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/salaire-ref.spec.js +54 -0
  167. package/lib/modeles/conventions/1606_bricolage/index.d.ts +2 -0
  168. package/lib/modeles/conventions/1606_bricolage/index.js +18 -0
  169. package/lib/modeles/conventions/1606_bricolage/salary.d.ts +9 -0
  170. package/lib/modeles/conventions/1606_bricolage/salary.js +19 -0
  171. package/lib/modeles/conventions/1606_bricolage/seniority.d.ts +6 -0
  172. package/lib/modeles/conventions/1606_bricolage/seniority.js +35 -0
  173. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/anciennete.spec.d.ts +1 -0
  174. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/anciennete.spec.js +38 -0
  175. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/formule.spec.d.ts +1 -0
  176. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/formule.spec.js +56 -0
  177. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/indemnite.spec.d.ts +1 -0
  178. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/indemnite.spec.js +55 -0
  179. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  180. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/missing-args.spec.js +93 -0
  181. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/notifications.spec.d.ts +1 -0
  182. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/notifications.spec.js +37 -0
  183. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/references.spec.d.ts +1 -0
  184. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/references.spec.js +81 -0
  185. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/salaire-ref.spec.d.ts +1 -0
  186. package/lib/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/salaire-ref.spec.js +68 -0
  187. package/lib/modeles/conventions/1672_societes_assurances/__tests__/preavis-retraite/depart-mise.spec.js +1 -2
  188. package/lib/modeles/conventions/1672_societes_assurances/index.d.ts +2 -0
  189. package/lib/modeles/conventions/1672_societes_assurances/index.js +18 -0
  190. package/lib/modeles/conventions/1672_societes_assurances/salary.d.ts +8 -0
  191. package/lib/modeles/conventions/1672_societes_assurances/salary.js +26 -0
  192. package/lib/modeles/conventions/1672_societes_assurances/seniority.d.ts +12 -0
  193. package/lib/modeles/conventions/1672_societes_assurances/seniority.js +111 -0
  194. package/lib/modeles/conventions/16_transports_routiers/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  195. package/lib/modeles/conventions/1702_ouvriers_travaux_public/__tests__/indemnite-licenciement/formule.spec.js +2 -0
  196. package/lib/modeles/conventions/1702_ouvriers_travaux_public/__tests__/indemnite-licenciement/indemnite.spec.js +16 -0
  197. package/lib/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  198. package/lib/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/formule.spec.js +1 -0
  199. package/lib/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/indemnite.spec.js +16 -0
  200. package/lib/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/references.spec.js +1 -0
  201. package/lib/modeles/conventions/2098_personnel_presta_service_tertiaire/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  202. package/lib/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/formule.spec.d.ts +1 -0
  203. package/lib/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/formule.spec.js +24 -0
  204. package/lib/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/indemnite.spec.d.ts +1 -0
  205. package/lib/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/indemnite.spec.js +27 -0
  206. package/lib/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/references.spec.d.ts +1 -0
  207. package/lib/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/references.spec.js +30 -0
  208. package/lib/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/salaire-ref.spec.d.ts +1 -0
  209. package/lib/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/salaire-ref.spec.js +47 -0
  210. package/lib/modeles/conventions/2148_telecommunications/index.d.ts +1 -0
  211. package/lib/modeles/conventions/2148_telecommunications/index.js +17 -0
  212. package/lib/modeles/conventions/2148_telecommunications/salary.d.ts +13 -0
  213. package/lib/modeles/conventions/2148_telecommunications/salary.js +32 -0
  214. package/lib/modeles/conventions/2216_commerces_detail_alimentation/__tests__/indemnite-licenciement/formule.spec.js +1 -0
  215. package/lib/modeles/conventions/2216_commerces_detail_alimentation/__tests__/indemnite-licenciement/indemnite.spec.js +32 -18
  216. package/lib/modeles/conventions/2216_commerces_detail_alimentation/__tests__/indemnite-licenciement/r/303/251f/303/251rences.spec.js +1 -0
  217. package/lib/modeles/conventions/2596_coiffure/__tests__/indemnite-licenciement/formule.spec.js +2 -2
  218. package/lib/modeles/conventions/2596_coiffure/__tests__/indemnite-licenciement/indemnite.spec.js +2 -2
  219. package/lib/modeles/conventions/2596_coiffure/__tests__/indemnite-licenciement/references.spec.js +2 -2
  220. package/lib/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/formule.spec.js +51 -28
  221. package/lib/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/indemnite.spec.js +2 -2
  222. package/lib/modeles/conventions/2941_aide_accompagnement_soins_services_domicile/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  223. package/lib/modeles/conventions/413_handicap/__tests__/indemnite-licenciement/anciennete.spec.js +1 -1
  224. package/lib/modeles/conventions/44_industries_chimiques/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  225. package/lib/modeles/conventions/573_commerces_de_gros/__tests__/indemnite-licenciement/indemnite.spec.js +18 -3
  226. package/lib/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/formule.spec.js +9 -7
  227. package/lib/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/indemnite.spec.js +67 -18
  228. package/lib/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/missing-args.spec.d.ts +1 -0
  229. package/lib/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/missing-args.spec.js +16 -0
  230. package/lib/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/references.spec.js +4 -3
  231. package/lib/modeles/conventions/index.d.ts +3 -0
  232. package/lib/modeles/conventions/index.js +3 -0
  233. package/lib/modeles/modeles-indemnite-licenciement.json +1520 -295
  234. package/lib/modeles/modeles-preavis-retraite.json +39 -13
  235. package/lib/publicodes/types.d.ts +0 -1
  236. package/lib/publicodes/types.js +0 -1
  237. package/lib/simulators/heure-recherche-emploi/heures-recherche-emploi.data.json +10 -10
  238. package/lib/simulators/preavis-demission/preavis-demission.data.json +12 -12
  239. package/lib/simulators/preavis-licenciement/preavis-licenciement.data.json +10 -10
  240. package/package.json +2 -2
  241. package/src/__test__/common/publicode-matcher.ts +25 -0
  242. package/src/modeles/common/factory/salary.ts +13 -1
  243. package/src/modeles/common/factory/seniority.ts +6 -0
  244. package/src/modeles/common/supported-agreements.ts +5 -0
  245. package/src/modeles/common/types/salary.ts +6 -0
  246. package/src/modeles/common/types/seniority.ts +3 -0
  247. package/src/modeles/common/utils/__tests__/accumulate-absence-by-year.spec.ts +6 -6
  248. package/src/modeles/common/utils/__tests__/array.test.ts +36 -1
  249. package/src/modeles/common/utils/__tests__/data/formule_avec_explanations_dupliqu/303/251s.yaml +29 -0
  250. package/src/modeles/common/utils/__tests__/formule.spec.ts +20 -0
  251. package/src/modeles/common/utils/array.ts +23 -0
  252. package/src/modeles/common/utils/common.ts +0 -12
  253. package/src/modeles/common/utils/formula.ts +3 -2
  254. package/src/modeles/common/utils/seniority.ts +5 -3
  255. package/src/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/formule.spec.ts +60 -0
  256. package/src/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/indemnite.spec.ts +40 -0
  257. package/src/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/references.spec.ts +41 -0
  258. package/src/modeles/conventions/1043_gardien_concierge/indemnite-licenciement.yaml +98 -0
  259. package/src/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/anciennete.spec.ts +32 -4
  260. package/src/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/formule.spec.ts +91 -46
  261. package/src/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/indemnite.spec.ts +137 -74
  262. package/src/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/missing-args.spec.ts +89 -0
  263. package/src/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/references.spec.ts +98 -2
  264. package/src/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/preavis-retraite/depart-mise.spec.ts +13 -7
  265. package/src/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/preavis-retraite/references.spec.ts +21 -9
  266. package/src/modeles/conventions/1486_bureaux_etudes_techniques/indemnite-licenciement.yaml +176 -18
  267. package/src/modeles/conventions/1486_bureaux_etudes_techniques/preavis-retraite.yaml +31 -11
  268. package/src/modeles/conventions/1486_bureaux_etudes_techniques/seniority.ts +6 -1
  269. package/src/modeles/conventions/1501_restauration_rapide/__tests__/indemnite-licenciement/formule.spec.ts +4 -0
  270. package/src/modeles/conventions/1501_restauration_rapide/__tests__/indemnite-licenciement/indemnite.spec.ts +36 -0
  271. package/src/modeles/conventions/1501_restauration_rapide/indemnite-licenciement.yaml +4 -3
  272. package/src/modeles/conventions/1516_organismes_formation/__tests__/indemnite-licenciement/formule.spec.ts +2 -2
  273. package/src/modeles/conventions/1516_organismes_formation/__tests__/indemnite-licenciement/indemnite.spec.ts +8 -8
  274. package/src/modeles/conventions/1516_organismes_formation/__tests__/indemnite-licenciement/salaire-ref.spec.ts +107 -83
  275. package/src/modeles/conventions/1516_organismes_formation/indemnite-licenciement.yaml +15 -14
  276. package/src/modeles/conventions/1516_organismes_formation/salary.ts +14 -14
  277. package/src/modeles/conventions/1527_immobilier/__tests__/indemnite-licenciement/anciennete.spec.ts +4 -5
  278. package/src/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/anciennete.spec.ts +31 -0
  279. package/src/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/formule.spec.ts +64 -0
  280. package/src/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/indemnite.spec.ts +70 -0
  281. package/src/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/references.spec.ts +54 -0
  282. package/src/modeles/conventions/1606_bricolage/__tests__/indemnite-licenciement/salaire-ref.spec.ts +58 -0
  283. package/src/modeles/conventions/1606_bricolage/indemnite-licenciement.yaml +57 -0
  284. package/src/modeles/conventions/1606_bricolage/index.ts +2 -0
  285. package/src/modeles/conventions/1606_bricolage/salary.ts +22 -0
  286. package/src/modeles/conventions/1606_bricolage/seniority.ts +22 -0
  287. package/src/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/anciennete.spec.ts +74 -0
  288. package/src/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/formule.spec.ts +121 -0
  289. package/src/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/indemnite.spec.ts +125 -0
  290. package/src/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/missing-args.spec.ts +160 -0
  291. package/src/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/notifications.spec.ts +57 -0
  292. package/src/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/references.spec.ts +116 -0
  293. package/src/modeles/conventions/1672_societes_assurances/__tests__/indemnite-licenciement/salaire-ref.spec.ts +75 -0
  294. package/src/modeles/conventions/1672_societes_assurances/__tests__/preavis-retraite/depart-mise.spec.ts +1 -2
  295. package/src/modeles/conventions/1672_societes_assurances/common.yaml +10 -0
  296. package/src/modeles/conventions/1672_societes_assurances/indemnite-licenciement.yaml +282 -0
  297. package/src/modeles/conventions/1672_societes_assurances/index.ts +2 -0
  298. package/src/modeles/conventions/1672_societes_assurances/preavis-retraite.yaml +0 -10
  299. package/src/modeles/conventions/1672_societes_assurances/salary.ts +36 -0
  300. package/src/modeles/conventions/1672_societes_assurances/seniority.ts +172 -0
  301. package/src/modeles/conventions/16_transports_routiers/__tests__/indemnite-licenciement/anciennete.spec.ts +2 -2
  302. package/src/modeles/conventions/1702_ouvriers_travaux_public/__tests__/indemnite-licenciement/formule.spec.ts +4 -0
  303. package/src/modeles/conventions/1702_ouvriers_travaux_public/__tests__/indemnite-licenciement/indemnite.spec.ts +26 -0
  304. package/src/modeles/conventions/1702_ouvriers_travaux_public/indemnite-licenciement.yaml +1 -1
  305. package/src/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/anciennete.spec.ts +5 -5
  306. package/src/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/formule.spec.ts +2 -0
  307. package/src/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/indemnite.spec.ts +26 -0
  308. package/src/modeles/conventions/1996_pharmacie/__tests__/indemnite-licenciement/references.spec.ts +2 -0
  309. package/src/modeles/conventions/1996_pharmacie/indemnite-licenciement.yaml +2 -1
  310. package/src/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/formule.spec.ts +42 -0
  311. package/src/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/indemnite.spec.ts +53 -0
  312. package/src/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/references.spec.ts +44 -0
  313. package/src/modeles/conventions/2148_telecommunications/__tests__/indemnite-licenciement/salaire-ref.spec.ts +51 -0
  314. package/src/modeles/conventions/2148_telecommunications/indemnite-licenciement.yaml +121 -0
  315. package/src/modeles/conventions/2148_telecommunications/index.ts +1 -0
  316. package/src/modeles/conventions/2148_telecommunications/salary.ts +39 -0
  317. package/src/modeles/conventions/2216_commerces_detail_alimentation/__tests__/indemnite-licenciement/formule.spec.ts +2 -0
  318. package/src/modeles/conventions/2216_commerces_detail_alimentation/__tests__/indemnite-licenciement/indemnite.spec.ts +135 -108
  319. package/src/modeles/conventions/2216_commerces_detail_alimentation/__tests__/indemnite-licenciement/r/303/251f/303/251rences.spec.ts +2 -0
  320. package/src/modeles/conventions/2216_commerces_detail_alimentation/indemnite-licenciement.yaml +4 -3
  321. package/src/modeles/conventions/2596_coiffure/__tests__/indemnite-licenciement/formule.spec.ts +4 -4
  322. package/src/modeles/conventions/2596_coiffure/__tests__/indemnite-licenciement/indemnite.spec.ts +4 -4
  323. package/src/modeles/conventions/2596_coiffure/__tests__/indemnite-licenciement/references.spec.ts +4 -4
  324. package/src/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/formule.spec.ts +51 -28
  325. package/src/modeles/conventions/275_transport_aerien_personnel_au_sol/__tests__/indemnite-licenciement/indemnite.spec.ts +19 -15
  326. package/src/modeles/conventions/275_transport_aerien_personnel_au_sol/indemnite-licenciement.yaml +164 -12
  327. package/src/modeles/conventions/2941_aide_accompagnement_soins_services_domicile/__tests__/indemnite-licenciement/anciennete.spec.ts +7 -7
  328. package/src/modeles/conventions/3239_particuliers_employeurs_domicile/indemnite-licenciement.yaml +1 -1
  329. package/src/modeles/conventions/413_handicap/__tests__/indemnite-licenciement/anciennete.spec.ts +2 -2
  330. package/src/modeles/conventions/573_commerces_de_gros/__tests__/indemnite-licenciement/indemnite.spec.ts +36 -14
  331. package/src/modeles/conventions/573_commerces_de_gros/indemnite-licenciement.yaml +1 -0
  332. package/src/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/formule.spec.ts +13 -10
  333. package/src/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/indemnite.spec.ts +138 -77
  334. package/src/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/missing-args.spec.ts +29 -0
  335. package/src/modeles/conventions/675_habillement_commerce_succursales/__tests__/indemnite-licenciement/references.spec.ts +5 -3
  336. package/src/modeles/conventions/675_habillement_commerce_succursales/common.yaml +11 -0
  337. package/src/modeles/conventions/675_habillement_commerce_succursales/indemnite-licenciement.yaml +45 -59
  338. package/src/modeles/conventions/675_habillement_commerce_succursales/preavis-retraite.yaml +0 -10
  339. package/src/modeles/conventions/index.ts +3 -0
  340. package/src/publicodes/types.ts +0 -1
  341. package/src/simulators/heure-recherche-emploi/heures-recherche-emploi.data.json +10 -10
  342. package/src/simulators/preavis-demission/preavis-demission.data.json +12 -12
  343. package/src/simulators/preavis-licenciement/preavis-licenciement.data.json +10 -10
  344. /package/bin/modeles/conventions/{2098_personnel_presta_service_tertiaire/__tests__/indemnite-licenciement/missing-var.spec.d.ts → 1043_gardien_concierge/__tests__/indemnite-licenciement/formule.spec.d.ts} +0 -0
  345. /package/bin/modeles/conventions/{44_industries_chimiques/__tests__/indemnite-licenciement/missing-var.spec.d.ts → 1043_gardien_concierge/__tests__/indemnite-licenciement/indemnite.spec.d.ts} +0 -0
  346. /package/{lib/modeles/conventions/2098_personnel_presta_service_tertiaire/__tests__/indemnite-licenciement/missing-var.spec.d.ts → bin/modeles/conventions/1043_gardien_concierge/__tests__/indemnite-licenciement/references.spec.d.ts} +0 -0
  347. /package/{lib/modeles/conventions/44_industries_chimiques/__tests__/indemnite-licenciement/missing-var.spec.d.ts → bin/modeles/conventions/1486_bureaux_etudes_techniques/__tests__/indemnite-licenciement/missing-args.spec.d.ts} +0 -0
  348. /package/bin/modeles/conventions/2098_personnel_presta_service_tertiaire/__tests__/indemnite-licenciement/{missing-var.spec.js → missing-args.spec.js} +0 -0
  349. /package/bin/modeles/conventions/44_industries_chimiques/__tests__/indemnite-licenciement/{missing-var.spec.js → missing-args.spec.js} +0 -0
  350. /package/lib/modeles/conventions/2098_personnel_presta_service_tertiaire/__tests__/indemnite-licenciement/{missing-var.spec.js → missing-args.spec.js} +0 -0
  351. /package/lib/modeles/conventions/44_industries_chimiques/__tests__/indemnite-licenciement/{missing-var.spec.js → missing-args.spec.js} +0 -0
  352. /package/src/modeles/conventions/2098_personnel_presta_service_tertiaire/__tests__/indemnite-licenciement/{missing-var.spec.ts → missing-args.spec.ts} +0 -0
  353. /package/src/modeles/conventions/44_industries_chimiques/__tests__/indemnite-licenciement/{missing-var.spec.ts → missing-args.spec.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -3,6 +3,30 @@
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.99.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.98.1...v4.99.0) (2023-05-23)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **Indemnité de licenciement:** wording ([#5131](https://github.com/SocialGouv/code-du-travail-numerique/issues/5131)) ([37dabb7](https://github.com/SocialGouv/code-du-travail-numerique/commit/37dabb70832cbaedeb808da3fa3ee2a5ee9a109e))
11
+ - **simulators:** maj de la 1486 ([#5137](https://github.com/SocialGouv/code-du-travail-numerique/issues/5137)) ([dc9247b](https://github.com/SocialGouv/code-du-travail-numerique/commit/dc9247b4b0f042aa4fe0278edcfa2ac1003f740e))
12
+
13
+ ### Features
14
+
15
+ - **event:** ajout d'un event pour tracker le `header` et les voir plus de la page `home` ([#5124](https://github.com/SocialGouv/code-du-travail-numerique/issues/5124)) ([44a29d8](https://github.com/SocialGouv/code-du-travail-numerique/commit/44a29d8e019cf5ea2ba3237b2dd5bdae33825472))
16
+ - **indemnite de licenciement:** add cc 1516 ([#5031](https://github.com/SocialGouv/code-du-travail-numerique/issues/5031)) ([fb36106](https://github.com/SocialGouv/code-du-travail-numerique/commit/fb36106ba6541794fda293accc7d4801fd038671))
17
+ - **indemnité de licenciement:** add cc 1606 ([#5087](https://github.com/SocialGouv/code-du-travail-numerique/issues/5087)) ([bdf36ed](https://github.com/SocialGouv/code-du-travail-numerique/commit/bdf36ed6092d3ff40a4bda1020b8876a4b7c29c0))
18
+ - **indemnite de licenciement:** add cc 2148 ([#5034](https://github.com/SocialGouv/code-du-travail-numerique/issues/5034)) ([e191681](https://github.com/SocialGouv/code-du-travail-numerique/commit/e191681a59917c79009fc1ead846be5250ebb158))
19
+ - **indemnité de licenciement:** Ne pas poser la question "le motif est-il économique ?" si l'usager a indiqué qu'il était en inaptitude pro à l'étape "contrat de travail" ([#5119](https://github.com/SocialGouv/code-du-travail-numerique/issues/5119)) ([60d9d12](https://github.com/SocialGouv/code-du-travail-numerique/commit/60d9d12fff0f449c42d811632d4b9a869dd4cb67))
20
+ - indemnite licenciement 1043 ([#5129](https://github.com/SocialGouv/code-du-travail-numerique/issues/5129)) ([7dbec04](https://github.com/SocialGouv/code-du-travail-numerique/commit/7dbec0496453c2d48e79ac165d1d59a4a87397a9))
21
+ - indemnite licenciement 275 fix métier ([#5112](https://github.com/SocialGouv/code-du-travail-numerique/issues/5112)) ([ca4fc4c](https://github.com/SocialGouv/code-du-travail-numerique/commit/ca4fc4c5082817fb2c4e85b3c2f763b9c788957a))
22
+ - **indemnite-licenciement:** activation CC 675 - 1996 - 1505 - 1147 ([#5156](https://github.com/SocialGouv/code-du-travail-numerique/issues/5156)) ([e88a5e0](https://github.com/SocialGouv/code-du-travail-numerique/commit/e88a5e0502a8741ac3e6b1aa75f3756ab3143293))
23
+ - **indemnite-licenciement:** ajout de la cc 1672 ([#4993](https://github.com/SocialGouv/code-du-travail-numerique/issues/4993)) ([adfeb7f](https://github.com/SocialGouv/code-du-travail-numerique/commit/adfeb7f7de3d6d4a22edfaf33a0dea5c8c3464a9))
24
+ - **indemnite-licenciement:** nouvelles règles pour la CC 1486 ([#5143](https://github.com/SocialGouv/code-du-travail-numerique/issues/5143)) ([811b13f](https://github.com/SocialGouv/code-du-travail-numerique/commit/811b13f0230a36c403f36bc2025a5e34e03a5ee9))
25
+
26
+ ## [4.98.1](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.98.0...v4.98.1) (2023-04-20)
27
+
28
+ **Note:** Version bump only for package @socialgouv/modeles-social
29
+
6
30
  # [4.98.0](https://github.com/SocialGouv/code-du-travail-numerique/compare/v4.97.1...v4.98.0) (2023-04-20)
7
31
 
8
32
  ### Bug Fixes
@@ -4,6 +4,7 @@ declare global {
4
4
  toContainTitre: () => R;
5
5
  toContainQuestion: () => R;
6
6
  toContainValidCdtnType: () => R;
7
+ toHaveNextMissingRule: (rule: string | null) => R;
7
8
  }
8
9
  }
9
10
  }
@@ -50,5 +50,28 @@ expect.extend({
50
50
  pass: validCdtnType.includes(type),
51
51
  };
52
52
  },
53
+ toHaveNextMissingRule: function (missingVariables, rule) {
54
+ var missingVars = missingVariables
55
+ .filter(function (arg) { return arg.rawNode.cdtn !== undefined; })
56
+ .sort(function (a, b) { return b.indice - a.indice; });
57
+ if (missingVars.length === 0) {
58
+ return {
59
+ message: function () {
60
+ return "Expected next question to be ".concat(rule, " but received no next question");
61
+ },
62
+ pass: rule === null,
63
+ };
64
+ }
65
+ var nextRule = replaceAll(missingVars[0].name, " - ", " . ");
66
+ return {
67
+ message: function () {
68
+ return "Expected next question to be ".concat(rule, " but received ").concat(nextRule);
69
+ },
70
+ pass: nextRule === rule,
71
+ };
72
+ },
53
73
  });
74
+ var replaceAll = function (string, search, replace) {
75
+ return string.split(search).join(replace);
76
+ };
54
77
  exports.default = undefined;
@@ -13,8 +13,10 @@ var _675_habillement_commerce_succursales_1 = require("../../conventions/675_hab
13
13
  var _1486_bureaux_etudes_techniques_1 = require("../../conventions/1486_bureaux_etudes_techniques");
14
14
  var _1516_organismes_formation_1 = require("../../conventions/1516_organismes_formation");
15
15
  var _1527_immobilier_1 = require("../../conventions/1527_immobilier");
16
+ var _1672_societes_assurances_1 = require("../../conventions/1672_societes_assurances");
16
17
  var _2098_personnel_presta_service_tertiaire_1 = require("../../conventions/2098_personnel_presta_service_tertiaire");
17
- var salary_1 = require("../../conventions/2596_coiffure/salary");
18
+ var salary_1 = require("../../conventions/2148_telecommunications/salary");
19
+ var salary_2 = require("../../conventions/2596_coiffure/salary");
18
20
  var _3239_particuliers_employeurs_domicile_1 = require("../../conventions/3239_particuliers_employeurs_domicile");
19
21
  var __1 = require("..");
20
22
  var ReferenceSalaryFactory = /** @class */ (function () {
@@ -24,6 +26,8 @@ var ReferenceSalaryFactory = /** @class */ (function () {
24
26
  switch (idcc) {
25
27
  case __1.SupportedCcIndemniteLicenciement.IDCC1516:
26
28
  return new _1516_organismes_formation_1.ReferenceSalary1516();
29
+ case __1.SupportedCcIndemniteLicenciement.IDCC1606:
30
+ return new conventions_1.ReferenceSalary1606();
27
31
  case __1.SupportedCcIndemniteLicenciement.IDCC413:
28
32
  return new _413_handicap_1.ReferenceSalary413();
29
33
  case __1.SupportedCcIndemniteLicenciement.IDCC1486:
@@ -41,15 +45,19 @@ var ReferenceSalaryFactory = /** @class */ (function () {
41
45
  case __1.SupportedCcIndemniteLicenciement.IDCC0029:
42
46
  return new _29_hospitalisation_privee_but_non_lucratif_1.ReferenceSalary0029();
43
47
  case __1.SupportedCcIndemniteLicenciement.IDCC2596:
44
- return new salary_1.ReferenceSalary2596();
48
+ return new salary_2.ReferenceSalary2596();
45
49
  case __1.SupportedCcIndemniteLicenciement.IDCC2098:
46
50
  return new _2098_personnel_presta_service_tertiaire_1.ReferenceSalary2098();
47
51
  case __1.SupportedCcIndemniteLicenciement.IDCC2609:
48
52
  return new conventions_1.ReferenceSalary2609();
53
+ case __1.SupportedCcIndemniteLicenciement.IDCC2148:
54
+ return new salary_1.ReferenceSalary2148();
49
55
  case __1.SupportedCcIndemniteLicenciement.IDCC2614:
50
56
  return new conventions_1.ReferenceSalary2614();
51
57
  case __1.SupportedCcIndemniteLicenciement.IDCC0675:
52
58
  return new _675_habillement_commerce_succursales_1.ReferenceSalary675();
59
+ case __1.SupportedCcIndemniteLicenciement.IDCC1672:
60
+ return new _1672_societes_assurances_1.ReferenceSalary1672();
53
61
  case __1.SupportedCcIndemniteLicenciement.IDCC0086:
54
62
  return new _86_publicite_francaise_1.ReferenceSalary86();
55
63
  case __1.SupportedCcIndemniteLicenciement.default:
@@ -53,6 +53,10 @@ var SeniorityFactory = /** @class */ (function () {
53
53
  return new conventions_1.Seniority1597();
54
54
  case index_1.SupportedCcIndemniteLicenciement.IDCC275:
55
55
  return new conventions_1.Seniority275();
56
+ case index_1.SupportedCcIndemniteLicenciement.IDCC1606:
57
+ return new conventions_1.Seniority1606();
58
+ case index_1.SupportedCcIndemniteLicenciement.IDCC1672:
59
+ return new conventions_1.Seniority1672();
56
60
  case index_1.SupportedCcIndemniteLicenciement.default:
57
61
  default:
58
62
  return new base_1.SeniorityLegal();
@@ -1,6 +1,7 @@
1
1
  export declare enum SupportedCcIndemniteLicenciement {
2
2
  IDCC1505 = "1505",
3
3
  IDCC1516 = "1516",
4
+ IDCC1606 = "1606",
4
5
  IDCC1518 = "1518",
5
6
  IDCC2511 = "2511",
6
7
  IDCC2264 = "2264",
@@ -36,7 +37,10 @@ export declare enum SupportedCcIndemniteLicenciement {
36
37
  IDCC2614 = "2614",
37
38
  IDCC1266 = "1266",
38
39
  IDCC275 = "275",
40
+ IDCC1043 = "1043",
41
+ IDCC1672 = "1672",
39
42
  IDCC0086 = "86",
43
+ IDCC2148 = "2148",
40
44
  default = "default"
41
45
  }
42
46
  export declare const INDEMNITE_LICENCIEMENT_PRODUCTION_READY_CC: number[];
@@ -6,6 +6,7 @@ var SupportedCcIndemniteLicenciement;
6
6
  (function (SupportedCcIndemniteLicenciement) {
7
7
  SupportedCcIndemniteLicenciement["IDCC1505"] = "1505";
8
8
  SupportedCcIndemniteLicenciement["IDCC1516"] = "1516";
9
+ SupportedCcIndemniteLicenciement["IDCC1606"] = "1606";
9
10
  SupportedCcIndemniteLicenciement["IDCC1518"] = "1518";
10
11
  SupportedCcIndemniteLicenciement["IDCC2511"] = "2511";
11
12
  SupportedCcIndemniteLicenciement["IDCC2264"] = "2264";
@@ -41,12 +42,16 @@ var SupportedCcIndemniteLicenciement;
41
42
  SupportedCcIndemniteLicenciement["IDCC2614"] = "2614";
42
43
  SupportedCcIndemniteLicenciement["IDCC1266"] = "1266";
43
44
  SupportedCcIndemniteLicenciement["IDCC275"] = "275";
45
+ SupportedCcIndemniteLicenciement["IDCC1043"] = "1043";
46
+ SupportedCcIndemniteLicenciement["IDCC1672"] = "1672";
44
47
  SupportedCcIndemniteLicenciement["IDCC0086"] = "86";
48
+ SupportedCcIndemniteLicenciement["IDCC2148"] = "2148";
45
49
  SupportedCcIndemniteLicenciement["default"] = "default";
46
50
  })(SupportedCcIndemniteLicenciement = exports.SupportedCcIndemniteLicenciement || (exports.SupportedCcIndemniteLicenciement = {}));
47
51
  exports.INDEMNITE_LICENCIEMENT_PRODUCTION_READY_CC = [
48
52
  16, 29, 44, 413, 573, 650, 1090, 1351, 1486, 1501, 1518, 1527, 1596, 1597,
49
53
  1979, 2216, 2264, 2941, 3043, 3127, 3239, 1517, 2098, 2511, 2609, 787, 843,
54
+ 675, 1996, 1505, 1147,
50
55
  ];
51
56
  var getSupportedAgreement = function (idcc) {
52
57
  for (var _i = 0, _a = Object.values(SupportedCcIndemniteLicenciement); _i < _a.length; _i++) {
@@ -1,5 +1,5 @@
1
1
  import type { LegalReferenceSalaryProps } from "../../base";
2
- import type { CC16ReferenceSalaryProps, CC29ReferenceSalaryProps, CC44ReferenceSalaryProps, CC573ReferenceSalaryProps, CC675ReferenceSalaryProps, CC1486ReferenceSalaryProps, CC1516ReferenceSalaryProps, CC1527ReferenceSalaryProps, CC2098ReferenceSalaryProps, CC2596ReferenceSalaryProps, CC2609ReferenceSalaryProps, CC2614ReferenceSalaryProps, CC3239ReferenceSalaryProps } from "../../conventions";
2
+ import type { CC16ReferenceSalaryProps, CC29ReferenceSalaryProps, CC44ReferenceSalaryProps, CC573ReferenceSalaryProps, CC675ReferenceSalaryProps, CC1486ReferenceSalaryProps, CC1516ReferenceSalaryProps, CC1527ReferenceSalaryProps, CC1672ReferenceSalaryProps, CC2098ReferenceSalaryProps, CC2148ReferenceSalaryProps, CC2596ReferenceSalaryProps, CC2609ReferenceSalaryProps, CC2614ReferenceSalaryProps, CC3239ReferenceSalaryProps } from "../../conventions";
3
3
  import type { SupportedCcIndemniteLicenciement } from "..";
4
4
  export type SalaryPeriods = {
5
5
  month: string;
@@ -10,4 +10,4 @@ export interface IReferenceSalary<T extends SupportedCcIndemniteLicenciement> {
10
10
  computeReferenceSalary: (args: ReferenceSalaryProps<T>) => number;
11
11
  computeExtraInfo?: (args: ReferenceSalaryProps<T>) => Record<string, number | string>;
12
12
  }
13
- export type ReferenceSalaryProps<T> = T extends SupportedCcIndemniteLicenciement.IDCC0016 ? CC16ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC0029 ? CC29ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC0044 ? CC44ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC0573 ? CC573ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC1486 ? CC1486ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC1516 ? CC1516ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC1527 ? CC1527ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC2098 ? CC2098ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC2596 ? CC2596ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC2609 ? CC2609ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC2614 ? CC2614ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC3239 ? CC3239ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC0675 ? CC675ReferenceSalaryProps : LegalReferenceSalaryProps;
13
+ export type ReferenceSalaryProps<T> = T extends SupportedCcIndemniteLicenciement.IDCC0016 ? CC16ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC0029 ? CC29ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC0044 ? CC44ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC0573 ? CC573ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC1486 ? CC1486ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC1516 ? CC1516ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC1527 ? CC1527ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC2098 ? CC2098ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC2596 ? CC2596ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC2609 ? CC2609ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC2148 ? CC2148ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC2614 ? CC2614ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC3239 ? CC3239ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC0675 ? CC675ReferenceSalaryProps : T extends SupportedCcIndemniteLicenciement.IDCC1672 ? CC1672ReferenceSalaryProps : LegalReferenceSalaryProps;
@@ -1,4 +1,5 @@
1
1
  import type { CC0016SeniorityProps, CC0413SeniorityProps } from "../../conventions";
2
+ import type { CC1672SeniorityProps } from "../../conventions/1672_societes_assurances/seniority";
2
3
  import type { MotifKeys } from "../motif-keys";
3
4
  import type { DefaultSeniorityProps, DefaultSeniorityRequiredProps } from "../seniority";
4
5
  import type { SupportedCcIndemniteLicenciement } from "../supported-agreements";
@@ -23,7 +24,7 @@ export interface ISeniority<T extends SupportedCcIndemniteLicenciement> {
23
24
  getMotifs: () => Motif[];
24
25
  }
25
26
  export type SeniorityRequiredProps = DefaultSeniorityRequiredProps;
26
- export type SeniorityProps<T> = T extends SupportedCcIndemniteLicenciement.IDCC0016 ? CC0016SeniorityProps : T extends SupportedCcIndemniteLicenciement.IDCC413 ? CC0413SeniorityProps : DefaultSeniorityProps;
27
+ export type SeniorityProps<T> = T extends SupportedCcIndemniteLicenciement.IDCC0016 ? CC0016SeniorityProps : T extends SupportedCcIndemniteLicenciement.IDCC413 ? CC0413SeniorityProps : T extends SupportedCcIndemniteLicenciement.IDCC1672 ? CC1672SeniorityProps : DefaultSeniorityProps;
27
28
  export type SeniorityResult = {
28
29
  value: number;
29
30
  extraInfos?: Record<string, number | string>;
@@ -12,7 +12,7 @@ var date2021 = (0, date_fns_1.parse)("05/04/2021", "dd/MM/yyyy", new Date());
12
12
  var exitIn2020 = (0, date_fns_1.parse)("10/11/2020", "dd/MM/yyyy", new Date());
13
13
  var exitIn2021 = (0, date_fns_1.parse)("12/06/2021", "dd/MM/yyyy", new Date());
14
14
  describe("Accumulation d'absence par année", function () {
15
- test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n absences | years | expectedOutput\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n absences | years | expectedOutput\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), [], [], [], [{ durationInMonth: 1, startedAt: "02/06/2020" }], [{ begin: date2020, end: exitIn2020 }], [{ totalAbsenceInMonth: 1, year: 2020 }], [{ durationInMonth: 1, startedAt: "10/05/2020" }, { durationInMonth: 2, startedAt: "10/07/2020" }], [{ begin: date2020, end: exitIn2020 }], [{ totalAbsenceInMonth: 3, year: 2020 }], [{ durationInMonth: 3, startedAt: "10/07/2020" }, { durationInMonth: 2, startedAt: "10/04/2021" }], [{ begin: date2020, end: date2021LessOneDay }, { begin: date2021, end: exitIn2021 }], [{ totalAbsenceInMonth: 3, year: 2020 }, { totalAbsenceInMonth: 2, year: 2021 }], [{ durationInMonth: 1, startedAt: "20/03/2021" }], [{ begin: date2020, end: date2021LessOneDay }, { begin: date2021, end: exitIn2021 }], [{ totalAbsenceInMonth: 0.5, year: 2020 }, { totalAbsenceInMonth: 0.4666666666666667, year: 2021 }])("Avec $absences.length absence(s) et $years.length année(s) on attend $expectedOutput.length découpe(s) par année", function (_a) {
15
+ test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n absences | years | expectedOutput\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "], ["\n absences | years | expectedOutput\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n ", " | ", " | ", "\n "])), [], [], [], [{ durationInMonth: 1, startedAt: "02/06/2020", motif: { value: 1 } }], [{ begin: date2020, end: exitIn2020 }], [{ totalAbsenceInMonth: 1, year: 2020 }], [{ durationInMonth: 1, startedAt: "10/05/2020", motif: { value: 1 } }, { durationInMonth: 2, startedAt: "10/07/2020", motif: { value: 1 } }], [{ begin: date2020, end: exitIn2020 }], [{ totalAbsenceInMonth: 3, year: 2020 }], [{ durationInMonth: 3, startedAt: "10/07/2020", motif: { value: 1 } }, { durationInMonth: 2, startedAt: "10/04/2021", motif: { value: 1 } }], [{ begin: date2020, end: date2021LessOneDay }, { begin: date2021, end: exitIn2021 }], [{ totalAbsenceInMonth: 3, year: 2020 }, { totalAbsenceInMonth: 2, year: 2021 }], [{ durationInMonth: 1, startedAt: "20/03/2021", motif: { value: 1 } }], [{ begin: date2020, end: date2021LessOneDay }, { begin: date2021, end: exitIn2021 }], [{ totalAbsenceInMonth: 0.5, year: 2020 }, { totalAbsenceInMonth: 0.4666666666666667, year: 2021 }])("Avec $absences.length absence(s) et $years.length année(s) on attend $expectedOutput.length découpe(s) par année", function (_a) {
16
16
  var absences = _a.absences, years = _a.years, expectedOutput = _a.expectedOutput;
17
17
  var result = (0, __1.accumulateAbsenceByYear)(absences, years);
18
18
  expect(result).toEqual(expectedOutput);
@@ -12,3 +12,32 @@ test("should convert enum to array", function () {
12
12
  { label: "B", value: "b" },
13
13
  ]);
14
14
  });
15
+ describe("Merge two arrays", function () {
16
+ var data1 = { key1: "value1" };
17
+ var data1Bis = { key1: "value11" };
18
+ var data2 = { key2: "value2" };
19
+ var data2Bis = { key2: "value22" };
20
+ test("two empty arrays", function () {
21
+ expect((0, array_1.mergeTwoArray)([], [])).toEqual([]);
22
+ });
23
+ test("left array not empty, right array empty", function () {
24
+ expect((0, array_1.mergeTwoArray)([data1], [])).toEqual([data1]);
25
+ });
26
+ test("left array empty, right array not empty", function () {
27
+ expect((0, array_1.mergeTwoArray)([], [data1])).toEqual([data1]);
28
+ });
29
+ test("left and right array has same content", function () {
30
+ expect((0, array_1.mergeTwoArray)([data1], [data1])).toEqual([data1]);
31
+ expect((0, array_1.mergeTwoArray)([data1, data2], [data1, data2])).toEqual([
32
+ data1,
33
+ data2,
34
+ ]);
35
+ });
36
+ test("right has same key with updated content", function () {
37
+ expect((0, array_1.mergeTwoArray)([data1], [data1Bis])).toEqual([data1Bis]);
38
+ expect((0, array_1.mergeTwoArray)([data1, data2], [data1Bis, data2Bis])).toEqual([
39
+ data1Bis,
40
+ data2Bis,
41
+ ]);
42
+ });
43
+ });
@@ -84,6 +84,21 @@ describe("Formula", function () {
84
84
  }).toThrow(/L'unité est manquante pour la règle 'panier . quantité'/);
85
85
  });
86
86
  });
87
+ describe("règle active contenant des explications mais avec une explication dupliquée", function () {
88
+ beforeEach(function () {
89
+ engine = new publicodes_1.default(parseData("formule_avec_explanations_dupliqués.yaml"));
90
+ });
91
+ test("doit retirer l'explication dupliquée", function () {
92
+ var situation = engine.setSituation();
93
+ var formule = (0, formula_1.getFormule)(situation);
94
+ expect(formule.formula).toEqual("Prix * Quantité * TVA");
95
+ expect(formule.explanations).toEqual([
96
+ "Prix (18 €)",
97
+ "Quantité (10 litres)",
98
+ "TVA (20 pourcents)",
99
+ ]);
100
+ });
101
+ });
87
102
  describe("règle contenant des annotations", function () {
88
103
  beforeEach(function () {
89
104
  engine = new publicodes_1.default(parseData("formule_avec_annotations.yaml"));
@@ -3,3 +3,4 @@ export declare const enumToArray: <T>(enumObject: any) => {
3
3
  label: string;
4
4
  value: T;
5
5
  }[];
6
+ export declare const mergeTwoArray: (left: Record<string, string>[], right: Record<string, string>[]) => Record<string, string>[];
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enumToArray = exports.nonNullable = void 0;
3
+ exports.mergeTwoArray = exports.enumToArray = exports.nonNullable = void 0;
4
4
  function nonNullable(value) {
5
5
  return value !== null && value !== undefined;
6
6
  }
@@ -14,3 +14,21 @@ var enumToArray = function (enumObject) {
14
14
  });
15
15
  };
16
16
  exports.enumToArray = enumToArray;
17
+ var mergeTwoArray = function (left, right) {
18
+ if (left.length === 0) {
19
+ return right;
20
+ }
21
+ if (right.length === 0) {
22
+ return left;
23
+ }
24
+ var merged = left.concat(right);
25
+ return merged.reduce(function (acc, current) {
26
+ var index = acc.findIndex(function (data) { return Object.keys(data)[0] === Object.keys(current)[0]; });
27
+ if (index === -1) {
28
+ return acc.concat(current);
29
+ }
30
+ acc[index] = current;
31
+ return acc;
32
+ }, []);
33
+ };
34
+ exports.mergeTwoArray = mergeTwoArray;
@@ -1,6 +1,3 @@
1
1
  export declare function isFloat(n: number): boolean;
2
- export declare function formatNumber(toBeFormatted: number): string;
3
2
  export declare const sum: (values: number[]) => number;
4
3
  export declare const round: (value: number, decimals?: number) => number;
5
- export declare const yearPlural: (value: number) => string;
6
- export declare const min0: (value: number) => number;
@@ -1,14 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.min0 = exports.yearPlural = exports.round = exports.sum = exports.formatNumber = exports.isFloat = void 0;
3
+ exports.round = exports.sum = exports.isFloat = void 0;
4
4
  function isFloat(n) {
5
5
  return Number(n) === n && n % 1 !== 0;
6
6
  }
7
7
  exports.isFloat = isFloat;
8
- function formatNumber(toBeFormatted) {
9
- return isNaN(toBeFormatted) ? "0" : toBeFormatted.toString();
10
- }
11
- exports.formatNumber = formatNumber;
12
8
  var sum = function (values) {
13
9
  return values.reduce(function (a, b) { return a + b; }, 0);
14
10
  };
@@ -19,11 +15,3 @@ var round = function (value, decimals) {
19
15
  return Math.round(value * tenToPower) / tenToPower;
20
16
  };
21
17
  exports.round = round;
22
- var yearPlural = function (value) {
23
- return (0, exports.round)(value) < 2 ? "an" : "ans";
24
- };
25
- exports.yearPlural = yearPlural;
26
- var min0 = function (value) {
27
- return Math.max(value, 0);
28
- };
29
- exports.min0 = min0;
@@ -38,7 +38,7 @@ function getFormule(engine) {
38
38
  if (formule.formula.length) {
39
39
  formule.formula = nodeFormule.replace(FORMULE_VAR_REGEX, formule.formula);
40
40
  }
41
- formule.explanations = formule.explanations.concat((_a = rule.rawNode.cdtn.formule.explanations) !== null && _a !== void 0 ? _a : []);
41
+ formule.explanations = (0, array_1.mergeTwoArray)(formule.explanations, (_a = rule.rawNode.cdtn.formule.explanations) !== null && _a !== void 0 ? _a : []);
42
42
  formule.annotations = formule.annotations.concat((_b = rule.rawNode.cdtn.formule.annotations) !== null && _b !== void 0 ? _b : []);
43
43
  }
44
44
  else {
@@ -131,7 +131,9 @@ var absenceDurationRatio = function (absence, year) {
131
131
  days: DAYS_IN_ONE_MONTH * absence.durationInMonth,
132
132
  });
133
133
  if (absenceStartAt >= year.begin && absenceEndAt <= year.end) {
134
- return absence.durationInMonth;
134
+ return absence.durationInMonth * absence.motif.value;
135
135
  }
136
- return ((0, date_fns_1.getOverlappingDaysInIntervals)({ end: absenceEndAt, start: absenceStartAt }, { end: year.end, start: year.begin }) / DAYS_IN_ONE_MONTH);
136
+ return (((0, date_fns_1.getOverlappingDaysInIntervals)({ end: absenceEndAt, start: absenceStartAt }, { end: year.end, start: year.begin }) /
137
+ DAYS_IN_ONE_MONTH) *
138
+ absence.motif.value);
137
139
  };
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var publicodes_1 = require("../../../../../publicodes");
4
+ var engine = new publicodes_1.IndemniteLicenciementPublicodes(modelsIndemniteLicenciement, "1043");
5
+ describe("Formule indemnité licenciement - CC 1043", function () {
6
+ test.each([
7
+ {
8
+ expectedExplanations: [],
9
+ expectedFormula: "",
10
+ seniority: 1,
11
+ },
12
+ {
13
+ expectedExplanations: [
14
+ "A : Ancienneté totale (7 ans)",
15
+ "Sref : Salaire de référence (1000 €)",
16
+ ],
17
+ expectedFormula: "1/5 * Sref * A",
18
+ seniority: 7,
19
+ },
20
+ {
21
+ expectedExplanations: [
22
+ "A1 : Ancienneté totale (19 ans)",
23
+ "A2 : Ancienneté au-delà de 7 ans (12 ans)",
24
+ "Sref : Salaire de référence (1000 €)",
25
+ ],
26
+ expectedFormula: "(1/5 * Sref * A1) + (2/15 * Sref * A2)",
27
+ seniority: 19,
28
+ },
29
+ {
30
+ expectedExplanations: [
31
+ "A1 : Ancienneté totale (27 ans)",
32
+ "A2 : Ancienneté au-delà de 7 ans (20 ans)",
33
+ "A3 : Ancienneté au-delà de 19 ans (8 ans)",
34
+ "Sref : Salaire de référence (1000 €)",
35
+ ],
36
+ expectedFormula: "(1/5 * Sref * A1) + (2/15 * Sref * A2) + (1/10 * Sref * A3)",
37
+ seniority: 27,
38
+ },
39
+ ])("Formule $expectedFormula avec une ancienneté de $seniority ans", function (_a) {
40
+ var seniority = _a.seniority, expectedFormula = _a.expectedFormula, expectedExplanations = _a.expectedExplanations;
41
+ engine.setSituation({
42
+ "contrat salarié . convention collective": "'IDCC1043'",
43
+ "contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année": seniority.toString(),
44
+ "contrat salarié . indemnité de licenciement . ancienneté conventionnelle requise en année": seniority.toString(),
45
+ "contrat salarié . indemnité de licenciement . salaire de référence conventionnel": "1000",
46
+ });
47
+ var result = engine.getFormule();
48
+ expect(result.formula).toEqual(expectedFormula);
49
+ expect(result.explanations).toEqual(expectedExplanations);
50
+ });
51
+ });
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ var publicodes_1 = require("../../../../../publicodes");
8
+ var engine = new publicodes_1.IndemniteLicenciementPublicodes(modelsIndemniteLicenciement, "1043");
9
+ describe("CC 1043", function () {
10
+ describe("Calcul de l'indemnité de licenciement", function () {
11
+ test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n seniorityRight | seniority | salaireRef | expectedCompensation\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "], ["\n seniorityRight | seniority | salaireRef | expectedCompensation\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n ", " | ", " | ", " | ", "\n "])), 0.91, 1, 2464, 0, 0.91, 7, 2464, 0, 0.91, 19, 2464, 0, 0.91, 27, 2464, 0, 2, 7, 2464, 3449.6, 2, 19, 2464, 13305.6, 2, 27, 2464, 21847.47)("Avec une ancienneté $seniority ans, un salaire de référence $salaireRef € => une compensation de base de $expectedCompensation €", function (_a) {
12
+ var _b;
13
+ var salaireRef = _a.salaireRef, expectedCompensation = _a.expectedCompensation, seniority = _a.seniority, seniorityRight = _a.seniorityRight;
14
+ var _c = engine.setSituation({
15
+ "contrat salarié . convention collective": "'IDCC1043'",
16
+ "contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année": seniority,
17
+ "contrat salarié . indemnité de licenciement . ancienneté conventionnelle requise en année": seniorityRight,
18
+ "contrat salarié . indemnité de licenciement . salaire de référence conventionnel": salaireRef,
19
+ }, "contrat salarié . indemnité de licenciement . résultat conventionnel"), result = _c.result, missingArgs = _c.missingArgs;
20
+ expect((_b = result.unit) === null || _b === void 0 ? void 0 : _b.numerators).toEqual(["€"]);
21
+ expect(missingArgs).toEqual([]);
22
+ expect(result.value).toEqual(expectedCompensation);
23
+ });
24
+ });
25
+ });
26
+ var templateObject_1;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ var publicodes_1 = require("../../../../../publicodes");
8
+ var engine = new publicodes_1.IndemniteLicenciementPublicodes(modelsIndemniteLicenciement, "1043");
9
+ describe("Vérification des références juridiques pour la CC 1043", function () {
10
+ var references = [
11
+ {
12
+ article: "Article 16",
13
+ url: "https://www.legifrance.gouv.fr/conv_coll/article/KALIARTI000034978460",
14
+ },
15
+ ];
16
+ test.each(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n seniority | expectedReferences\n ", " | ", "\n ", " | ", "\n ", " | ", "\n ", " | ", "\n ", " | ", "\n "], ["\n seniority | expectedReferences\n ", " | ", "\n ", " | ", "\n ", " | ", "\n ", " | ", "\n ", " | ", "\n "])), 5, references, 10, references, 15, references, 20, references, 25, references)("avec une ancienneté de $seniority ans", function (_a) {
17
+ var seniority = _a.seniority, expectedReferences = _a.expectedReferences;
18
+ engine.setSituation({
19
+ "contrat salarié . convention collective": "'IDCC1043'",
20
+ "contrat salarié . indemnité de licenciement . ancienneté conventionnelle en année": seniority,
21
+ "contrat salarié . indemnité de licenciement . ancienneté conventionnelle requise en année": seniority,
22
+ "contrat salarié . indemnité de licenciement . salaire de référence conventionnel": "1000",
23
+ });
24
+ var result = engine.getReferences("résultat conventionnel");
25
+ expect(result).toHaveLength(expectedReferences.length);
26
+ expect(result).toEqual(expect.arrayContaining(expectedReferences));
27
+ });
28
+ });
29
+ var templateObject_1;
@@ -6,10 +6,10 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
7
  var common_1 = require("../../../../common");
8
8
  describe("CC 1486", function () {
9
+ var seniority = new common_1.SeniorityFactory().create(common_1.SupportedCcIndemniteLicenciement.IDCC1486);
9
10
  describe("Calcul de l'ancienneté", function () {
10
11
  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 "], ["\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 "])), [], "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: 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: 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/02/2020", "20/02/2021", 0.5416666666666666, [{ 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: 4, 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: 5, 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: 6, 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: 7, 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 - 1 / 12, [{ durationInMonth: 8, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 7, motif: { key: common_1.MotifKeys.maladieNonPro } }], "01/01/1979", "01/01/2021", 42 - 3 / 12, [{ durationInMonth: 6, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 6, motif: { key: common_1.MotifKeys.maladieNonPro } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 3, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 3, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 2, motif: { key: common_1.MotifKeys.maladieNonPro } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 6, motif: { key: common_1.MotifKeys.maladieNonPro } }, { durationInMonth: 6, motif: { key: common_1.MotifKeys.accidentTrajet } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 7, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 9, motif: { key: common_1.MotifKeys.accidentTrajet } }], "01/01/1979", "01/01/2021", 42 - 4 / 12, [{ durationInMonth: 6, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 6, motif: { key: common_1.MotifKeys.accidentTrajet } }], "01/01/1979", "01/01/2021", 42, [{ durationInMonth: 3, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 3, motif: { key: common_1.MotifKeys.accidentTrajet } }, { durationInMonth: 2, motif: { key: common_1.MotifKeys.accidentTrajet } }], "01/01/1979", "01/01/2021", 42, [{ 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
12
  var absences = _a.absences, entryDate = _a.entryDate, exitDate = _a.exitDate, expectedAnciennete = _a.expectedAnciennete;
12
- var seniority = new common_1.SeniorityFactory().create(common_1.SupportedCcIndemniteLicenciement.IDCC1486);
13
13
  var result = seniority.computeSeniority({
14
14
  absencePeriods: absences,
15
15
  dateEntree: entryDate,
@@ -18,5 +18,27 @@ describe("CC 1486", function () {
18
18
  expect(result.value).toEqual(expectedAnciennete);
19
19
  });
20
20
  });
21
+ describe("Utilisation de l'ancienne ou la nouvelle règle de calcul", function () {
22
+ test("avec une date de sortie avant le 01/05/2023", function () {
23
+ var result = seniority.computeSeniority({
24
+ absencePeriods: [],
25
+ dateEntree: "01/01/2020",
26
+ dateSortie: "30/04/2023",
27
+ });
28
+ expect(result.extraInfos).toEqual({
29
+ "contrat salarié . convention collective . bureaux études techniques . indemnité de licenciement . utilisation des anciennes règles de calcul": "oui",
30
+ });
31
+ });
32
+ test("avec une date de sortie après le 01/05/2023", function () {
33
+ var result = seniority.computeSeniority({
34
+ absencePeriods: [],
35
+ dateEntree: "01/01/2020",
36
+ dateSortie: "01/05/2023",
37
+ });
38
+ expect(result.extraInfos).toEqual({
39
+ "contrat salarié . convention collective . bureaux études techniques . indemnité de licenciement . utilisation des anciennes règles de calcul": "non",
40
+ });
41
+ });
42
+ });
21
43
  });
22
44
  var templateObject_1;