feat: revert allow updating room assignments in edit mode
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Form\Service\Condition;
|
||||
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Form\Service\Contract\FieldConditionInterface;
|
||||
|
||||
/**
|
||||
* Condition that checks if accommodation (room assignments) are mutable in the edit flow.
|
||||
*/
|
||||
class AccommodationMutabilityCondition implements FieldConditionInterface
|
||||
{
|
||||
public function evaluate(BookingDto $bookingDto, int $participantIndex, array $formData): bool
|
||||
{
|
||||
return false === $bookingDto->travel->roomsMutable;
|
||||
}
|
||||
|
||||
public function getDependentFields(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Accommodation is not mutable (edit flow)';
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,11 @@ declare(strict_types=1);
|
||||
namespace App\Form\Service;
|
||||
|
||||
use App\BusProNet\Utility\DirectionMapper;
|
||||
use App\Form\Model\BookingDto;
|
||||
use App\Form\Service\Abstract\AbstractFieldStateProvider;
|
||||
use App\Form\Service\Condition\AccommodationMutabilityCondition;
|
||||
use App\Form\Service\Condition\AdditionalServicesMutabilityCondition;
|
||||
use App\Form\Service\Condition\AgeRangeCondition;
|
||||
use App\Form\Service\Condition\BookingModeCondition;
|
||||
use App\Form\Service\Condition\CompositeCondition;
|
||||
use App\Form\Service\Condition\DateOfBirthProvidedCondition;
|
||||
use App\Form\Service\Condition\FieldValueCondition;
|
||||
@@ -98,10 +99,10 @@ class EditFieldStateProvider extends AbstractFieldStateProvider
|
||||
'static_text' => $personalDataHiddenCondition,
|
||||
];
|
||||
|
||||
// Room assignments are readonly when BPN indicates accommodation is not mutable
|
||||
$accommodationMutabilityCondition = new AccommodationMutabilityCondition();
|
||||
// Room assignments are fixed in edit mode - always render as static text
|
||||
// Agencies must ensure proper room assignments before booking submission
|
||||
$this->fieldStateConditions['assignedRoomId'] = [
|
||||
'static_text' => $accommodationMutabilityCondition,
|
||||
'static_text' => new BookingModeCondition(BookingDto::MODE_EDIT),
|
||||
];
|
||||
|
||||
// Show remarks room field only when room with code 'mbz' (single bed) is selected
|
||||
|
||||
Reference in New Issue
Block a user