feat: offer only free rooms in booking step 1
This commit is contained in:
1 parent
980e378a7b
commit
2b27b9809d
6 files changed
+17
-119
No files matched your search
@@ -84,7 +84,7 @@ class BookingConfiguratorStatusTest extends TestCase
|
||||
$this->bookingService->startFreshBooking($request, 123, 456);
|
||||
}
|
||||
|
||||
public function testStartFreshBookingWithAnfrageRooms(): void
|
||||
public function testStartFreshBookingWithAnfrageRoomsThrowsException(): void
|
||||
{
|
||||
$travel = $this->createTravelWithRooms([
|
||||
['status' => Constants::STATUS_ON_REQUEST, 'available' => 5],
|
||||
@@ -96,10 +96,9 @@ class BookingConfiguratorStatusTest extends TestCase
|
||||
|
||||
$request = $this->createRequestWithSession();
|
||||
|
||||
$bookingDto = $this->bookingService->startFreshBooking($request, 123, 456);
|
||||
$this->expectException(NoRoomsAvailableException::class);
|
||||
|
||||
$this->assertSame('A', $bookingDto->bookingStatus);
|
||||
$this->assertCount(1, $bookingDto->roomSelections);
|
||||
$this->bookingService->startFreshBooking($request, 123, 456);
|
||||
}
|
||||
|
||||
public function testStartFreshBookingWithAnfrageRoomsAndNoAvailabilityThrowsException(): void
|
||||
@@ -119,9 +118,8 @@ class BookingConfiguratorStatusTest extends TestCase
|
||||
$this->bookingService->startFreshBooking($request, 123, 456);
|
||||
}
|
||||
|
||||
public function testStartFreshBookingWithMixedRoomsUsesFreeStatus(): void
|
||||
public function testStartFreshBookingWithMixedRoomsOffersOnlyFreeRooms(): void
|
||||
{
|
||||
// When both Frei and Anfrage rooms with availability exist, booking status should be 'F'
|
||||
$travel = $this->createTravelWithRooms([
|
||||
['status' => Constants::STATUS_AVAILABLE, 'available' => 5],
|
||||
['status' => Constants::STATUS_ON_REQUEST, 'available' => 3],
|
||||
@@ -136,7 +134,7 @@ class BookingConfiguratorStatusTest extends TestCase
|
||||
$bookingDto = $this->bookingService->startFreshBooking($request, 123, 456);
|
||||
|
||||
$this->assertSame('F', $bookingDto->bookingStatus);
|
||||
$this->assertCount(2, $bookingDto->roomSelections);
|
||||
$this->assertSame([1], array_keys($bookingDto->roomSelections));
|
||||
}
|
||||
|
||||
public function testStartFreshBookingWithNoBookableRoomsThrowsException(): void
|
||||
@@ -208,42 +206,11 @@ class BookingConfiguratorStatusTest extends TestCase
|
||||
$this->assertSame('O', $bookingDto->bookingStatus);
|
||||
}
|
||||
|
||||
public function testStartFreshBookingWithInquiryRoomsAndSelection1473KeepsInquiryStatus(): void
|
||||
{
|
||||
$travel = $this->createTravelWithRooms(
|
||||
[
|
||||
['status' => Constants::STATUS_ON_REQUEST, 'available' => 5],
|
||||
],
|
||||
[$this->createSelectionGroupWithSelectionId(1473)]
|
||||
);
|
||||
|
||||
$this->travelDataService
|
||||
->method('getTravelData')
|
||||
->willReturn($travel);
|
||||
|
||||
$request = $this->createRequestWithSession();
|
||||
|
||||
$bookingDto = $this->bookingService->startFreshBooking($request, 123, 456);
|
||||
|
||||
$this->assertSame('A', $bookingDto->bookingStatus);
|
||||
}
|
||||
|
||||
public function testRoomSelectionSwitchesToInquiryForOnRequestRoom(): void
|
||||
public function testRoomSelectionClearsInquiryFromStep3Fallback(): void
|
||||
{
|
||||
$bookingDto = $this->startMixedRoomsBooking();
|
||||
$bookingDto->bookingStatus = 'A';
|
||||
|
||||
$this->selectRoom($bookingDto, 2);
|
||||
$this->bookingService->updateBookingStatusFromRoomSelection($bookingDto);
|
||||
|
||||
$this->assertSame('A', $bookingDto->bookingStatus);
|
||||
}
|
||||
|
||||
public function testRoomSelectionRevertsInquiryWhenOnRequestRoomIsDeselected(): void
|
||||
{
|
||||
$bookingDto = $this->startMixedRoomsBooking();
|
||||
|
||||
$this->selectRoom($bookingDto, 2);
|
||||
$this->bookingService->updateBookingStatusFromRoomSelection($bookingDto);
|
||||
$this->selectRoom($bookingDto, 1);
|
||||
$this->bookingService->updateBookingStatusFromRoomSelection($bookingDto);
|
||||
|
||||
|
||||
Reference in new issue
Block a user