fix: correctly compare age range
This commit is contained in:
@@ -92,7 +92,7 @@ class ParticipantEligibilityService
|
|||||||
|
|
||||||
$travelStartDate = CarbonImmutable::instance($bookingDto->travel->dateFrom);
|
$travelStartDate = CarbonImmutable::instance($bookingDto->travel->dateFrom);
|
||||||
$birthDate = CarbonImmutable::instance($participant->dateOfBirth);
|
$birthDate = CarbonImmutable::instance($participant->dateOfBirth);
|
||||||
$ageAtTravelStart = $birthDate->diffInYears($travelStartDate);
|
$ageAtTravelStart = (int) $birthDate->diffInYears($travelStartDate);
|
||||||
$birthYear = (int) $birthDate->format('Y');
|
$birthYear = (int) $birthDate->format('Y');
|
||||||
|
|
||||||
$constraintType = $service->ageConstraintType ?? 'absolute_age';
|
$constraintType = $service->ageConstraintType ?? 'absolute_age';
|
||||||
|
|||||||
Reference in New Issue
Block a user