fix: incorrect rules around family insurances

addresses #869dr80qj
This commit is contained in:
Björn Fromme
2026-08-05 15:11:37 +02:00
parent 736128476b
commit 8a46908856
15 changed files with 859 additions and 50 deletions
@@ -1159,15 +1159,17 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
// Get selectable (non-complementary) insurances with caching
$selectableInsurances = $this->insuranceService->getSelectableInsurances($bookingDto->travel);
// Calculate travel price for eligibility filtering
$travelPrice = $this->priceCalculatorService->calculateIndividualParticipantPriceExcludingInsurance($bookingDto, $participantIndex);
// Family insurances are priced by the total booking price rather than the individual
// participant's price - InsuranceManager applies the correct basis per insurance type
$individualPrice = $this->priceCalculatorService->calculateIndividualParticipantPriceExcludingInsurance($bookingDto, $participantIndex);
$totalBookingPrice = $this->priceCalculatorService->calculateTotalBookingPriceExcludingInsurance($bookingDto);
// Filter based on eligibility criteria for this participant
$eligibleInsurances = $this->insuranceService->getEligibleInsurances(
$eligibleInsurances = $this->insuranceService->getEligibleInsurancesForParticipant(
$selectableInsurances,
$participant,
$bookingDto,
$travelPrice
$individualPrice,
$totalBookingPrice
);
// Inject synthetic "no insurance" option at the top of the list