Skip to content
Snippets Groups Projects
Select Git revision
  • c7e25a5555863cf6539ad737c57b347eceb68029
  • master default protected
  • 366-signe-a-cote-du-droit-en-vigueur-sur-l-ui-pour-indiquer-que-la-reforme-a-eu-lieu-mais-qu-elle-n
  • revalo_retraites
  • 381-pb-affichage-labels-des-parametres-sur-plus-de-3-lignes
  • ajoute-duplicate-aide-logement
  • poc_castype_ia
  • parametres-editables-budget
  • ui-parametres
  • 355-les-dispositifs-prestations-sociales-du-graphique-se-cachent-montrent-en-meme-temps-2
  • 358-les-variables-dont-le-montant-est-nul-apparaissent-en-bleu-et-non-cliquables
  • 356-ajuster-la-largeur-sur-les-graphiques-budgetaires
  • incoherence_cas_type_0
  • fix-ui-suppression-tranches-baremes
  • ajout-agregat-cehr-version-plf
  • impact_carbone
  • xlsx
  • header_revamp
  • 270-concevoir-la-page-d-accueil-leximpact
  • 219-conversion-des-montants-min-et-max-de-l-axe-des-x-en-smic
  • 294-afficher-le-salaire-des-cas-types-en-nombre-de-smic
  • 0.0.1174
  • 0.0.1173
  • 0.0.1172
  • 0.0.1171
  • 0.0.1170
  • 0.0.1169
  • 0.0.1168
  • 0.0.1167
  • 0.0.1166
  • 0.0.1165
  • 0.0.1164
  • 0.0.1163
  • 0.0.1162
  • 0.0.1161
  • 0.0.1160
  • 0.0.1159
  • 0.0.1158
  • 0.0.1157
  • 0.0.1156
  • 0.0.1155
41 results

variables.ts

  • variables.ts 18.89 KiB
    import variableSummaryByNameUnknown from "@leximpact/socio-fiscal-openfisca-json/variables_summaries.json"
    import type {
      Formula,
      Reference,
      Variable,
      VariableByName,
    } from "@openfisca/json-model"
    
    import type { CalculationName } from "$lib/calculations"
    import { reformChangesByName } from "$lib/reforms"
    
    export interface InstantFormulaAndReferences {
      formula?: Formula
      instant: string
      references: Reference[]
    }
    
    export type ValuesByCalculationNameByVariableName = {
      [variableName: string]: VariableValuesByCalculationName
    }
    
    export type VariableValueByCalculationName = Partial<{
      [calculationName in CalculationName]: VariableValue
    }>
    
    export type VariableValuesByCalculationName = Partial<{
      [calculationName in CalculationName]: VariableValues
    }>
    
    export type VariableValue = boolean | number | string
    
    export type VariableValues = boolean[] | number[] | string[]
    
    export const budgetEditableParametersNameByVariableName: {
      [variableName: string]: Set<string>
    } = {
      af: new Set([
        // Allocation familiale de base
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.nb_enfants_min_pour_allocation",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.age1",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.age2",
        "prestations_sociales.prestations_familiales.bmaf.bmaf",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.taux.enf2",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.taux.enf3",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.taux.nb_enf2",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.taux.nb_enf3",
        // Majoration pour âge
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_maj.maj_age_deux_enfants.age1",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_maj.maj_age_deux_enfants.age2",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_maj.maj_age_deux_enfants.taux1",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_maj.maj_age_deux_enfants.taux2",
        // Allocation forfaitaire
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_maj.majoration_enfants.allocation_forfaitaire.age_minimum",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_maj.majoration_enfants.allocation_forfaitaire.taux",
        // Complément dégressif
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cond_ress.majoration_plafond_par_enfant_supplementaire",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cond_ress.plafond_tranche_2_base",
      ]),
      af_base: new Set([
        // Allocation familiale de base
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.nb_enfants_min_pour_allocation",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.age1",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.age2",
        "prestations_sociales.prestations_familiales.bmaf.bmaf",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.taux.enf2",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.taux.enf3",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.taux.nb_enf2",
        "prestations_sociales.prestations_familiales.prestations_generales.af.af_cm.taux.nb_enf3",
      ]),
      af_majoration: new Set([