wip: insurance booking in edit flow

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent 069600d602
commit 0d073a36a3
10 changed files with 1215 additions and 0 deletions
+19
View File
@@ -42,6 +42,7 @@ class Booking
public array $pickupsOutbound = [];
public array $pickupsInbound = [];
public array $surcharges = [];
public array $insurances = [];
public ?int $invoiceNumber = null;
public ?float $totalPrice = null;
public ?string $travelInfoUrl = null;
@@ -150,6 +151,24 @@ class Booking
return null;
}
/**
* Gets the insurance assigned to a specific participant.
*
* @param int $participantIndex The participant index (0-based)
*
* @return Insurance|null The assigned insurance or null if none assigned
*/
public function getInsuranceForParticipant(int $participantIndex): ?Insurance
{
foreach ($this->insurances as $insurance) {
if (in_array($participantIndex, $insurance->mapping ?? [], true)) {
return $insurance;
}
}
return null;
}
/**
* Retrieves ski pass for a specific participant.
*