feat: rename BookingSessionStore to BookingSessionManager
This commit is contained in:
@@ -12,7 +12,7 @@ use App\Exception\TravelNotFoundException;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Model\BookingQueryParams;
|
||||
use App\Service\BookingConfigurator;
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\BookingSessionManager;
|
||||
use App\Service\BookingSummaryAssembler;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -33,7 +33,7 @@ class IndexController extends AbstractController
|
||||
|
||||
public function __construct(
|
||||
private readonly BookingConfigurator $bookingService,
|
||||
private readonly BookingSessionStore $bookingSessionService,
|
||||
private readonly BookingSessionManager $bookingSessionService,
|
||||
private readonly AgencyLoader $agencyLoader,
|
||||
private readonly BookingSummaryAssembler $summaryDataService,
|
||||
) {
|
||||
|
||||
@@ -9,9 +9,9 @@ use App\Controller\Booking\Traits\BookingExceptionHandlerTrait;
|
||||
use App\Form\BookingCreateStep1Type;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingConfigurator;
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingSessionManager;
|
||||
use App\Service\RoomPricingCalculator;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -32,7 +32,7 @@ class Step1Controller extends AbstractController
|
||||
|
||||
public function __construct(
|
||||
private readonly BookingConfigurator $bookingService,
|
||||
private readonly BookingSessionStore $bookingSessionService,
|
||||
private readonly BookingSessionManager $bookingSessionService,
|
||||
private readonly BookingCreateContextFactory $createContextFactory,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -5,15 +5,15 @@ declare(strict_types=1);
|
||||
namespace App\Controller\Booking\Create;
|
||||
|
||||
use App\BusProNet\Model\Travel;
|
||||
use App\Entity\User;
|
||||
use App\Controller\Booking\Traits\BookingCreateTrait;
|
||||
use App\Controller\Booking\Traits\BookingExceptionHandlerTrait;
|
||||
use App\Entity\User;
|
||||
use App\Form\BookingCreateStep2Type;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Form\Model\ParticipantDto;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingConfigurator;
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingSessionManager;
|
||||
use App\Service\ParticipantDataPrefiller;
|
||||
use App\Service\RoomAssigner;
|
||||
use App\Service\TravelDataProvider;
|
||||
@@ -35,7 +35,7 @@ class Step2Controller extends AbstractController
|
||||
|
||||
public function __construct(
|
||||
private readonly BookingConfigurator $bookingService,
|
||||
private readonly BookingSessionStore $bookingSessionService,
|
||||
private readonly BookingSessionManager $bookingSessionService,
|
||||
private readonly BookingCreateContextFactory $createContextFactory,
|
||||
private readonly TravelDataProvider $travelDataService,
|
||||
private readonly RoomAssigner $roomAssignmentService,
|
||||
|
||||
@@ -7,13 +7,13 @@ namespace App\Controller\Booking\Create;
|
||||
use App\Form\BookingParticipantType;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingConfigurator;
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\ParticipantFormSupport;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingSessionManager;
|
||||
use App\Service\ParticipantDataPrefiller;
|
||||
use App\Service\TravelDataProvider;
|
||||
use App\Service\ParticipantFormSupport;
|
||||
use App\Service\RoomPricingCalculator;
|
||||
use App\Service\TravelDataProvider;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -29,7 +29,7 @@ class Step2ParticipantController extends AbstractController
|
||||
|
||||
public function __construct(
|
||||
private readonly BookingConfigurator $bookingService,
|
||||
private readonly BookingSessionStore $bookingSessionService,
|
||||
private readonly BookingSessionManager $bookingSessionService,
|
||||
private readonly BookingCreateContextFactory $createContextFactory,
|
||||
private readonly TravelDataProvider $travelDataService,
|
||||
private readonly ParticipantDataPrefiller $prepopulationService,
|
||||
|
||||
@@ -13,11 +13,11 @@ use App\Controller\Booking\Traits\BookingExceptionHandlerTrait;
|
||||
use App\Form\BookingCreateStep3Type;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Service\BookingConfigurator;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingPriceCalculator;
|
||||
use App\Service\BookingPriceMismatchAnalyzer;
|
||||
use App\Service\BookingConfigurator;
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\BookingSessionManager;
|
||||
use App\Service\RoomPricingCalculator;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@@ -37,7 +37,7 @@ class Step3Controller extends AbstractController
|
||||
|
||||
public function __construct(
|
||||
private readonly BookingConfigurator $bookingService,
|
||||
private readonly BookingSessionStore $bookingSessionService,
|
||||
private readonly BookingSessionManager $bookingSessionService,
|
||||
private readonly BookingCreateContextFactory $createContextFactory,
|
||||
private readonly BookingPriceCalculator $priceCalculator,
|
||||
private readonly BookingPriceMismatchAnalyzer $priceMismatchDiagnostics,
|
||||
|
||||
@@ -9,14 +9,14 @@ use App\BusProNet\Exception\TimeoutException;
|
||||
use App\BusProNet\Model\Notification;
|
||||
use App\Controller\Booking\Traits\BookingCreateTrait;
|
||||
use App\Controller\Booking\Traits\BookingExceptionHandlerTrait;
|
||||
use App\Entity\User;
|
||||
use App\Exception\NewsletterProviderException;
|
||||
use App\Form\BookingCreateStep4Type;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Entity\User;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingConfigurator;
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingSessionManager;
|
||||
use App\Service\MailjetApiClient;
|
||||
use App\Service\NewsletterManager;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@@ -38,7 +38,7 @@ class Step4Controller extends AbstractController
|
||||
|
||||
public function __construct(
|
||||
private readonly BookingConfigurator $bookingService,
|
||||
private readonly BookingSessionStore $bookingSessionService,
|
||||
private readonly BookingSessionManager $bookingSessionService,
|
||||
private readonly BookingCreateContextFactory $createContextFactory,
|
||||
private readonly ApiClient $apiClient,
|
||||
private readonly CacheInterface $cache,
|
||||
|
||||
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace App\Controller\Booking\Create;
|
||||
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\BookingSessionManager;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -16,7 +16,7 @@ use Symfony\Component\Routing\Attribute\Route;
|
||||
class SuccessController extends AbstractController
|
||||
{
|
||||
public function __construct(
|
||||
private readonly BookingSessionStore $bookingSessionService,
|
||||
private readonly BookingSessionManager $bookingSessionService,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ use App\Exception\TravelNotFoundException;
|
||||
use App\Form\BookingEditType;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Service\BookingChangeTracker;
|
||||
use App\Service\BookingEditContextFactory;
|
||||
use App\Service\BookingEditDataLoader;
|
||||
use App\Service\BookingEditDraftManager;
|
||||
use App\Service\BookingEditContextFactory;
|
||||
use App\Service\BookingChangeTracker;
|
||||
use App\Service\BookingEditSubmitter;
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\BookingSessionManager;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -40,7 +40,7 @@ class IndexController extends AbstractController
|
||||
public function __construct(
|
||||
private readonly BookingEditDataLoader $dataLoader,
|
||||
private readonly BookingEditDraftManager $draftService,
|
||||
private readonly BookingSessionStore $bookingSessionService,
|
||||
private readonly BookingSessionManager $bookingSessionService,
|
||||
private readonly BookingChangeTracker $fingerprintService,
|
||||
private readonly BookingEditContextFactory $editContextFactory,
|
||||
private readonly BookingEditSubmitter $submitService,
|
||||
|
||||
@@ -10,10 +10,10 @@ use App\Entity\User;
|
||||
use App\Form\BookingParticipantType;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Service\BookingEditDataLoader;
|
||||
use App\Service\BookingEditContextFactory;
|
||||
use App\Service\BookingEditDataLoader;
|
||||
use App\Service\BookingEditDraftManager;
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\BookingSessionManager;
|
||||
use App\Service\ParticipantFormSupport;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -32,7 +32,7 @@ class ParticipantController extends AbstractController
|
||||
private readonly BookingEditDataLoader $dataLoader,
|
||||
private readonly BookingEditDraftManager $draftService,
|
||||
private readonly BookingEditContextFactory $editContextFactory,
|
||||
private readonly BookingSessionStore $bookingSessionService,
|
||||
private readonly BookingSessionManager $bookingSessionService,
|
||||
private readonly ParticipantFormSupport $participantFormSupportService,
|
||||
) {
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ use App\Exception\HotelNotInTravelException;
|
||||
use App\Exception\NoRoomsAvailableException;
|
||||
use App\Exception\TravelNotFoundException;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Service\BookingSessionManager;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
@@ -29,7 +29,7 @@ trait BookingExceptionHandlerTrait
|
||||
* Handles all booking-related exceptions and provides appropriate user feedback
|
||||
* by redirecting to the error page with flash messages.
|
||||
*/
|
||||
protected function getOrCreateBookingCreateDto(BookingSessionStore $bookingSessionService, Request $request): BookingDto|RedirectResponse
|
||||
protected function getOrCreateBookingCreateDto(BookingSessionManager $bookingSessionService, Request $request): BookingDto|RedirectResponse
|
||||
{
|
||||
try {
|
||||
return $bookingSessionService->getOrCreateBookingCreateDto($request);
|
||||
@@ -62,7 +62,7 @@ trait BookingExceptionHandlerTrait
|
||||
* Returns empty 400 responses for HTMX requests when exceptions occur,
|
||||
* allowing the frontend to handle errors appropriately.
|
||||
*/
|
||||
protected function getOrCreateBookingCreateDtoForHtmx(BookingSessionStore $bookingSessionService, Request $request): mixed
|
||||
protected function getOrCreateBookingCreateDtoForHtmx(BookingSessionManager $bookingSessionService, Request $request): mixed
|
||||
{
|
||||
try {
|
||||
return $bookingSessionService->getOrCreateBookingCreateDto($request);
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Service\BookingSessionStore;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Service\BookingSessionManager;
|
||||
use App\Service\BookingSummaryAssembler;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
@@ -18,11 +19,11 @@ class SecurityController extends AbstractController
|
||||
public function login(
|
||||
AuthenticationUtils $authenticationUtils,
|
||||
Request $request,
|
||||
BookingSessionStore $bookingSessionService,
|
||||
BookingSessionManager $bookingSessionService,
|
||||
BookingSummaryAssembler $summaryDataService,
|
||||
): Response {
|
||||
// Check if this is a booking flow (BookingDto exists in session)
|
||||
$bookingDto = $bookingSessionService->getBookingDto($request, BookingSessionStore::BOOKING_CREATE_KEY);
|
||||
$bookingDto = $bookingSessionService->getBookingDto($request, BookingDto::MODE_CREATE);
|
||||
$isBookingFlow = null !== $bookingDto;
|
||||
|
||||
// If authenticated and in booking flow, proceed to Step 1
|
||||
|
||||
Reference in New Issue
Block a user