feat: unassign rooms from other participants when unavailable
This commit is contained in:
@@ -88,18 +88,14 @@ class ParticipantFieldOptionsProvider extends AbstractFieldOptionsProvider
|
||||
if (BookingDto::MODE_CREATE === $bookingDto->getMode()) {
|
||||
// Create context: use selected rooms from step 1
|
||||
$choiceLoader = $this->roomChoiceLoaderFactory->createForCreate(
|
||||
$bookingDto->participants,
|
||||
$bookingDto->getSelectedRooms(),
|
||||
$participantIndex
|
||||
$bookingDto->getSelectedRooms()
|
||||
);
|
||||
// Disable when only one room type selected (auto-assigned)
|
||||
$disabled = 1 === count($bookingDto->getSelectedRooms());
|
||||
} elseif (BookingDto::MODE_EDIT === $bookingDto->getMode()) {
|
||||
// Edit context: use already-booked rooms from booking
|
||||
$choiceLoader = $this->roomChoiceLoaderFactory->createForEdit(
|
||||
$bookingDto->participants,
|
||||
$bookingDto->booking->rooms,
|
||||
$participantIndex
|
||||
$bookingDto->booking->rooms
|
||||
);
|
||||
// Disable when only one room in booking (no reassignment needed)
|
||||
$disabled = 1 === count($bookingDto->booking->rooms);
|
||||
|
||||
Reference in New Issue
Block a user