feat: extended insurance parsing, pass info urls to view

This commit is contained in:
Björn Fromme
2025-10-02 16:32:50 +02:00
parent 875b181aff
commit 25029dff5d
8 changed files with 277 additions and 23 deletions
@@ -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;