fix: correctly calculate room pricing based on participant assignment
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user