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

@@ -15,9 +15,9 @@ class PensionEntryTest < ActiveSupport::TestCase
assert_not @entry_2024.valid?
end
test "requires current_points" do
test "current_points is optional" do
@entry_2024.current_points = nil
assert_not @entry_2024.valid?
assert @entry_2024.valid?
end
test "current_points must be non-negative" do