fix: avoid selection trap for mandatory services with age constraints

This commit is contained in:
Björn Fromme
2026-03-16 12:03:00 +01:00
parent 3644b935fd
commit 1670b8b8d2
2 changed files with 162 additions and 4 deletions
@@ -191,11 +191,18 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
$attributes = [];
// Make readonly and checked for mandatory services (pre-selection handled by service layer)
// Make mandatory services readonly only when actually selected by participant.
// Unselected mandatory services remain interactive so the user can select them
// after age changes (e.g. agency skeleton bookings where DOB is corrected).
if (true === $service->mandatory) {
$attributes['checked'] = true;
$attributes['readonly'] = true;
$attributes['data-tooltip'] = 'Diese Leistung ist nicht abwählbar';
$participant = $bookingDto->getParticipant($participantIndex);
$isSelected = null !== $participant
&& $this->hasServiceById($participant->additionalServices, $service->id);
if (true === $isSelected) {
$attributes['readonly'] = true;
$attributes['data-tooltip'] = 'Diese Leistung ist nicht abwählbar';
}
}
// Add service description as data attribute for frontend use