feat: refactoring and cleanup

This commit is contained in:
Björn Fromme committed 2025-12-06 15:02:13 +01:00
1 parent f4691ec67e
commit 696800aafd
41 files changed
+2591 -2233

No files matched your search

@@ -69,7 +69,7 @@ trait BookingCreateTrait
{
$participantsCount = $this->getParticipantsCount($bookingCreateDto);
$summary = $this->bookingService->getRoomSummaryAndParticipantCount($bookingCreateDto);
$roomAssignmentCounts = $this->bookingService->getRoomAssignmentCounts($bookingCreateDto);
$roomAssignmentCounts = $bookingCreateDto->getRoomAssignmentCounts();
$availableRooms = $bookingCreateDto->travel->getAvailableRooms();
$groupedSelectedRooms = $this->bookingService->groupRoomSelectionsByType($bookingCreateDto->getSelectedRooms(), $availableRooms);
@@ -142,8 +142,6 @@ trait ParticipantCardFlowTrait
'participantIndex' => $index,
'bookingDto' => $bookingDto,
'summaryData' => $summaryData,
'pricingData' => $summaryData['pricingData'],
'cmsData' => $summaryData['cmsData'],
'refreshRouteName' => $refreshRouteName,
'submitRouteName' => $submitRouteName,
]
@@ -159,6 +157,21 @@ trait ParticipantCardFlowTrait
return $response;
}
/**
* Converts collected notifications to flash messages.
*
* Used when redirecting after form submission, as HTMX-triggered toasts
* are destroyed on redirect. Flash messages persist across the redirect.
*
* @param array<array{type: string, message: string}> $notifications The notifications to convert
*/
private function addNotificationsAsFlashMessages(array $notifications): void
{
foreach ($notifications as $notification) {
$this->addFlash($notification['type'], $notification['message']);
}
}
/**
* Required services - implementing controllers must inject these.
*
@@ -170,4 +183,6 @@ trait ParticipantCardFlowTrait
abstract private function createForm(string $type, $data = null, array $options = []): FormInterface;
abstract private function render(string $view, array $parameters = [], ?Response $response = null): Response;
abstract protected function addFlash(string $type, mixed $message): void;
}