wip: modernized edit flow
This commit is contained in:
1 parent
0d073a36a3
commit
28831a3b06
75 files changed
+1662
-747
No files matched your search
@@ -6,7 +6,7 @@ namespace App\Form\Service;
|
||||
|
||||
use App\BusProNet\Constants;
|
||||
use App\BusProNet\Model\Service;
|
||||
use App\Form\Model\BookingDtoInterface;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Form\Service\Abstract\AbstractParticipantFieldHandler;
|
||||
|
||||
/**
|
||||
@@ -77,10 +77,10 @@ class ParticipantCoursesFieldHandler extends AbstractParticipantFieldHandler
|
||||
* no longer appropriate for the participant's age are automatically removed.
|
||||
*
|
||||
* @param array<string, mixed> $submittedData The submitted participant form data
|
||||
* @param BookingDtoInterface $bookingDto The booking DTO to update (create or edit)
|
||||
* @param BookingDto $bookingDto The booking DTO to update (create or edit)
|
||||
* @param int $participantIndex The index of the participant being processed
|
||||
*/
|
||||
public function processField(array $submittedData, BookingDtoInterface $bookingDto, int $participantIndex): void
|
||||
public function processField(array $submittedData, BookingDto $bookingDto, int $participantIndex): void
|
||||
{
|
||||
// Safely get the participant object, returning early if not found
|
||||
$participant = $this->getParticipant($bookingDto, $participantIndex);
|
||||
@@ -111,7 +111,7 @@ class ParticipantCoursesFieldHandler extends AbstractParticipantFieldHandler
|
||||
*
|
||||
* @param array $selectedServices List of currently selected courses
|
||||
* @param array $availableServices List of all available courses
|
||||
* @param BookingDtoInterface $bookingDto The booking DTO for context
|
||||
* @param BookingDto $bookingDto The booking DTO for context
|
||||
* @param int $participantIndex The participant index for age evaluation
|
||||
*
|
||||
* @return array Filtered array of valid course selections
|
||||
@@ -119,7 +119,7 @@ class ParticipantCoursesFieldHandler extends AbstractParticipantFieldHandler
|
||||
private function filterValidServiceSelections(
|
||||
array $selectedServices,
|
||||
array $availableServices,
|
||||
BookingDtoInterface $bookingDto,
|
||||
BookingDto $bookingDto,
|
||||
int $participantIndex,
|
||||
): array {
|
||||
$validSelections = [];
|
||||
@@ -142,7 +142,7 @@ class ParticipantCoursesFieldHandler extends AbstractParticipantFieldHandler
|
||||
*
|
||||
* @param mixed $selectedService The selected course to validate
|
||||
* @param array $availableServices Array of available courses
|
||||
* @param BookingDtoInterface $bookingDto The booking DTO for context
|
||||
* @param BookingDto $bookingDto The booking DTO for context
|
||||
* @param int $participantIndex The participant index for age evaluation
|
||||
*
|
||||
* @return bool True if the course is valid for the participant, false otherwise
|
||||
@@ -150,7 +150,7 @@ class ParticipantCoursesFieldHandler extends AbstractParticipantFieldHandler
|
||||
private function isServiceValidForParticipant(
|
||||
mixed $selectedService,
|
||||
array $availableServices,
|
||||
BookingDtoInterface $bookingDto,
|
||||
BookingDto $bookingDto,
|
||||
int $participantIndex,
|
||||
): bool {
|
||||
// Find the service in available services
|
||||
|
||||
Reference in new issue
Block a user