wip: improved refresh logic

This commit is contained in:
Björn Fromme
2025-09-03 16:48:23 +02:00
parent ccb2fa75ac
commit 2953ed0b2d
5 changed files with 95 additions and 3 deletions
@@ -46,6 +46,10 @@ class CreateStep2Controller extends AbstractController
// Ensure correct number of participants
$this->ensureCorrectNumberOfParticipants($bookingCreateDto);
$participantsCount = $this->getParticipantsCount($bookingCreateDto);
// Pre-select mandatory services for participants with birth dates
$this->bookingService->preselectMandatoryServices($bookingCreateDto);
$this->bookingService->saveBookingCreateDto($request, $bookingCreateDto);
$form = $this->createForm(BookingCreateStep2Type::class, $bookingCreateDto, [
@@ -94,6 +98,16 @@ class CreateStep2Controller extends AbstractController
]);
$form->handleRequest($request);
// Pre-select mandatory services after form processing but before pricing calculation
$this->bookingService->preselectMandatoryServices($bookingCreateDto);
// Recreate the form with the updated DTO that includes mandatory services
$form = $this->createForm(BookingCreateStep2Type::class, $bookingCreateDto, [
'attr' => ['novalidate' => 'novalidate'],
'validation_groups' => false,
]);
$this->bookingService->saveBookingCreateDto($request, $bookingCreateDto);
$summary = $this->bookingService->getRoomSummaryAndParticipantCount($bookingCreateDto);