From f1d0ad045cd07f06489b26aa704acbd7bf64f49a Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 23 Feb 2026 15:06:47 +0000 Subject: [PATCH] simplify calculate_monthly_fee to linear formula MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Rates are CHF 130/indoor day and CHF 250/outdoor day — exactly linear. Replace the if/elif table with indoor_days * 130 + outdoor_days * 250. https://claude.ai/code/session_01LjjK7RjKVnC8bETtccfgna --- src/notifications/context.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/notifications/context.py b/src/notifications/context.py index 19981d3..7a2feaa 100644 --- a/src/notifications/context.py +++ b/src/notifications/context.py @@ -104,15 +104,7 @@ def calculate_monthly_fee(registration: RegistrationData) -> str: """Compute the monthly fee string from the booking selection.""" indoor_days = sum(1 for d in registration.booking.selected_days if d.type == "indoor") outdoor_days = sum(1 for d in registration.booking.selected_days if d.type == "outdoor") - fee = 0 - if indoor_days == 1: - fee += 130 - elif indoor_days == 2: - fee += 260 - elif indoor_days >= 3: - fee += 390 - if outdoor_days >= 1: - fee += 250 + fee = indoor_days * 130 + outdoor_days * 250 return f"CHF {fee}.-"