feat: unique email addresses of participants unless child, cleanup

addresses #869axbn21
This commit is contained in:
Björn Fromme committed 2026-03-16 11:59:11 +01:00
1 parent f50aa55e8b
commit 7aea149b6c
57 files changed
+1036 -153

No files matched your search

+9 -10
View File
@@ -59,7 +59,7 @@ class InsuranceService
array $insurances,
ParticipantDto $participant,
BookingDto $booking,
float $travelPrice
float $travelPrice,
): array {
$travelStartDate = $booking->travel->dateFrom;
$travelEndDate = $booking->travel->dateTo;
@@ -108,7 +108,7 @@ class InsuranceService
Insurance $currentInsurance,
ParticipantDto $participant,
BookingDto $booking,
float $travelPrice
float $travelPrice,
): ?Insurance {
// Group insurances of the same type
$sameTypeInsurances = $this->filterByType($availableInsurances, $currentInsurance);
@@ -127,10 +127,10 @@ class InsuranceService
* (subType + familyInsurance) to all participants, but selects the appropriate price tier
* based on each participant's individual travel price.
*
* @param array<Insurance> $availableInsurances All available insurances
* @param Insurance $selectedInsurance The insurance selected by the applicant
* @param BookingDto $booking The booking with all participants
* @param array<int, float> $participantPrices Map of participant index to travel price (excluding insurance)
* @param array<Insurance> $availableInsurances All available insurances
* @param Insurance $selectedInsurance The insurance selected by the applicant
* @param BookingDto $booking The booking with all participants
* @param array<int, float> $participantPrices Map of participant index to travel price (excluding insurance)
*
* @return array<int, Insurance|null> Array indexed by participant index with assigned insurances
*/
@@ -138,7 +138,7 @@ class InsuranceService
array $availableInsurances,
Insurance $selectedInsurance,
BookingDto $booking,
array $participantPrices
array $participantPrices,
): array {
$assignments = [];
@@ -280,7 +280,7 @@ class InsuranceService
private function checkAgeConstraints(
Insurance $insurance,
ParticipantDto $participant,
\DateTimeImmutable $travelStartDate
\DateTimeImmutable $travelStartDate,
): bool {
$participantAge = $participant->getAge($travelStartDate);
@@ -305,7 +305,7 @@ class InsuranceService
private function checkTravelDateConstraints(
Insurance $insurance,
\DateTimeImmutable $travelStartDate,
\DateTimeImmutable $travelEndDate
\DateTimeImmutable $travelEndDate,
): bool {
// Check travel start date
if (null !== $insurance->travelDateFrom && $travelStartDate < $insurance->travelDateFrom) {
@@ -368,5 +368,4 @@ class InsuranceService
return true;
}
}