feat: functionality to determine family status of a booking

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent 7ce3bc18b2
commit 96c53cc173
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;
}
}