feat: dedicated room pricing calculation for step 1 of create flow

This commit is contained in:
Björn Fromme
2026-03-19 16:40:59 +01:00
parent df8566e1b5
commit 301b14f518
5 changed files with 79 additions and 20 deletions
@@ -259,6 +259,35 @@ class BookingPriceCalculatorServiceTest extends TestCase
$this->assertEquals(0.0, $result[0]['totalPrice']);
}
public function testCalculateRoomPricingUsesSelectionModeForStepOneSummary(): void
{
$room = new Room();
$room->id = 3;
$room->price = 229.0;
$room->minPax = 2;
$room->label = 'Doppelzimmer Dusche/WC';
$travel = new Travel();
$travel->rooms = [$room];
$roomSelection = new RoomSelectionDto();
$roomSelection->id = 3;
$roomSelection->quantity = 1;
$bookingDto = new BookingDto($travel, 1);
$bookingDto->roomSelections = [$roomSelection];
$bookingDto->participants = [
$this->createParticipantWithAssignedRoom(3),
$this->createParticipantWithAssignedRoom(3),
];
$result = $this->service->calculateRoomPricing($bookingDto, RoomPricingCalculator::PRICING_MODE_SELECTION);
$this->assertCount(1, $result);
$this->assertEquals(2, $result[0]['participantCount']);
$this->assertEquals(458.0, $result[0]['totalPrice']);
}
public function testCalculateRoomPricingInEditModeUsesStoredIndividualPrices(): void
{
$travel = new Travel();