fix: refresh live room availability during create flow

This commit is contained in:
Björn Fromme committed 2026-07-14 11:25:23 +02:00
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'