feat: reword flash messages, add logging
This commit is contained in:
@@ -19,6 +19,7 @@ use App\Service\BookingEditDraftManager;
|
|||||||
use App\Service\BookingEditPreFlightChecker;
|
use App\Service\BookingEditPreFlightChecker;
|
||||||
use App\Service\BookingEditSubmitter;
|
use App\Service\BookingEditSubmitter;
|
||||||
use App\Service\BookingSessionManager;
|
use App\Service\BookingSessionManager;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
@@ -47,6 +48,7 @@ class IndexController extends AbstractController
|
|||||||
private readonly BookingEditContextFactory $editContextFactory,
|
private readonly BookingEditContextFactory $editContextFactory,
|
||||||
private readonly BookingEditPreFlightChecker $preFlightChecker,
|
private readonly BookingEditPreFlightChecker $preFlightChecker,
|
||||||
private readonly BookingEditSubmitter $formSubmitter,
|
private readonly BookingEditSubmitter $formSubmitter,
|
||||||
|
private readonly LoggerInterface $logger,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -83,13 +85,19 @@ class IndexController extends AbstractController
|
|||||||
try {
|
try {
|
||||||
$bookingDto = $this->dataLoader->loadFormData($request, $bookingId, $user);
|
$bookingDto = $this->dataLoader->loadFormData($request, $bookingId, $user);
|
||||||
} catch (TravelNotFoundException) {
|
} catch (TravelNotFoundException) {
|
||||||
$this->addFlash('error', 'Reisedaten sind nicht (mehr) verfügbar');
|
$this->logger->error('Unable to fetch travel data', [
|
||||||
|
'booking_id' => $bookingId,
|
||||||
|
]);
|
||||||
|
$this->addFlash('error', 'Die Reisedaten können aktuell nicht abgerufen werden. Bitte versuche es später oder wende dich an den Kundenservice.');
|
||||||
|
|
||||||
return $this->redirectToRoute('app_bookings');
|
return $this->redirectToRoute('app_bookings');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (null === $bookingDto) {
|
if (null === $bookingDto) {
|
||||||
$this->addFlash('error', 'Buchungsdaten nicht (mehr) verfügbar');
|
$this->logger->error('Unable to fetch booking data', [
|
||||||
|
'booking_id' => $bookingId,
|
||||||
|
]);
|
||||||
|
$this->addFlash('error', 'Die Buchungsdaten können aktuell nicht abgerufen werden. Bitte versuche es später oder wende dich an den Kundenservice.');
|
||||||
|
|
||||||
return $this->redirectToRoute('app_bookings');
|
return $this->redirectToRoute('app_bookings');
|
||||||
}
|
}
|
||||||
@@ -111,7 +119,10 @@ class IndexController extends AbstractController
|
|||||||
// Fetch booking data for display (surcharges, canceled status, etc.)
|
// Fetch booking data for display (surcharges, canceled status, etc.)
|
||||||
$bookingData = $this->dataLoader->fetchBookingData($bookingId, $user);
|
$bookingData = $this->dataLoader->fetchBookingData($bookingId, $user);
|
||||||
if (null === $bookingData || $bookingData instanceof Notification) {
|
if (null === $bookingData || $bookingData instanceof Notification) {
|
||||||
$this->addFlash('error', 'Buchungsdaten nicht (mehr) verfügbar');
|
$this->logger->error('Unable to fetch booking data', [
|
||||||
|
'booking_id' => $bookingId,
|
||||||
|
]);
|
||||||
|
$this->addFlash('error', 'Die Buchungsdaten können aktuell nicht abgerufen werden. Bitte versuche es später oder wende dich an den Kundenservice.');
|
||||||
|
|
||||||
return $this->redirectToRoute('app_bookings');
|
return $this->redirectToRoute('app_bookings');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ use App\Service\BookingConfigurator;
|
|||||||
use App\Service\ParticipantDataPrefiller;
|
use App\Service\ParticipantDataPrefiller;
|
||||||
use App\Service\BookingSessionManager;
|
use App\Service\BookingSessionManager;
|
||||||
use App\Service\ParticipantFormSupport;
|
use App\Service\ParticipantFormSupport;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||||
use Symfony\Component\Form\FormInterface;
|
use Symfony\Component\Form\FormInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
@@ -39,6 +40,7 @@ class ParticipantController extends AbstractController
|
|||||||
private readonly BookingSessionManager $bookingSessionService,
|
private readonly BookingSessionManager $bookingSessionService,
|
||||||
private readonly ParticipantDataPrefiller $prepopulationService,
|
private readonly ParticipantDataPrefiller $prepopulationService,
|
||||||
private readonly ParticipantFormSupport $participantFormSupportService,
|
private readonly ParticipantFormSupport $participantFormSupportService,
|
||||||
|
private readonly LoggerInterface $logger,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -68,7 +70,10 @@ class ParticipantController extends AbstractController
|
|||||||
|
|
||||||
$bookingData = $this->dataLoader->fetchBookingData($bookingId, $user);
|
$bookingData = $this->dataLoader->fetchBookingData($bookingId, $user);
|
||||||
if (null === $bookingData || $bookingData instanceof Notification) {
|
if (null === $bookingData || $bookingData instanceof Notification) {
|
||||||
$this->addFlash('error', 'Buchungsdaten nicht (mehr) verfügbar');
|
$this->logger->error('Unable to fetch booking data', [
|
||||||
|
'booking_id' => $bookingId,
|
||||||
|
]);
|
||||||
|
$this->addFlash('error', 'Die Buchungsdaten können aktuell nicht abgerufen werden. Bitte versuche es später oder wende dich an den Kundenservice.');
|
||||||
|
|
||||||
return $this->redirectToRoute('app_bookings');
|
return $this->redirectToRoute('app_bookings');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user