feat: load availability data once per booking session

This commit is contained in:
Björn Fromme
2026-03-16 12:00:56 +01:00
parent 8f542ff448
commit 12b69bd681
5 changed files with 11 additions and 12 deletions
@@ -138,9 +138,8 @@ class Step2Controller extends AbstractController
throw $this->createNotFoundException(sprintf('Participant at index %d does not exist', $index));
}
// Fetch fresh availabilities when entering participant form
// This ensures up-to-date data and populates cache for subsequent HTMX refreshes
$this->travelDataService->enrichWithFreshAvailabilities($bookingDto->travel, cached: false);
// Use cached availability data (populated during booking init)
$this->travelDataService->enrichWithFreshAvailabilities($bookingDto->travel);
// Create form with booking_context option
$form = $this->createParticipantForm($bookingDto, $index);
@@ -168,9 +168,8 @@ class IndexController extends AbstractController
return $this->redirectToRoute('app_booking_edit', ['id' => $id]);
}
// Fetch fresh availabilities when entering participant form
// This ensures up-to-date data and populates cache for subsequent HTMX refreshes
$this->travelDataService->enrichWithFreshAvailabilities($bookingDto->travel, cached: false);
// Use cached availability data (populated during booking init)
$this->travelDataService->enrichWithFreshAvailabilities($bookingDto->travel);
// Create wrapper DTO for email uniqueness validation
$wrapper = new ParticipantEditDto(