Skip to content
Snippets Groups Projects
Select Git revision
  • c33e7682b2280f65859967f0d3bd85b936e1b65f
  • 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

Blame
  • variables.ts 37.72 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 type BudgetVariableOrganisme =
      | "agirc_arrco"
      | "etat"
      | "securite_sociale"
      | "unedic"
    
    export type BudgetVariableType = "prelevement" | "prestation"
    
    export interface BudgetVariable {
      // Variables groupées par l'impact budgétaire commun qu'elles partagent (celle du nom du groupe) :
      // l'impact budgétaire des variables "filles" d'un groupe correspond à celui de la variable "parent" de ce groupe
      duplicate?: Set<string>
      labels: {
        default: string
        of: string
        ofThe: string
        the: string
        theAlt?: string
      }
      organisme: BudgetVariableOrganisme
      outputVariables: string[]
      quantileBaseVariable: string[]
      quantileCompareVariables: string[]
      type: BudgetVariableType
    }
    
    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",