wip: improved refresh logic

This commit is contained in:
Björn Fromme
2026-03-16 11:59:10 +01:00
parent 36fe4c9e9a
commit 3063a7c05f
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);