Skip to content

Commit

Permalink
feat: modélisation de la mutuelle communale de montpellier
Browse files Browse the repository at this point in the history
  • Loading branch information
Shamzic committed Oct 1, 2024
1 parent facab9f commit 442ba97
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
10 changes: 10 additions & 0 deletions openfisca_france_local/communes/montpellier/eligibilite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from openfisca_france.model.base import Menage, MONTH, Variable

class montpellier_eligibilite_residence(Variable):
value_type = bool
entity = Menage
definition_period = MONTH
label = "Éligibilité résidentielle d'un ménage aux dipositifs de Montpellier"

def formula(menage, period):
return menage('depcom', period) == b'34172'
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from openfisca_france.model.base import Variable, MONTH, not_, Famille

class montpellier_mutuelle_communale(Variable):
value_type = bool
entity = Famille
definition_period = MONTH
label = "Mutuelle communale de la ville de Montpellier"
reference = [
"https://www.montpellier.fr/4884-mutuelle-communale.htm"
]

def formula(famille, period):
eligibilite_residentielle = famille.demandeur.menage('montpellier_eligibilite_residence', period)
eligibilite_css = famille('css_cmu_acs_eligibilite', period)
return eligibilite_residentielle & not_(eligibilite_css)
7 changes: 7 additions & 0 deletions tests/communes/montpellier/montpellier_mutuelle_communale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- name: "Égibilité à la mutuelle communale de Montpellier"
period: 2024-10
input:
depcom: ["34172", "34172", "68400", "68400"]
css_cmu_acs_eligibilite: [False, True, True, False]
output:
montpellier_mutuelle_communale: [True, False, False, False]

0 comments on commit 442ba97

Please sign in to comment.