fix: consider participant's age at travel date

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent ca1d5c4303
commit a2e055f313
+2 -2
View File
@@ -343,12 +343,12 @@ class BookingService
// Get age-appropriate mandatory services for this participant
$ageAppropriateServices = array_filter($mandatoryServices, function ($service) use ($bookingDto, $participant) {
// Use the age evaluator service to check if service is appropriate for participant age
if (null === $service->ageFrom && null === $service->ageTo) {
return true; // No age restrictions
}
$age = $participant->dateOfBirth->diff($bookingDto->travel->dateFrom)->y;
// participant's age at travel date is relevant
$age = $participant->getAge($bookingDto->travel->dateFrom);
if (null !== $service->ageFrom && $age < $service->ageFrom) {
return false;