feat: functionality to determine family status of a booking

This commit is contained in:
Björn Fromme
2025-09-24 12:58:42 +02:00
parent eed7ba4d7b
commit 582fb9b52d
2 changed files with 53 additions and 0 deletions
+19
View File
@@ -106,4 +106,23 @@ class ParticipantDto
{
return 'O' === $this->status;
}
/**
* Calculates the participant's current age in complete years.
*
* Uses the same logic as existing age evaluators in the system
* for consistency across age-related calculations.
*
* @return int|null The calculated age in complete years, or null if no birth date
*/
public function getAge(): ?int
{
if (null === $this->dateOfBirth) {
return null;
}
$today = new \DateTimeImmutable();
return $this->dateOfBirth->diff($today)->y;
}
}