catala/french_law_js
2021-05-15 19:50:06 +02:00
..
.gitignore Fixed Js and bumped version number 2021-03-18 16:41:55 +01:00
allocations_familiales.js Embedding for structs/enums/arrays 2021-04-08 23:23:10 +02:00
french_law.js Better HTML generation 2021-05-15 19:50:06 +02:00
package-lock.json Bump lodash from 4.17.20 to 4.17.21 in /french_law_js 2021-05-12 00:07:18 +00:00
package.json Bump lodash from 4.17.20 to 4.17.21 in /french_law_js 2021-05-12 00:07:18 +00:00
README.md Fixed Js and bumped version number 2021-03-18 16:41:55 +01:00

The French Law Javascript Library

This Javascript library contains some computations defined by French legislative texts. The JS code is extracted from OCaml, which is itself extracted from Catala code (https://catala-lang.org).

Allocations familiales

The function of the library is computeAllocationsFamiliales. This computation returns the amount of allocations familiales for one household described by the input. More precisely, the result returned is the sum of:

  • la base des allocations familiales
  • l'allocation forfaitaire relai pour dépassement de l'âge limite
  • la majoration pour âge
  • le complément dégressif en cas de dépassement du plafond de revenus

An example of use:

Law.computeAllocationsFamiliales({
  currentDate: new Date("2020-05-20"),
  children: [
    {
      id: 0,
      remunerationMensuelle: 0,
      dateNaissance: new Date("2003-03-02"),
      priseEnCharge: "Effective et permanente",
      aDejaOuvertDroitAuxAllocationsFamiliales: true,
    },
    {
      id: 1,
      remunerationMensuelle: 300,
      dateNaissance: new Date("2013-10-30"),
      priseEnCharge: "Garde alternée, partage des allocations",
      aDejaOuvertDroitAuxAllocationsFamiliales: true,
    },
  ],
  income: 30000,
  residence: "Métropole",
  personneQuiAssumeLaChargeEffectivePermanenteEstParent: true,
  personneQuiAssumeLaChargeEffectivePermanenteRemplitConditionsTitreISecuriteSociale: true,
});

Notably, the priseEnCharge variable for each child expects a value among:

  • "Effective et permanente"
  • "Garde alternée, allocataire unique"
  • "Garde alternée, partage des allocations"
  • "Confié aux service sociaux, allocation versée à la famille"
  • "Confié aux service sociaux, allocation versée aux services sociaux"