fix: correctly calculate room pricing based on participant assignment

This commit is contained in:
Björn Fromme
2026-03-19 15:45:23 +01:00
parent 6a6bebb2d1
commit 45d05786da
2 changed files with 68 additions and 16 deletions
+5 -4
View File
@@ -77,16 +77,17 @@ class RoomPricingCalculator
return $roomPricing;
}
$assignmentCounts = $bookingDto->getRoomAssignmentCounts();
foreach ($selectedRooms as $roomSelection) {
$room = $this->getRoomById($bookingDto, $roomSelection->id);
if (null === $room || null === $room->price) {
continue;
}
// Pricing in create flow is based on selected room quantity from step 1.
// Do not derive billable units from minPax, which represents capacity constraints.
$participantCount = $roomSelection->quantity;
$totalPrice = $roomSelection->quantity * $room->price;
// Pricing in create flow is based on actual participant assignments per room.
$participantCount = $assignmentCounts[$room->id] ?? 0;
$totalPrice = $participantCount * $room->price;
$roomPricing[] = [
'roomId' => $room->id,