wip: bulk insurance refactoring
This commit is contained in:
@@ -13,8 +13,8 @@ use App\Form\Model\BookingDto;
|
||||
use App\Form\Service\Abstract\AbstractFieldOptionsProvider;
|
||||
use App\Form\Service\Factory\ParticipantRoomChoiceLoaderFactory;
|
||||
use App\Service\InsuranceMatchingService;
|
||||
use App\Service\InsuranceTypeFilterService;
|
||||
use App\Service\ServiceAvailabilityCalculator;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
|
||||
/**
|
||||
* Provides dynamic field options for participant form fields.
|
||||
@@ -51,6 +51,7 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
|
||||
private readonly ParticipantRoomChoiceLoaderFactory $roomChoiceLoaderFactory,
|
||||
private readonly ServiceAvailabilityCalculator $serviceAvailabilityCalculator,
|
||||
private readonly InsuranceMatchingService $insuranceMatchingService,
|
||||
private readonly InsuranceTypeFilterService $insuranceTypeFilterService,
|
||||
) {
|
||||
parent::__construct();
|
||||
}
|
||||
@@ -757,9 +758,8 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
|
||||
|
||||
$availableInsurances = $bookingDto->travel->insurances ?? [];
|
||||
|
||||
// Exclude complementary insurances from standalone selection
|
||||
// They are only available as part of packages
|
||||
$availableInsurances = array_filter($availableInsurances, fn ($insurance) => !$insurance->complementary);
|
||||
// Exclude complementary insurances (only available as part of packages)
|
||||
$availableInsurances = $this->insuranceTypeFilterService->filterNonComplementary($availableInsurances);
|
||||
|
||||
// Use insurance matching service to filter based on eligibility criteria
|
||||
return $this->insuranceMatchingService->getEligibleInsurances(
|
||||
|
||||
Reference in New Issue
Block a user