diff --git a/openfisca_france_local/metropoles/lyon/revenu_solidaire_jeune.py b/openfisca_france_local/metropoles/lyon/revenu_solidaire_jeune.py index e89427a7..fdfa135b 100644 --- a/openfisca_france_local/metropoles/lyon/revenu_solidaire_jeune.py +++ b/openfisca_france_local/metropoles/lyon/revenu_solidaire_jeune.py @@ -11,9 +11,9 @@ class revenu_solidaire_jeune(Variable): reference = 'https://aides-jeunes.grandlyon.com/#c21886' def formula(individu, period, parameter): - age_eligibles = parameter(period).metropoles.lyon.revenu_solidaire_jeune.age + modalites = parameter(period).metropoles.lyon.revenu_solidaire_jeune age = individu('age', period) - eligibilite_age = (age >= age_eligibles.minimum_inclusif) * (age <= age_eligibles.maximum_inclusif) + eligibilite_age = (age >= modalites.age.minimum_inclusif) * (age <= modalites.age.maximum_inclusif) reside_metropole_lyon = individu.menage('lyon_metropole_eligibilite_geographique', period) @@ -22,7 +22,15 @@ def formula(individu, period, parameter): aeeh = individu.famille('aeeh', period) contrat_engagement_jeune = individu('contrat_engagement_jeune', period) eligibilite_prestations = rsa + aah + aeeh + contrat_engagement_jeune == 0 - pas_en_etude = individu('activite', period) != TypesActivite.etudiant - return 420 * eligibilite_age * reside_metropole_lyon * eligibilite_prestations * pas_en_etude + revenus_activite = ( + individu('salaire_net', period) + + individu('indemnites_stage', period) + + individu.famille('ppa', period) + + individu('revenus_stage_formation_pro', period) + ) + + montant = modalites.montant.calc(revenus_activite) + + return montant * eligibilite_age * reside_metropole_lyon * eligibilite_prestations * pas_en_etude diff --git a/openfisca_france_local/parameters/metropoles/lyon/revenu_solidaire_jeune.yaml b/openfisca_france_local/parameters/metropoles/lyon/revenu_solidaire_jeune.yaml index e4bcea85..3dd2afc4 100644 --- a/openfisca_france_local/parameters/metropoles/lyon/revenu_solidaire_jeune.yaml +++ b/openfisca_france_local/parameters/metropoles/lyon/revenu_solidaire_jeune.yaml @@ -6,3 +6,26 @@ age: maximum_inclusif: values: 2021-06-01: 24 +montant: + description: Montants du Revenu Solidaire Jeune + metadata: + type: single_amount + brackets: + - threshold: + 2021-06-01: + value: 0 + amount: + 2021-06-01: + value: 420 + - threshold: + 2021-06-01: + value: 1 + amount: + 2021-06-01: + value: 315 + - threshold: + 2021-06-01: + value: 401 + amount: + 2021-06-01: + value: 0 \ No newline at end of file diff --git a/tests/metropoles/lyon/revenu_solidaire_jeune.yaml b/tests/metropoles/lyon/revenu_solidaire_jeune.yaml index 70b4a842..f5be3703 100644 --- a/tests/metropoles/lyon/revenu_solidaire_jeune.yaml +++ b/tests/metropoles/lyon/revenu_solidaire_jeune.yaml @@ -1,4 +1,5 @@ -- period: 2023-11 +- name: 'Éligibilité' + period: 2023-11 reforms: - openfisca_france_local.epci_test_factory.epci_reform input: @@ -11,3 +12,18 @@ activite: ['inactif', 'inactif', 'inactif', 'inactif', 'inactif', 'inactif', 'inactif', 'inactif', 'inactif', 'etudiant'] output: revenu_solidaire_jeune: [420, 0, 0, 0, 420, 0, 0, 0, 0, 0] + +- name: Montants + period: 2023-11 + reforms: + - openfisca_france_local.epci_test_factory.epci_reform + input: + age: [18, 18, 18, 18] + depcom: [69003, 69003, 69003, 69003] + contrat_engagement_jeune: [0, 0, 0, 0] + salaire_net: [1, 400, 401, 101] + indemnites_stage: [0, 0, 0, 101] + ppa: [0, 0, 0, 101] + revenus_stage_formation_pro: [0, 0, 0, 101] + output: + revenu_solidaire_jeune: [315, 315, 0, 0]