Select Git revision
variables.ts
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",