wip: insurance booking

This commit is contained in:
Björn Fromme
2025-09-30 14:37:49 +02:00
parent 90ae78262a
commit a5dce776de
11 changed files with 131 additions and 475 deletions
+6 -17
View File
@@ -359,7 +359,7 @@ class BookingPriceCalculatorService
if ($parkingTotal > 0) {
$transportationItems['transportation_parking'] = [
'serviceId' => 'transportation_parking',
'label' => 'Parkplatz',
'label' => Constants::SERVICE_LABELS[Constants::TOKEN_PARKING],
'unitPrice' => null,
'participantCount' => $parkingParticipants,
'totalPrice' => $parkingTotal,
@@ -444,23 +444,12 @@ class BookingPriceCalculatorService
*/
private function getGroupNameForSubtype(string $subType): string
{
$groupMapping = [
Constants::TOKEN_COURSES => 'Kurse',
Constants::TOKEN_SKI_PASS => 'Skipässe',
Constants::TOKEN_ADDITIONAL => 'Zusatzleistungen',
Constants::TOKEN_BOARD => 'Verpflegung',
Constants::TOKEN_RENTAL_INSURANCE => 'Leihmaterial-Versicherung',
Constants::GROUP_TRANSPORTATION => 'Beförderung',
Constants::GROUP_RENTALS => 'Leihmaterial', // Normalized rental subtype
Constants::GROUP_INSURANCE => 'Reiseversicherungen', // Normalized insurance subtype
];
// Handle rentals array (keep for backward compatibility with non-normalized subtypes)
if (true === in_array($subType, Constants::TOKEN_RENTALS, true)) {
return 'Leihmaterial';
return Constants::SERVICE_LABELS[Constants::GROUP_RENTALS];
}
return $groupMapping[$subType] ?? 'Sonstige Leistungen';
return Constants::SERVICE_LABELS[$subType] ?? 'Sonstige Leistungen';
}
/**
@@ -525,8 +514,8 @@ class BookingPriceCalculatorService
/**
* Calculates the total service cost for a single participant.
*
* @param ParticipantDto $participant The participant to calculate services for
* @param bool $includeInsurance Whether to include insurance pricing (default: true)
* @param ParticipantDto $participant The participant to calculate services for
* @param bool $includeInsurance Whether to include insurance pricing (default: true)
*
* @return float The total service cost for this participant
*/
@@ -612,7 +601,7 @@ class BookingPriceCalculatorService
*
* @param array $serviceAggregation The service aggregation array to update
* @param Insurance $insurance The insurance to add
* @param int $quantity The quantity of the insurance
* @param int $quantity The quantity of the insurance
*/
private function addInsuranceToServiceAggregation(array &$serviceAggregation, Insurance $insurance, int $quantity): void
{