chore: cleanup, updated docs
This commit is contained in:
1 parent
a0d5768752
commit
9c6f4d59b3
3 files changed
+42
-17
No files matched your search
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user