chore: cleanup, updated docs

This commit is contained in:
Björn Fromme
2026-03-16 11:59:11 +01:00
parent a0d5768752
commit 9c6f4d59b3
3 changed files with 42 additions and 17 deletions
+10 -4
View File
@@ -315,8 +315,10 @@ class BookingPriceCalculatorService
*
* @return float The total price for the specified participant excluding insurance and non-calculated services
*/
public function calculateIndividualParticipantPriceExcludingInsurance(BookingDto $bookingDto, int $participantIndex): float
{
public function calculateIndividualParticipantPriceExcludingInsurance(
BookingDto $bookingDto,
int $participantIndex,
): float {
$participant = $bookingDto->getParticipant($participantIndex);
if (null === $participant) {
return 0.0;
@@ -591,8 +593,12 @@ class BookingPriceCalculatorService
*
* @return float The total service cost for this participant
*/
private function calculateParticipantServiceTotal(ParticipantDto $participant, bool $includeInsurance = true, ?BookingDto $bookingDto = null, bool $onlyInsuranceCalculationServices = false): float
{
private function calculateParticipantServiceTotal(
ParticipantDto $participant,
bool $includeInsurance = true,
?BookingDto $bookingDto = null,
bool $onlyInsuranceCalculationServices = false,
): float {
$serviceTotal = 0.0;
// Single service selections
+29 -10
View File
@@ -55,8 +55,12 @@ class InsuranceService
*
* @return array<Insurance> Filtered array of eligible insurances, sorted by price
*/
public function getEligibleInsurances(array $insurances, ParticipantDto $participant, BookingDto $booking, float $travelPrice): array
{
public function getEligibleInsurances(
array $insurances,
ParticipantDto $participant,
BookingDto $booking,
float $travelPrice
): array {
$travelStartDate = $booking->travel->dateFrom;
$travelEndDate = $booking->travel->dateTo;
@@ -99,8 +103,13 @@ class InsuranceService
*
* @return Insurance|null The reassigned insurance or null if no suitable match found
*/
public function reassignInsuranceForPriceChange(array $availableInsurances, Insurance $currentInsurance, ParticipantDto $participant, BookingDto $booking, float $travelPrice): ?Insurance
{
public function reassignInsuranceForPriceChange(
array $availableInsurances,
Insurance $currentInsurance,
ParticipantDto $participant,
BookingDto $booking,
float $travelPrice
): ?Insurance {
// Group insurances of the same type
$sameTypeInsurances = $this->filterByType($availableInsurances, $currentInsurance);
@@ -125,8 +134,12 @@ class InsuranceService
*
* @return array<int, Insurance|null> Array indexed by participant index with assigned insurances
*/
public function batchAssignInsuranceToParticipants(array $availableInsurances, Insurance $selectedInsurance, BookingDto $booking, array $participantPrices): array
{
public function batchAssignInsuranceToParticipants(
array $availableInsurances,
Insurance $selectedInsurance,
BookingDto $booking,
array $participantPrices
): array {
$assignments = [];
// Group insurances of the same type
@@ -264,8 +277,11 @@ class InsuranceService
return true;
}
private function checkAgeConstraints(Insurance $insurance, ParticipantDto $participant, \DateTimeImmutable $travelStartDate): bool
{
private function checkAgeConstraints(
Insurance $insurance,
ParticipantDto $participant,
\DateTimeImmutable $travelStartDate
): bool {
$participantAge = $participant->getAge($travelStartDate);
// If no birth date is provided, skip age constraints (field will be hidden via field state conditions)
@@ -286,8 +302,11 @@ class InsuranceService
return true;
}
private function checkTravelDateConstraints(Insurance $insurance, \DateTimeImmutable $travelStartDate, \DateTimeImmutable $travelEndDate): bool
{
private function checkTravelDateConstraints(
Insurance $insurance,
\DateTimeImmutable $travelStartDate,
\DateTimeImmutable $travelEndDate
): bool {
// Check travel start date
if (null !== $insurance->travelDateFrom && $travelStartDate < $insurance->travelDateFrom) {
return false;