wip: booking process, room assignment

This commit is contained in:
Björn Fromme
2025-07-18 15:40:23 +02:00
parent eecea0abd1
commit 6feb8178b5
12 changed files with 454 additions and 201 deletions
+14
View File
@@ -3,6 +3,7 @@
namespace App\Service;
use App\BusProNet\Model\Room;
use App\BusProNet\Model\Travel;
use App\Form\Model\BookingCreateDto;
use App\Form\Model\RoomSelectionDto;
use App\Service\TravelDataService;
@@ -88,4 +89,17 @@ class BookingService
return array_map('intval', array_filter($rooms, 'strlen'));
}
public function getParticipantsCount(array $roomSelections, Travel $travelData): int
{
$participantsCount = 0;
$rooms = $travelData->getAvailableRooms();
foreach ($roomSelections as $roomSelection) {
$room = $rooms[$roomSelection->roomId];
$participantsCount += $room->minPax * $roomSelection->quantity;
}
return $participantsCount;
}
}