Generalize pension system: multi-country strategy pattern

- Add JSONB pension_params column to retirement_configs
- Add data JSONB column to pension_entries
- Create pension calculator strategy classes (Base, DeGrv, UsSocialSecurity, UkStatePension, FrRegimeGeneral, EsSocialSecurity)
- Update RetirementConfig model to delegate to calculators
- Make PensionEntry.current_points optional for non-points systems
- Update controller strong params (pension_params: {})
- Add Stimulus pension_system_controller for dynamic form fields
- Update views with per-country field groups and conditional points columns
- Expand i18n (EN, DE) and add ES, FR locale files
- Update fixtures and tests for new schema

Addresses review feedback from jjmata on PR #1057
This commit is contained in:
ChakibMoMi
2026-04-09 00:37:11 +02:00
parent 0fed438215
commit 4f3230c904
20 changed files with 675 additions and 83 deletions

View File

@@ -44,7 +44,12 @@ class RetirementControllerTest < ActionDispatch::IntegrationTest
country: "DE",
expected_return_pct: 7.0,
inflation_pct: 2.0,
tax_rate_pct: 26.38
tax_rate_pct: 26.38,
pension_params: {
expected_annual_points: 1.0,
rentenwert: 39.32,
contribution_start_year: 2015
}
}
}
end