Skip to content

Commit

Permalink
chore: complète la couverture pour les tests de la tarification solid…
Browse files Browse the repository at this point in the history
…aire du périscolaire pour ll'accueil du soir en maternelle sur l'année 2024
  • Loading branch information
Shamzic committed Oct 24, 2024
1 parent 31326db commit 033c60e
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ class strasbourg_metropole_quotient_familial(Variable):
definition_period = MONTH
label = "Quotient familial de l'eurometropole de strasbourg"

# Note: pour le moment c'est le QF de la caf, mais à terme il poura evoluer pour se baser sur les revenus imposables
def formula(famille, period):
return (
famille.demandeur.foyer_fiscal("rfr", period.n_2)
/ 12
/ famille.demandeur.foyer_fiscal("nbptr", period.n_2)
)
rfr = famille.demandeur.foyer_fiscal("rfr", period.n_2)
nbptr = famille.demandeur.foyer_fiscal("nbptr", period.n_2)
return rfr / 12 / nbptr


class strasbourg_metropole_tarification_solidaire_periscolaire(
Expand All @@ -22,18 +19,19 @@ class strasbourg_metropole_tarification_solidaire_periscolaire(
value_type = float
entity = Famille
definition_period = MONTH
definition_period = MONTH
label = "Tarification de l'acceuil periscolaire de l'Eurométropole de Strasbourg"
reference = [
# tarifs pour 2021-2022
"https://www.strasbourg.eu/documents/976405/1280877/0/0cc414e4-c6b7-1709-7e1e-46b088d28805"
# les tarifs 2202-2023 sont
# https://www.strasbourg.eu/documents/976405/1280877/0/c1917f09-97b2-2604-7d58-8b8cb5c0a849
# tarifs pour 2021-2022 :
"https://www.strasbourg.eu/documents/976405/1280877/0/0cc414e4-c6b7-1709-7e1e-46b088d28805",
# tarifs 2202-2023
"https://www.strasbourg.eu/documents/976405/1280877/0/c1917f09-97b2-2604-7d58-8b8cb5c0a849",
# tarifs 2024-2025 :
"https://www.strasbourg.eu/documents/976405/1280877/Tarifs-services-periscolaires-2024-2025.pdf/62fa6543-19ae-b69d-3313-13e881a6b866?version=1.0&t=1723127337051"
]

def formula(famille, period, parameters):
qf = famille("strasbourg_metropole_quotient_familial", period)
quotient_familial = famille("strasbourg_metropole_quotient_familial", period)
tarif = parameters(
period
).metropoles.strasbourg.periscolaire.acceuil_matin_soir_maternelle
return tarif.calc(max_(0, qf), right=True)
).metropoles.strasbourg.periscolaire.acceuil_soir_maternelle
return tarif.calc(quotient_familial)

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
description:
Tarif mensuel du service d'acceuil dans les écoles maternelles de la ville de strasbourg
metadata:
type: single_amount
references:
- tarifs pour 2021-2022: "https://www.strasbourg.eu/documents/976405/1280877/0/0cc414e4-c6b7-1709-7e1e-46b088d28805"
- tarifs pour 2022, 2023 et 2024: https://www.strasbourg.eu/documents/976405/1280877/0/c1917f09-97b2-2604-7d58-8b8cb5c0a849
brackets:
- threshold:
2021-01-01:
value: -1
amount:
2021-01-01:
value: 11.95
2024-09-01:
value: 11.85

- threshold:
2024-09-01:
value: 100
amount:
2024-09-01:
value: 16.16

- threshold:
2024-09-01:
value: 300
amount:
2024-09-01:
value: 20.46

- threshold:
2021-01-01:
value: 410
amount:
2021-01-01:
value: 16.70

- threshold:
2024-09-01:
value: 500
amount:
2024-09-01:
value: 24.77

- threshold:
2021-01-01:
value: 510
amount:
2021-01-01:
value: 21.50

- threshold:
2021-01-01:
value: 620
amount:
2021-01-01:
value: 26.25

- threshold:
2024-09-01:
value: 700
amount:
2024-09-01:
value: 29.07

- threshold:
2021-01-01:
value: 720
amount:
2021-01-01:
value: 31.10

- threshold:
2021-01-01:
value: 820
amount:
2021-01-01:
value: 35.85

- threshold:
2024-09-01:
value: 900
amount:
2024-09-01:
value: 33.38

- threshold:
2021-01-01:
value: 920
amount:
2021-01-01:
value: 40.60
2024-09-01:
value: 33.38

- threshold:
2024-09-01:
value: 1100
amount:
2024-09-01:
value: 37.68

- threshold:
2021-01-01:
value: 1030
amount:
2021-01-01:
value: 45.30

- threshold:
2024-09-01:
value: 1300
amount:
2024-09-01:
value: 41.99

- threshold:
2024-09-01:
value: 1500
amount:
2024-09-01:
value: 46.29

- threshold:
2021-01-01:
value: 1540
amount:
2021-01-01:
value: 50.15

- threshold:
2024-09-01:
value: 1700
amount:
2024-09-01:
value: 50.60

- threshold:
2024-09-01:
value: 1900
amount:
2024-09-01:
value: 54.90

- threshold:
2021-01-01:
value: 2050
amount:
2021-01-01:
value: 54.90
10 changes: 8 additions & 2 deletions tests/metropoles/strasbourg/periscolaire.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
- period: 2021-10
input:
strasbourg_metropole_quotient_familial: [100, 1000, 3000]
strasbourg_metropole_quotient_familial: [0, 101, 410, 510, 620, 720, 820, 920, 1030, 1540, 2050, 3000, 5000]
output:
strasbourg_metropole_tarification_solidaire_periscolaire: [11.95, 40.60, 54.90]
strasbourg_metropole_tarification_solidaire_periscolaire: [11.95, 11.95, 16.70, 21.50, 26.25, 31.10, 35.85, 40.60, 45.30, 50.15, 54.90, 54.90, 54.90]

- period: 2024-10
input:
strasbourg_metropole_quotient_familial: [0, 101, 300, 500, 700, 900, 1100, 1300, 1500, 1700, 1900, 2050, 3000, 5000]
output:
strasbourg_metropole_tarification_solidaire_periscolaire: [11.85, 16.16, 20.46, 24.77, 29.07, 33.38, 37.68, 41.99, 46.29, 50.60, 54.90, 54.90, 54.90, 54.90]

0 comments on commit 033c60e

Please sign in to comment.