feat: move prepopulation guards into participant service
This commit is contained in:
1 parent
dbc0b4acee
commit
63e8a068b3
9 files changed
+114
-289
No files matched your search
@@ -6,12 +6,12 @@ namespace App\Controller\Booking\Create;
|
||||
|
||||
use App\Form\BookingParticipantType;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Form\Service\DummyDataFillService;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Service\BookingService;
|
||||
use App\Service\BookingSessionService;
|
||||
use App\Service\BookingSummaryDataService;
|
||||
use App\Service\ParticipantFormSupportService;
|
||||
use App\Service\ParticipantPrepopulationService;
|
||||
use App\Service\TravelDataService;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
@@ -31,7 +31,7 @@ class Step2ParticipantController extends AbstractController
|
||||
private readonly BookingSessionService $bookingSessionService,
|
||||
private readonly BookingSummaryDataService $summaryDataService,
|
||||
private readonly TravelDataService $travelDataService,
|
||||
private readonly DummyDataFillService $dummyDataFillService,
|
||||
private readonly ParticipantPrepopulationService $prepopulationService,
|
||||
private readonly ParticipantFormSupportService $participantFormSupportService,
|
||||
) {
|
||||
}
|
||||
@@ -62,11 +62,11 @@ class Step2ParticipantController extends AbstractController
|
||||
$isSubmitted = $form->isSubmitted();
|
||||
|
||||
$isDummyDataFill = $this
|
||||
->dummyDataFillService
|
||||
->isTokenMatch($bookingDto->participants[$index], $bookingDto->getMode())
|
||||
->prepopulationService
|
||||
->isDummyDataFillRequested($bookingDto->participants[$index], $bookingDto->getMode())
|
||||
;
|
||||
if (true === $isSubmitted && true === $isDummyDataFill) {
|
||||
$this->dummyDataFillService->fill($bookingDto->participants[$index], $index);
|
||||
$this->prepopulationService->fillDummyParticipant($bookingDto->participants[$index], $index);
|
||||
|
||||
$this->bookingService->preselectDefaultServices($bookingDto);
|
||||
$this->bookingService->applyCreateBookingStatusRules($bookingDto);
|
||||
|
||||
Reference in new issue
Block a user