wip: submit booking to api

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent ee264e88d4
commit 7ea52670b9
34 changed files with 3316 additions and 31 deletions
+13 -1
View File
@@ -95,6 +95,17 @@ class BookingService
$request->getSession()->set(self::BOOKING_CREATE_KEY, $bookingCreateDto);
}
/**
* Clears the booking creation DTO from the session.
*
* This method removes only the booking DTO while preserving other session data.
* Used after successful booking submission to clear the booking flow state.
*/
public function clearBookingCreateDto(Request $request): void
{
$request->getSession()->remove(self::BOOKING_CREATE_KEY);
}
/**
* Clears all booking-related session data.
*
@@ -115,7 +126,7 @@ class BookingService
* and saves it to the session. It's designed to be called from the clean
* booking entry point without requiring UID parameters.
*/
public function startFreshBooking(Request $request, int $dateId, int $hotelId): BookingCreateDto
public function startFreshBooking(Request $request, int $dateId, int $hotelId, ?int $agencyId = null): BookingCreateDto
{
$travelData = $this->travelDataService->getTravelData($dateId, $hotelId);
if (null === $travelData) {
@@ -138,6 +149,7 @@ class BookingService
$bookingCreateDto = new BookingCreateDto($travelData, $hotelId);
$bookingCreateDto->roomSelections = $roomSelections;
$bookingCreateDto->currentStep = 1;
$bookingCreateDto->agencyId = $agencyId;
$this->saveBookingCreateDto($request, $bookingCreateDto);