wip: finalize implementation

This commit is contained in:
Björn Fromme committed 2026-03-16 11:59:11 +01:00
1 parent b882175f36
commit 5ef3bb9cbf
20 files changed
+112 -224

No files matched your search

@@ -5,7 +5,9 @@ declare(strict_types=1);
namespace App\Controller\Booking\Traits;
use App\Form\Model\BookingDto;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Response;
/**
* Provides common functionality for booking creation controllers.
@@ -78,4 +80,20 @@ trait BookingCreateTrait
'groupedSelectedRooms' => $groupedSelectedRooms,
];
}
/**
* Handles API errors by logging, adding flash message, and rendering the form.
*/
private function handleApiError(
string $logMessage,
array $context,
string $flashMessage,
BookingDto $bookingCreateDto,
FormInterface $form,
): Response {
$this->logger->error($logMessage, $context);
$this->addFlash('error', $flashMessage);
return $this->renderStepForm($bookingCreateDto, $form);
}
}
@@ -67,7 +67,6 @@ trait ParticipantCardFlowTrait
// Merge default options with provided options
$formOptions = array_merge([
'booking_context' => $bookingDto,
'edit_mode' => BookingDto::MODE_EDIT === $bookingDto->getMode(),
], $options);
return $this->createForm(BookingParticipantType::class, $participant, $formOptions);