feat: centralize create/edit flow contexts, extract edit submit service
This commit is contained in:
1 parent
f903f17ebd
commit
69705052b3
28 files changed
+1342
-423
No files matched your search
@@ -9,11 +9,10 @@ use App\Controller\Booking\Traits\BookingCreateTrait;
|
||||
use App\Controller\Booking\Traits\BookingExceptionHandlerTrait;
|
||||
use App\Form\BookingCreateStep2Type;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingService;
|
||||
use App\Service\BookingParticipantCountService;
|
||||
use App\Service\BookingSessionService;
|
||||
use App\Service\BookingSummaryDataService;
|
||||
use App\Service\ParticipantCardDataService;
|
||||
use App\Service\ParticipantPrepopulationService;
|
||||
use App\Service\RoomAssignmentService;
|
||||
use App\Service\TravelDataService;
|
||||
@@ -37,10 +36,9 @@ class Step2Controller extends AbstractController
|
||||
private readonly BookingService $bookingService,
|
||||
private readonly BookingParticipantCountService $participantCountService,
|
||||
private readonly BookingSessionService $bookingSessionService,
|
||||
private readonly BookingSummaryDataService $summaryDataService,
|
||||
private readonly BookingCreateContextFactory $createContextFactory,
|
||||
private readonly TravelDataService $travelDataService,
|
||||
private readonly RoomAssignmentService $roomAssignmentService,
|
||||
private readonly ParticipantCardDataService $participantCardService,
|
||||
private readonly ParticipantPrepopulationService $prepopulationService,
|
||||
) {
|
||||
}
|
||||
@@ -106,18 +104,11 @@ class Step2Controller extends AbstractController
|
||||
return $this->redirectToRoute('app_booking_create_step_3');
|
||||
}
|
||||
|
||||
// Always generate card data with validation state to show completeness
|
||||
$cardsData = $this->participantCardService->getAllCardsDataWithValidation($bookingCreateDto);
|
||||
|
||||
// Get complete summary data (pricing, rooms, CMS data)
|
||||
$summaryData = $this->summaryDataService->getSummaryData($bookingCreateDto);
|
||||
$context = $this->createContextFactory->createWithParticipantCards($bookingCreateDto, $form->isSubmitted());
|
||||
|
||||
$templateData = [
|
||||
'form' => $form->createView(),
|
||||
'bookingDto' => $bookingCreateDto,
|
||||
'cardsData' => $cardsData,
|
||||
'summaryData' => $summaryData,
|
||||
'isSubmitted' => $form->isSubmitted(),
|
||||
'bookingCreateContext' => $context,
|
||||
];
|
||||
|
||||
return $this->render('booking/create/step_2.html.twig', $templateData);
|
||||
|
||||
Reference in new issue
Block a user