feat: split summary DTOs into typed sub-objects

This commit is contained in:
Björn Fromme
2026-04-12 11:23:19 +02:00
parent 69705052b3
commit aa997826f8
18 changed files with 224 additions and 113 deletions
+20 -20
View File
@@ -3,7 +3,7 @@
<div class="shrink-0 px-4 lg:px-8 py-4 lg:flex lg:flex-col lg:justify-center shadow-md relative z-10">
<div class="flex items-center justify-between pb-2">
<span class="block uppercase font-semibold">Gesamtpreis</span>
<span class="font-semibold">{{ summaryData.payableAmount|format_currency('EUR') }}</span>
<span class="font-semibold">{{ summaryData.vouchers.payableAmount|format_currency('EUR') }}</span>
</div>
<div class="flex items-center justify-between">
<span class="block uppercase font-semibold">Buchungsübersicht</span>
@@ -83,8 +83,8 @@
Zusatzleistungen
</td>
<td class="p-2 align-top w-24 text-right whitespace-nowrap">
{% if mutableData.items['additional_services'].mutable %}
{{ mutableData.items['additional_services'].mutableBefore|date('d.m.Y') }}
{% if mutableData.additionalServices and mutableData.additionalServices.mutable %}
{{ mutableData.additionalServices.mutableBefore|date('d.m.Y') }}
{% else %}
nicht mehr möglich
{% endif %}
@@ -95,8 +95,8 @@
Beförderung
</td>
<td class="p-2 align-top w-24 text-right whitespace-nowrap">
{% if mutableData.items['transportation'].mutable %}
{{ mutableData.items['transportation'].mutableBefore|date('d.m.Y') }}
{% if mutableData.transportation and mutableData.transportation.mutable %}
{{ mutableData.transportation.mutableBefore|date('d.m.Y') }}
{% else %}
nicht mehr möglich
{% endif %}
@@ -107,8 +107,8 @@
Zustiege
</td>
<td class="p-2 align-top w-24 text-right whitespace-nowrap">
{% if mutableData.items['pickup'].mutable %}
{{ mutableData.items['pickup'].mutableBefore|date('d.m.Y') }}
{% if mutableData.pickup and mutableData.pickup.mutable %}
{{ mutableData.pickup.mutableBefore|date('d.m.Y') }}
{% else %}
nicht mehr möglich
{% endif %}
@@ -119,8 +119,8 @@
Unterkunft
</td>
<td class="p-2 align-top w-24 text-right whitespace-nowrap">
{% if mutableData.items['accommodation'].mutable %}
{{ mutableData.items['accommodation'].mutableBefore|date('d.m.Y') }}
{% if mutableData.accommodation and mutableData.accommodation.mutable %}
{{ mutableData.accommodation.mutableBefore|date('d.m.Y') }}
{% else %}
nicht mehr möglich
{% endif %}
@@ -131,13 +131,13 @@
{% endif %}
{# Rooms Section #}
{% if summaryData.pricingData.rooms is not empty %}
{% if summaryData.pricing.rooms is not empty %}
<div class="border border-primary-bg mb-4">
<div class="p-2 bg-primary-bg uppercase font-semibold">
Unterkunft
</div>
<table class="w-full table-fixed">
{% for roomPricing in summaryData.pricingData.rooms %}
{% for roomPricing in summaryData.pricing.rooms %}
<tr>
<td class="p-2 align-top">
{{ roomPricing.quantity }}x {{ roomPricing.label }}
@@ -152,12 +152,12 @@
{% endif %}
{# Services Section #}
{% if summaryData.pricingData.services is not empty %}
{% if summaryData.pricing.services is not empty %}
<div class="border border-primary-bg mb-4">
<div class="p-2 bg-primary-bg uppercase font-semibold">
Leistungen
</div>
{% for serviceGroup in summaryData.pricingData.services %}
{% for serviceGroup in summaryData.pricing.services %}
<div class="p-2 text-primary-dark/70 uppercase font-semibold">
{{ serviceGroup.groupName }}
</div>
@@ -178,13 +178,13 @@
{% endif %}
{# Surcharges Section (Edit mode only) #}
{% if summaryData.pricingData.surcharges is defined and summaryData.pricingData.surcharges is not empty %}
{% if summaryData.pricing.surcharges is not empty %}
<div class="border border-primary-bg mb-4">
<div class="p-2 bg-primary-bg uppercase font-semibold">
Zu-/Abschläge
</div>
<table class="w-full table-fixed">
{% for surchargePricing in summaryData.pricingData.surcharges %}
{% for surchargePricing in summaryData.pricing.surcharges %}
<tr>
<td class="px-2 pb-2 align-top">
{{ surchargePricing.participantCount }}x {{ surchargePricing.label }}
@@ -199,9 +199,9 @@
{% endif %}
{# Total Section #}
{% if summaryData.totalPrice > 0 %}
{% if summaryData.pricing.grandTotal > 0 %}
{# Show subtotal and voucher discounts when vouchers are applied #}
{% set acceptedVouchers = bookingDto.getAcceptedVouchers() %}
{% set acceptedVouchers = summaryData.vouchers.acceptedVouchers %}
{% if acceptedVouchers and acceptedVouchers.hasVouchers() %}
<div class="border border-primary-bg mb-4">
<div class="p-2 bg-primary-bg uppercase font-semibold">
@@ -214,7 +214,7 @@
Gesamtpreis
</td>
<td class="px-2 pb-2 align-top w-24 text-right whitespace-nowrap">
{{ summaryData.totalPrice|format_currency('EUR') }}
{{ summaryData.pricing.grandTotal|format_currency('EUR') }}
</td>
</tr>
{# Voucher discounts breakdown #}
@@ -239,12 +239,12 @@
{# Amount to pay after vouchers #}
<div class="flex items-center justify-between px-2 pb-2">
<span class="block uppercase font-semibold">Zu zahlen</span>
<span class="font-semibold">{{ summaryData.payableAmount|format_currency('EUR') }}</span>
<span class="font-semibold">{{ summaryData.vouchers.payableAmount|format_currency('EUR') }}</span>
</div>
{% else %}
<div class="flex items-center justify-between pb-2">
<span class="block uppercase font-semibold">Gesamtpreis</span>
<span class="font-semibold">{{ summaryData.payableAmount|format_currency('EUR') }}</span>
<span class="font-semibold">{{ summaryData.vouchers.payableAmount|format_currency('EUR') }}</span>
</div>
{% endif %}
{% endif %}