Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajout de l'Action Éducative de Promixité pour l'Eure-et-Loir #143

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions openfisca_france_local/departements/eure_et_loir/aep.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from openfisca_france.model.base import Variable, Menage, MONTH

class eure_et_loir_eligibilite_aep(Variable):
value_type = bool
entity = Menage
definition_period = MONTH
label = "En Eure-et-Loir, éligibilité a l'Action Éducative de Promixité (AEP)"
reference = "https://eurelien.fr/wp-content/uploads/2023/01/l_aide_educative_de_proximite.pdf"

def formula(menage, period):
reside_eure_et_loir = menage('eure_et_loir_eligibilite_residence', period)
enfants_a_charge = menage.members('enfant_a_charge', period.this_year)
has_enfants_a_charge = menage.sum(enfants_a_charge) > 0

return reside_eure_et_loir * has_enfants_a_charge
88 changes: 88 additions & 0 deletions tests/departements/eure_et_loir/aep.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas bloquant mais il manque une ligne à la toute fin du fichier.

Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
- name: Eligibilité à l'aide AEP d'Eure-et-Loir avec menage ayant des enfants à charge
period: 2023-01
input:
individus:
parent1:
salaire_imposable: 1000
parent2:
salaire_imposable: 0
enfant1:
age: 8
enfant_a_charge:
2023: True
enfant2:
age: 12
enfant_a_charge:
2023: True
menage:
personne_de_reference: parent1
conjoint: parent2
enfants: [ "enfant1", "enfant2" ]
depcom: 28000
output:
eure_et_loir_eligibilite_aep: True

- name: Eligibilité à l'aide AEP d'Eure-et-Loir avec menage n'ayant pas d'enfants à charge
period: 2023-01
input:
individus:
parent1:
salaire_imposable: 1000
parent2:
salaire_imposable: 0
enfant1:
age: 8
enfant_a_charge:
2023: False
enfant2:
age: 12
enfant_a_charge:
2023: False
menage:
personne_de_reference: parent1
conjoint: parent2
enfants: [ "enfant1", "enfant2" ]
depcom: 28000
output:
eure_et_loir_eligibilite_aep: False

- name: Eligibilité à l'aide AEP d'Eure-et-Loir avec menage n'ayant pas d'enfants
period: 2023-01
input:
individus:
parent1:
salaire_imposable: 1000
parent2:
salaire_imposable: 0
menage:
personne_de_reference: parent1
conjoint: parent2
enfants: []
depcom: 28000
output:
eure_et_loir_eligibilite_aep: False


- name: Eligibilité à l'aide AEP d'Eure-et-Loir avec menage n'habitant pas en Eure-et-Loir
period: 2023-01
input:
individus:
Allan-CodeWorks marked this conversation as resolved.
Show resolved Hide resolved
parent1:
salaire_imposable: 1000
parent2:
salaire_imposable: 0
enfant1:
age: 8
enfant_a_charge:
2023: True
enfant2:
age: 12
enfant_a_charge:
2023: True
menage:
personne_de_reference: parent1
conjoint: parent2
enfants: [ "enfant1", "enfant2" ]
depcom: 45000
output:
eure_et_loir_eligibilite_aep: False