From 49a439398048ef5337a78c6ee0c243bdbfc2fa78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Tue, 30 Sep 2025 16:08:20 +0200 Subject: [PATCH] fix: consider participant's age at travel date --- src/Service/BookingService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Service/BookingService.php b/src/Service/BookingService.php index 18bc9f7..fb4387e 100644 --- a/src/Service/BookingService.php +++ b/src/Service/BookingService.php @@ -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;