feat: extended insurance parsing, pass info urls to view
This commit is contained in:
@@ -422,12 +422,7 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
|
||||
'multiple' => false,
|
||||
'expanded' => true,
|
||||
'required' => false,
|
||||
'choices' => array_merge(
|
||||
[0 => null], // "no insurance" option
|
||||
$this->getEligibleInsurances($bookingDto, $participantIndex)
|
||||
),
|
||||
'choice_label' => fn (?Insurance $insurance) => $this->formatInsuranceLabel($insurance),
|
||||
'choice_value' => 'id',
|
||||
'insurances' => $this->getEligibleInsurances($bookingDto, $participantIndex),
|
||||
'attr' => [
|
||||
'hx-post' => $this->urlGenerator->generate('app_booking_create_step_2_refresh'),
|
||||
'hx-swap' => 'none',
|
||||
@@ -729,6 +724,10 @@ 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);
|
||||
|
||||
// Only apply insurance filtering for BookingCreateDto (creation workflow)
|
||||
if (!$bookingDto instanceof BookingCreateDto) {
|
||||
return $availableInsurances;
|
||||
|
||||
Reference in New Issue
Block a user