fix: consider participant's age at travel date

This commit is contained in:
Björn Fromme
2025-09-30 16:08:20 +02:00
parent c0e20a15fe
commit 49a4393980
+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;