feat: centralize create/edit flow contexts, extract edit submit service
This commit is contained in:
@@ -13,11 +13,12 @@ use App\Controller\Booking\Traits\BookingExceptionHandlerTrait;
|
||||
use App\Form\BookingCreateStep3Type;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Htmx\HxTrait;
|
||||
use App\Service\BookingCreateContextFactory;
|
||||
use App\Service\BookingPriceCalculatorService;
|
||||
use App\Service\BookingPriceMismatchDiagnosticsService;
|
||||
use App\Service\BookingService;
|
||||
use App\Service\BookingSessionService;
|
||||
use App\Service\BookingSummaryDataService;
|
||||
use App\Service\RoomPricingCalculator;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Form\FormInterface;
|
||||
@@ -37,7 +38,7 @@ class Step3Controller extends AbstractController
|
||||
public function __construct(
|
||||
private readonly BookingService $bookingService,
|
||||
private readonly BookingSessionService $bookingSessionService,
|
||||
private readonly BookingSummaryDataService $summaryDataService,
|
||||
private readonly BookingCreateContextFactory $createContextFactory,
|
||||
private readonly BookingPriceCalculatorService $priceCalculator,
|
||||
private readonly BookingPriceMismatchDiagnosticsService $priceMismatchDiagnostics,
|
||||
private readonly ApiClient $apiClient,
|
||||
@@ -216,13 +217,14 @@ class Step3Controller extends AbstractController
|
||||
*/
|
||||
private function renderStepForm(BookingDto $bookingCreateDto, FormInterface $form): Response
|
||||
{
|
||||
// Get complete summary data (pricing, rooms, CMS data)
|
||||
$summaryData = $this->summaryDataService->getSummaryData($bookingCreateDto);
|
||||
$context = $this->createContextFactory->create(
|
||||
$bookingCreateDto,
|
||||
RoomPricingCalculator::PRICING_MODE_ASSIGNMENT
|
||||
);
|
||||
|
||||
return $this->render('booking/create/step_3.html.twig', [
|
||||
'bookingCreateDto' => $bookingCreateDto,
|
||||
'bookingCreateContext' => $context,
|
||||
'form' => $form->createView(),
|
||||
'summaryData' => $summaryData,
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user