wip: insurance booking in edit flow
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user