Skip to content

Commit

Permalink
Merge pull request #216 from openfisca/4636-ajouter-la-mutuelle-commu…
Browse files Browse the repository at this point in the history
…nale-de-montpellier

Modélisation de la mutuelle communale de la ville de Montpellier
  • Loading branch information
Shamzic authored Oct 7, 2024
2 parents facab9f + f68d71e commit a6cb024
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 1 deletion.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [6.14.0] - 2024-10-02

_Pour les changements détaillés et les discussions associées, référencez la pull request [#216](https://github.com/openfisca/openfisca-france-local/pull/216)_

### Added

- Ajoute la variable `montpellier_mutuelle_communale`

## [6.13.0] - 2024-09-24

_Pour les changements détaillés et les discussions associées, référencez la pull request [#215](https://github.com/openfisca/openfisca-france-local/pull/215)_
Expand Down
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,17 @@
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)
css_participation_forfaitaire = famille('css_participation_forfaitaire', period)
cmu_c = famille('cmu_c', period)
eligibilite_css_cmu_c = (css_participation_forfaitaire > 0) | cmu_c
return eligibilite_residentielle * not_(eligibilite_css_cmu_c)
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name='OpenFisca-France-Local',
version='6.13.0',
version='6.14.0',
author='OpenFisca Team',
author_email='[email protected]',
classifiers=[
Expand Down
8 changes: 8 additions & 0 deletions tests/communes/montpellier/montpellier_mutuelle_communale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- name: "Égibilité à la mutuelle communale de Montpellier"
period: 2024-10
input:
depcom: ["34172","34172", "34172", "68400", "68400"]
css_participation_forfaitaire_montant: [0, 0, 20, 25, 30]
cmu_c: [False, True, False, False, False]
output:
montpellier_mutuelle_communale: [True, False, False, False, False]

0 comments on commit a6cb024

Please sign in to comment.