wip: improved booking summary

This commit is contained in:
Björn Fromme
2025-07-24 12:44:38 +02:00
parent 787e76c21c
commit 2b122a7cc4
11 changed files with 168 additions and 90 deletions
+8 -4
View File
@@ -188,12 +188,16 @@ class Travel
* greater than zero and have an available status. This ensures only
* bookable rooms are returned for selection.
*
* @return array<Room> The filtered array of available rooms
* @return array<int, Room> The filtered array of available rooms, indexed by room ID
*/
public function getAvailableRooms(): array
{
return array_filter($this->rooms, function (Room $room) {
return $room->available > 0 && Constants::STATUS_AVAILABLE === $room->status;
});
$result = [];
foreach ($this->rooms as $room) {
if ($room->available > 0 && Constants::STATUS_AVAILABLE === $room->status) {
$result[$room->id] = $room;
}
}
return $result;
}
}