feat: unique email addresses of participants unless child, cleanup

addresses #869axbn21
This commit is contained in:
Björn Fromme
2026-03-16 11:59:11 +01:00
parent f50aa55e8b
commit 7aea149b6c
57 changed files with 1036 additions and 153 deletions
+22
View File
@@ -224,4 +224,26 @@ class ParticipantDto
'message' => $message,
];
}
/**
* Determines if the participant is a child based on age at current date.
*
* A child is defined as someone under the specified age threshold (default: 16 years).
* This classification is used for email uniqueness validation (children can share emails with adults).
*
* @param int $ageThreshold The age threshold for child classification (default: 16)
*
* @return bool True if participant is under the age threshold, false otherwise or if age unknown
*/
public function isChild(int $ageThreshold = 16): bool
{
$age = $this->getAge();
// Treat unknown age as adult for safety (requires email uniqueness)
if (null === $age) {
return false;
}
return $ageThreshold > $age;
}
}