fix: don't require transportation services for canceled participants
This commit is contained in:
@@ -28,8 +28,6 @@ class BookingData
|
|||||||
$participantData = ParticipantData::fromPersonalData($participant);
|
$participantData = ParticipantData::fromPersonalData($participant);
|
||||||
$participantData->index = $index;
|
$participantData->index = $index;
|
||||||
|
|
||||||
// update services only for active participants
|
|
||||||
if ('S' !== $participantData->status) {
|
|
||||||
$participantData->courses = $booking
|
$participantData->courses = $booking
|
||||||
->getAdditionalServicesForParticipantByGroup($index, Service::TOKEN_COURSES);
|
->getAdditionalServicesForParticipantByGroup($index, Service::TOKEN_COURSES);
|
||||||
$participantData->skiPass = $booking
|
$participantData->skiPass = $booking
|
||||||
@@ -46,7 +44,6 @@ class BookingData
|
|||||||
$participantData->transportationServiceFro = $booking
|
$participantData->transportationServiceFro = $booking
|
||||||
->getTransportationServiceForParticipantAndDirection($index, 'R');
|
->getTransportationServiceForParticipantAndDirection($index, 'R');
|
||||||
$participantData->pickup = $booking->getPickupForParticipant($index);
|
$participantData->pickup = $booking->getPickupForParticipant($index);
|
||||||
}
|
|
||||||
|
|
||||||
$instance->participants[$index] = $participantData;
|
$instance->participants[$index] = $participantData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,13 +40,8 @@ class ParticipantData
|
|||||||
public array $skiPass = [];
|
public array $skiPass = [];
|
||||||
public array $board = [];
|
public array $board = [];
|
||||||
public array $rentals = [];
|
public array $rentals = [];
|
||||||
|
|
||||||
#[Assert\NotNull(message: 'Bitte angeben')]
|
|
||||||
public ?Service $transportationServiceTo = null;
|
public ?Service $transportationServiceTo = null;
|
||||||
|
|
||||||
#[Assert\NotNull(message: 'Bitte angeben')]
|
|
||||||
public ?Service $transportationServiceFro = null;
|
public ?Service $transportationServiceFro = null;
|
||||||
|
|
||||||
public ?Pickup $pickup = null;
|
public ?Pickup $pickup = null;
|
||||||
|
|
||||||
#[Assert\Callback]
|
#[Assert\Callback]
|
||||||
@@ -78,6 +73,28 @@ class ParticipantData
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[Assert\Callback]
|
||||||
|
public function assertTransportationSelected(ExecutionContextInterface $context): void
|
||||||
|
{
|
||||||
|
if ('S' === $this->status) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $this->transportationServiceTo) {
|
||||||
|
$context->buildViolation('Bitte angeben')
|
||||||
|
->atPath('transportationServiceTo')
|
||||||
|
->addViolation()
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (null === $this->transportationServiceFro) {
|
||||||
|
$context->buildViolation('Bitte angeben')
|
||||||
|
->atPath('transportationServiceFro')
|
||||||
|
->addViolation()
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[Assert\Callback]
|
#[Assert\Callback]
|
||||||
public function assertPickupSelected(ExecutionContextInterface $context): void
|
public function assertPickupSelected(ExecutionContextInterface $context): void
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user