From ca052682bb0b2fe705a0d3b68d197df64417c6cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Sun, 5 Apr 2026 18:03:04 +0200 Subject: [PATCH] feat: simplify pricing and room selection display --- src/Form/RoomSelectType.php | 5 +- src/Service/BookingPriceCalculatorService.php | 24 --------- src/Service/BookingService.php | 51 ------------------- templates/booking/create/step_1.html.twig | 4 +- 4 files changed, 5 insertions(+), 79 deletions(-) diff --git a/src/Form/RoomSelectType.php b/src/Form/RoomSelectType.php index 70c4a78..94e7a83 100644 --- a/src/Form/RoomSelectType.php +++ b/src/Form/RoomSelectType.php @@ -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; } } diff --git a/src/Service/BookingPriceCalculatorService.php b/src/Service/BookingPriceCalculatorService.php index f69b1bb..0447568 100644 --- a/src/Service/BookingPriceCalculatorService.php +++ b/src/Service/BookingPriceCalculatorService.php @@ -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. * diff --git a/src/Service/BookingService.php b/src/Service/BookingService.php index 6c72b07..f41bfca 100644 --- a/src/Service/BookingService.php +++ b/src/Service/BookingService.php @@ -334,18 +334,6 @@ class BookingService return $participantsCount; } - /** - * Calculates the number of participants assigned to each room ID. - * - * @return array 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 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. * diff --git a/templates/booking/create/step_1.html.twig b/templates/booking/create/step_1.html.twig index cb38ba2..11048c4 100644 --- a/templates/booking/create/step_1.html.twig +++ b/templates/booking/create/step_1.html.twig @@ -9,7 +9,9 @@ {{ form.vars.label_room }} {% if form.vars.is_inquiry %}(nur auf Anfrage){% endif %}
- {{ 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 %}