feat: refactoring and cleanup

This commit is contained in:
Björn Fromme
2025-12-06 15:02:13 +01:00
parent f4691ec67e
commit 696800aafd
41 changed files with 2591 additions and 2233 deletions
+1 -5
View File
@@ -54,11 +54,7 @@
<div id="booking-summary"{% if htmx_oob_swap is defined and htmx_oob_swap %} hx-swap-oob="true"{% endif %}>
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingCreateDto,
'participantCount': participantCount,
'pricingData': pricingData,
'cmsData': cmsData,
'groupedSelectedRooms': groupedSelectedRooms,
'assignmentCounts': []
'summaryData': summaryData
} %}
</div>
{% endblock %}
+1 -5
View File
@@ -64,11 +64,7 @@
<div id="booking-summary"{% if htmx_oob_swap|default(false) %} hx-swap-oob="true"{% endif %}>
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingDto,
'participantCount': summaryData.participantCount,
'groupedSelectedRooms': summaryData.groupedSelectedRooms,
'assignmentCounts': summaryData.assignmentCounts,
'pricingData': pricingData,
'cmsData': cmsData
'summaryData': summaryData
} %}
</div>
{% endblock %}
@@ -14,11 +14,7 @@
<div id="booking-summary">
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingDto,
'participantCount': summaryData.participantCount,
'groupedSelectedRooms': summaryData.groupedSelectedRooms,
'assignmentCounts': summaryData.assignmentCounts,
'pricingData': pricingData,
'cmsData': cmsData
'summaryData': summaryData
} %}
</div>
</div>
+1 -5
View File
@@ -59,11 +59,7 @@
<div id="booking-summary">
{% include 'booking/_summary.html.twig' with {
'bookingCreateDto': bookingCreateDto,
'participantCount': participantCount,
'pricingData': pricingData,
'cmsData': cmsData,
'groupedSelectedRooms': groupedSelectedRooms,
'assignmentCounts': assignmentCounts
'summaryData': summaryData
} %}
</div>
</div>
+11 -11
View File
@@ -30,16 +30,16 @@
<h3 class="text-xl font-semibold mb-6 text-blue-900">Preisübersicht</h3>
{# Rooms Section #}
{% if pricingData.rooms is not empty %}
{% if summaryData.pricingData.rooms is not empty %}
<div class="mb-6 pb-6 border-b border-blue-200">
<h4 class="font-semibold text-lg mb-3 text-blue-800">Unterkunft</h4>
<div class="space-y-2">
{% for roomPricing in pricingData.rooms %}
{% for roomPricing in summaryData.pricingData.rooms %}
<div class="flex justify-between items-start">
<div class="text-sm text-gray-700">
<span class="font-medium">{{ roomPricing.quantity }}x {{ roomPricing.label }}</span>
{% if assignmentCounts is defined and assignmentCounts[roomPricing.roomId] is defined %}
<span class="block text-xs text-gray-600">{{ assignmentCounts[roomPricing.roomId] }} Person(en) belegt</span>
{% if summaryData.assignmentCounts[roomPricing.roomId] is defined %}
<span class="block text-xs text-gray-600">{{ summaryData.assignmentCounts[roomPricing.roomId] }} Person(en) belegt</span>
{% endif %}
</div>
<div class="text-right">
@@ -57,10 +57,10 @@
{% endif %}
{# Services Section #}
{% if pricingData.services is not empty %}
{% if summaryData.pricingData.services is not empty %}
<div class="mb-6 pb-6 border-b border-blue-200">
<h4 class="font-semibold text-lg mb-3 text-blue-800">Leistungen</h4>
{% for serviceGroup in pricingData.services %}
{% for serviceGroup in summaryData.pricingData.services %}
<div class="mb-4 last:mb-0">
<h5 class="font-medium text-sm text-gray-700 mb-2 uppercase tracking-wide">{{ serviceGroup.groupName }}</h5>
<div class="space-y-1.5 ml-4">
@@ -84,7 +84,7 @@
{% endif %}
{# Grand Total #}
{% if pricingData.grandTotal is defined and pricingData.grandTotal > 0 %}
{% if summaryData.pricingData.grandTotal is defined and summaryData.pricingData.grandTotal > 0 %}
<div class="pt-4">
{% set acceptedVouchers = bookingCreateDto.getAcceptedVouchers() %}
{% if acceptedVouchers and acceptedVouchers.hasVouchers() %}
@@ -92,7 +92,7 @@
<div class="flex justify-between items-center mb-3">
<span class="text-lg text-blue-800">Gesamtpreis:</span>
<span class="text-lg text-blue-800">
{{ pricingData.grandTotal|number_format(2, ',', '.') }}
{{ summaryData.pricingData.grandTotal|number_format(2, ',', '.') }}
</span>
</div>
@@ -120,14 +120,14 @@
<div class="flex justify-between items-center">
<span class="font-bold text-xl text-blue-900">Zu zahlen:</span>
<span class="font-bold text-2xl text-blue-900">
{{ (pricingData.grandTotal - acceptedVouchers.totalDiscount)|number_format(2, ',', '.') }}
{{ (summaryData.pricingData.grandTotal - acceptedVouchers.totalDiscount)|number_format(2, ',', '.') }}
</span>
</div>
{% else %}
<div class="flex justify-between items-center">
<span class="font-bold text-xl text-blue-900">Gesamtpreis:</span>
<span class="font-bold text-2xl text-blue-900">
{{ pricingData.grandTotal|number_format(2, ',', '.') }}
{{ summaryData.pricingData.grandTotal|number_format(2, ',', '.') }}
</span>
</div>
{% endif %}
@@ -137,7 +137,7 @@
{# Participants Summary #}
<div class="mb-8 p-6 bg-gray-50 rounded-lg border border-gray-200">
<h3 class="text-xl font-semibold mb-4">Teilnehmer ({{ participantCount }})</h3>
<h3 class="text-xl font-semibold mb-4">Teilnehmer ({{ summaryData.participantCount }})</h3>
{% for participant in bookingCreateDto.participants %}
<div class="mb-6 pb-6 {% if not loop.last %}border-b border-gray-300{% endif %}">
<div class="flex justify-between items-start mb-3">