feat: list and respect all surcharges
This commit is contained in:
@@ -121,6 +121,13 @@ class Booking
|
||||
return $price;
|
||||
}
|
||||
|
||||
public function getSurchargesForParticipant(int $participantIndex): array
|
||||
{
|
||||
return array_filter($this->surcharges, function (Surcharge $surcharge) use ($participantIndex) {
|
||||
return in_array($participantIndex, $surcharge->mapping);
|
||||
});
|
||||
}
|
||||
|
||||
public function isEditable(): bool
|
||||
{
|
||||
return $this->travelDate > new \DateTimeImmutable() && false === in_array($this->status, ['S', 'U']);
|
||||
|
||||
Reference in New Issue
Block a user