feat: automatic unselection of discounted transportation

This commit is contained in:
Björn Fromme
2025-10-24 09:04:20 +02:00
parent 9140b97a71
commit a01e966d6d
5 changed files with 524 additions and 2 deletions
+10 -2
View File
@@ -231,6 +231,13 @@ Critical for correct pricing and auto-reassignment:
- **Unified pickup field**: Single field for both directions (BPN API limitation)
- **Conditional visibility**: Pickup vs parking fields mutually exclusive
- **Direction mapping**: `DirectionMapper` translates API ↔ internal codes
- **Discount replacement logic**: Automatic correction of incompatible transportation combinations
- When inbound bus selected with discounted PKW outbound: system automatically replaces with regular PKW
- When inbound changes from bus to PKW: system automatically restores discounted PKW if available
- Form options update dynamically to show only valid PKW variant
- User notified via toast messages about automatic changes
- Implemented via `ParticipantTransportationDiscountReplacementFieldHandler`
- Prevents invalid pricing where user gets both PKW discount and bus pricing
## Important Field Dependencies
@@ -430,8 +437,9 @@ Edit mode session requires proper cleanup to prevent dirty state persistence:
- `src/Form/Service/EditFieldStateProvider.php` - Edit mode mutability constraints
### Field Handlers
- `src/Form/Service/Participant*FieldHandler.php` (15+ handlers)
- Transportation, pickup, parking, ski pass, rentals, insurance, bulk insurance, etc.
- `src/Form/Service/Participant*FieldHandler.php` (16+ handlers)
- Transportation (outbound, inbound, discount replacement), pickup, parking, ski pass, rentals, insurance, bulk insurance, etc.
- `ParticipantTransportationDiscountReplacementFieldHandler` - Automatic discount replacement for invalid transportation combinations
## Testing