fix: refresh live room availability during create flow
This commit is contained in:
1 parent
a73e8a593f
commit
cdce7d57e0
26 files changed
+1976
-54
No files matched your search
@@ -158,6 +158,34 @@ class BookingConfiguratorStatusTest extends TestCase
|
||||
$this->bookingService->startFreshBooking($request, 123, 456);
|
||||
}
|
||||
|
||||
public function testStartFreshBookingRejectsRoomsThatGoUnavailableDuringLiveRefresh(): void
|
||||
{
|
||||
$travel = $this->createTravelWithRooms([
|
||||
['status' => Constants::STATUS_AVAILABLE, 'available' => 1],
|
||||
]);
|
||||
|
||||
$this->travelDataService
|
||||
->expects($this->once())
|
||||
->method('getTravelData')
|
||||
->willReturn($travel);
|
||||
|
||||
$this->travelDataService
|
||||
->expects($this->once())
|
||||
->method('enrichWithFreshAvailabilities')
|
||||
->with($travel, true, true, true)
|
||||
->willReturnCallback(static function (Travel $travel): bool {
|
||||
$travel->rooms[1]->available = 0;
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
$request = $this->createRequestWithSession();
|
||||
|
||||
$this->expectException(NoRoomsAvailableException::class);
|
||||
|
||||
$this->bookingService->startFreshBooking($request, 123, 456);
|
||||
}
|
||||
|
||||
public function testStartFreshBookingWithApiRestrictionsForcesInquiry(): void
|
||||
{
|
||||
// Even with Frei rooms, if API says only 'A' allowed, booking status should be 'A'
|
||||
|
||||
Reference in new issue
Block a user