feat: simplify handling of ski pass service

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent 3d6c94e7c5
commit 7ff10e6792
4 changed files with 102 additions and 5 deletions
+23
View File
@@ -150,6 +150,29 @@ class Booking
return null;
}
/**
* Retrieves ski pass for a specific participant.
*
* Since each participant can only have one ski pass, this method returns
* the single ski pass assigned to the participant or null if none is assigned.
*
* @param int $participantIndex The participant index to search for
*
* @return Service|null The participant's ski pass or null if not found
*/
public function getSkiPassForParticipant(int $participantIndex): ?Service
{
$skiPasses = $this->getAdditionalServicesByGroup('SPA');
foreach ($skiPasses as $service) {
if (in_array($participantIndex, $service->mapping)) {
return $service;
}
}
return null;
}
/**
* Retrieves room assignment for a specific participant.
*