feat: simplify pricing and room selection display

This commit is contained in:
Björn Fromme
2026-04-11 18:28:32 +02:00
parent 1b0e479e49
commit ca052682bb
4 changed files with 5 additions and 79 deletions
+2 -3
View File
@@ -38,12 +38,11 @@ class RoomSelectType extends AbstractType
$data = $form->getData();
$view->vars['label_room'] = $data->label;
$view->vars['label_price'] = null;
$view->vars['label_price_amount'] = null;
$view->vars['is_inquiry'] = Constants::STATUS_ON_REQUEST === $data->status;
if (null !== $data->price) {
$formattedPrice = number_format((float) $data->price, 2, ',', '.');
$view->vars['label_price'] = sprintf(' %s € pro Person', $formattedPrice);
$view->vars['label_price_amount'] = (float) $data->price;
}
}
@@ -183,30 +183,6 @@ class BookingPriceCalculatorService
return $surchargePricing;
}
/**
* Formats a price value for display with proper German formatting.
*
* @param float $price The price to format
*
* @return string Formatted price string (e.g., "123,45")
*/
public function formatPrice(float $price): string
{
return number_format($price, 2, ',', '.');
}
/**
* Formats a price with Euro symbol for display.
*
* @param float $price The price to format
*
* @return string Formatted price string with Euro symbol (e.g., "€123,45")
*/
public function formatPriceWithSymbol(float $price): string
{
return '€'.$this->formatPrice($price);
}
/**
* Aggregates all transportation-related services and pricing into separate line items.
*
-51
View File
@@ -334,18 +334,6 @@ class BookingService
return $participantsCount;
}
/**
* Calculates the number of participants assigned to each room ID.
*
* @return array<int, int> an array where the key is the room ID and the value is the count of assigned participants
*
* @deprecated Use BookingDto::getRoomAssignmentCounts() instead
*/
public function getRoomAssignmentCounts(BookingDto $bookingDto): array
{
return $bookingDto->getRoomAssignmentCounts();
}
/**
* Returns a summary of selected rooms, participant count, and pricing information for a booking.
*
@@ -424,45 +412,6 @@ class BookingService
return $groups;
}
/**
* Resets all participant room assignments in the DTO.
*
* @param BookingDto $dto The booking DTO to reset assignments for
*
* @deprecated Use BookingDto::resetParticipantAssignments() instead
*/
public function resetParticipantAssignments(BookingDto $dto): void
{
$dto->resetParticipantAssignments();
}
/**
* Creates a snapshot of the current room selection state.
*
* @return array<int, array{int, int}> Array of [roomId, quantity] pairs
*
* @deprecated Use BookingDto::createRoomSelectionSnapshot() instead
*/
public function createRoomSelectionSnapshot(BookingDto $dto): array
{
return $dto->createRoomSelectionSnapshot();
}
/**
* Checks if room selection has changed compared to a previous snapshot.
*
* @param array $oldSnapshot The baseline room selection snapshot
* @param BookingDto $newDto The current booking DTO
*
* @return bool True if room selections have changed, false otherwise
*
* @deprecated Use BookingDto::hasRoomSelectionChanged() instead
*/
public function hasRoomSelectionChanged(array $oldSnapshot, BookingDto $newDto): bool
{
return $newDto->hasRoomSelectionChanged($oldSnapshot);
}
/**
* Pre-selects default services for all participants.
*
+3 -1
View File
@@ -9,7 +9,9 @@
{{ form.vars.label_room }} {% if form.vars.is_inquiry %}(nur auf Anfrage){% endif %}
</div>
<div class="text-gray-500">
{{ form.vars.label_price }}
{% if form.vars.label_price_amount is defined and form.vars.label_price_amount is not null %}
{{ form.vars.label_price_amount|format_currency('EUR') }} pro Person
{% endif %}
</div>
</div>
<div>