feat: simplify handling of ski pass service

This commit is contained in:
Björn Fromme
2025-09-19 16:19:01 +02:00
parent 29a51ed66d
commit bdc7100f74
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.
*