catala/french_law/js
2021-06-21 11:54:56 +02:00
..
.gitignore Big renaming and dir reorg 2021-06-21 11:39:06 +02:00
allocations_familiales.js Big renaming and dir reorg 2021-06-21 11:39:06 +02:00
french_law.js Big renaming and dir reorg 2021-06-21 11:39:06 +02:00
Makefile Install JS dependencies correctly 2021-06-21 11:54:56 +02:00
package-lock.json Big renaming and dir reorg 2021-06-21 11:39:06 +02:00
package.json Big renaming and dir reorg 2021-06-21 11:39:06 +02:00
README.md Big renaming and dir reorg 2021-06-21 11:39:06 +02: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"