Select Git revision
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([