feat: replace board service placeholder to avoid duplicate entries

This commit is contained in:
Björn Fromme
2026-08-03 18:22:07 +02:00
parent b54c8917c9
commit 6f84fc755b
3 changed files with 5 additions and 22 deletions
+1 -7
View File
@@ -40,8 +40,7 @@ class AccommodationStep2Type extends AbstractType
'choices' => $options['board_service_choices'],
'expanded' => true,
'multiple' => false,
'required' => false,
'placeholder' => 'Selbstversorgung',
'required' => true,
])
->add('selectedAdditionalServiceIds', ChoiceType::class, [
'label' => false,
@@ -65,11 +64,6 @@ class AccommodationStep2Type extends AbstractType
}
}
// Board service rendered manually: empty string from the "Selbstversorgung" radio → null
if (isset($data['selectedBoardServiceId']) && '' === $data['selectedBoardServiceId']) {
unset($data['selectedBoardServiceId']);
}
$event->setData($data);
});
}
@@ -25,6 +25,7 @@ class AccommodationBookingDto
#[Assert\PositiveOrZero(message: 'invalid', groups: ['step_3'])]
public int $childrenCount = 0;
#[Assert\NotNull(message: 'required', groups: ['step_2'])]
public ?int $selectedBoardServiceId = null;
/** @var list<int>*/
+3 -15
View File
@@ -81,20 +81,6 @@
Verpflegungsleistungen
</legend>
<table class="w-full table-fixed border-collapse">
<tr>
<td class="border border-primary-bg p-2 align-top">
<label for="board_service_none" class="cursor-pointer">Selbstversorgung</label>
</td>
<td class="border border-primary-bg p-2 align-top w-32 text-right"></td>
<td class="border border-primary-bg p-2 align-top w-12 text-center">
<input type="radio"
id="board_service_none"
name="{{ form.selectedBoardServiceId.vars.full_name }}"
value=""
{% if dto.selectedBoardServiceId is null %}checked{% endif %}
class="form-radio">
</td>
</tr>
{% for service in ctx.boardServices %}
<tr>
<td class="border border-primary-bg p-2 align-top">
@@ -110,7 +96,9 @@
</td>
<td class="border border-primary-bg p-2 align-top w-32 text-right">
<div>{% if service.price == 0 %}inkl.{% else %}{{ (service.price / 100)|format_currency(ctx.accommodation.currency) }}{% endif %}</div>
<div class="text-xs text-gray-500">pro Person und Nacht</div>
{% if service.price != 0 %}
<div class="text-xs text-gray-500">pro Person und Nacht</div>
{% endif %}
</td>
<td class="border border-primary-bg p-2 align-top w-12 text-center">
<input type="radio"