feat: extract booking participant count service

This commit is contained in:
Björn Fromme
2026-04-11 18:28:32 +02:00
parent f31ac660d2
commit dbc0b4acee
5 changed files with 182 additions and 59 deletions
@@ -9,6 +9,7 @@ use App\Controller\Booking\Traits\BookingExceptionHandlerTrait;
use App\Form\BookingCreateStep2Type;
use App\Form\Model\BookingDto;
use App\Service\BookingService;
use App\Service\BookingParticipantCountService;
use App\Service\BookingSessionService;
use App\Service\BookingSummaryDataService;
use App\Service\ParticipantCardDataService;
@@ -33,6 +34,7 @@ class Step2Controller extends AbstractController
public function __construct(
private readonly BookingService $bookingService,
private readonly BookingParticipantCountService $participantCountService,
private readonly BookingSessionService $bookingSessionService,
private readonly BookingSummaryDataService $summaryDataService,
private readonly TravelDataService $travelDataService,
@@ -64,7 +66,7 @@ class Step2Controller extends AbstractController
$this->travelDataService->enrichWithFreshAvailabilities($bookingCreateDto->travel);
// Ensure correct number of participants with prepopulation callback
$this->bookingService->ensureCorrectNumberOfParticipants(
$this->participantCountService->ensureCorrectNumberOfParticipants(
$bookingCreateDto,
$this->getUser(),
fn ($user, $participant) => $this->prepopulationService->prepopulateApplicantFromUser($user, $participant)