wip: bulk insurance refactoring
This commit is contained in:
@@ -15,6 +15,7 @@ use App\Form\Model\BankAccountDto;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Form\Model\ParticipantDto;
|
||||
use App\Service\InsuranceMatchingService;
|
||||
use App\Service\InsuranceTypeFilterService;
|
||||
|
||||
/**
|
||||
* Processes booking form data and converts it into BusProNet API payload format.
|
||||
@@ -29,6 +30,7 @@ class BookingDataProcessor
|
||||
{
|
||||
public function __construct(
|
||||
private readonly InsuranceMatchingService $insuranceMatchingService,
|
||||
private readonly InsuranceTypeFilterService $insuranceTypeFilterService,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -1112,10 +1114,8 @@ class BookingDataProcessor
|
||||
// Get all available insurances from travel data
|
||||
$availableInsurances = $bookingDto->travel->insurances;
|
||||
|
||||
// Exclude complementary insurances from bulk assignment logic
|
||||
// They are only available as part of packages and cannot be directly selected
|
||||
$availableInsurances = array_filter($availableInsurances, fn ($insurance) => !$insurance->complementary);
|
||||
$availableInsurances = array_values($availableInsurances);
|
||||
// Exclude complementary insurances (only available as part of packages)
|
||||
$availableInsurances = $this->insuranceTypeFilterService->filterNonComplementary($availableInsurances);
|
||||
|
||||
// Use InsuranceMatchingService for proper type-based assignment with price tier matching
|
||||
$assignments = $this->insuranceMatchingService->batchAssignInsuranceToParticipants(
|
||||
|
||||
Reference in New Issue
Block a user