wip: modernized edit flow

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent 0d073a36a3
commit 28831a3b06
75 changed files with 1662 additions and 747 deletions
@@ -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;
/**
@@ -84,10 +84,10 @@ class ParticipantAdditionalServicesFieldHandler extends AbstractParticipantField
* 5. Updates participant with filtered valid selections
*
* @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);
@@ -122,7 +122,7 @@ class ParticipantAdditionalServicesFieldHandler extends AbstractParticipantField
*
* @param array $selectedServices List of currently selected services
* @param array $availableServices List of all available additional services
* @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 service selections
@@ -130,7 +130,7 @@ class ParticipantAdditionalServicesFieldHandler extends AbstractParticipantField
private function filterValidServiceSelections(
array $selectedServices,
array $availableServices,
BookingDtoInterface $bookingDto,
BookingDto $bookingDto,
int $participantIndex,
): array {
$validSelections = [];
@@ -156,7 +156,7 @@ class ParticipantAdditionalServicesFieldHandler extends AbstractParticipantField
*
* @param mixed $selectedService The selected service to validate
* @param array $availableServices Array of available services
* @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 service is valid for the participant, false otherwise
@@ -164,7 +164,7 @@ class ParticipantAdditionalServicesFieldHandler extends AbstractParticipantField
private function isServiceValidForParticipant(
mixed $selectedService,
array $availableServices,
BookingDtoInterface $bookingDto,
BookingDto $bookingDto,
int $participantIndex,
): bool {
// Find the service in available services