feat: correct determination of inquiry status and conditional voucher field display
This commit is contained in:
@@ -13,6 +13,7 @@ use App\Form\Service\Condition\BulkInsuranceBookingCondition;
|
||||
use App\Form\Service\Condition\CompositeCondition;
|
||||
use App\Form\Service\Condition\DateOfBirthProvidedCondition;
|
||||
use App\Form\Service\Condition\FieldValueCondition;
|
||||
use App\Form\Service\Condition\FinalBookingOnlyCondition;
|
||||
use App\Form\Service\Condition\RentalSelectionCondition;
|
||||
use App\Form\Service\Condition\RoomSelectionCondition;
|
||||
use App\Form\Service\Condition\ServiceSubTypeCondition;
|
||||
@@ -267,9 +268,17 @@ class CreateFieldStateProvider extends AbstractFieldStateProvider
|
||||
'static_text' => new SingleRoomTypeCondition(),
|
||||
];
|
||||
|
||||
// Voucher fields (purchaseVoucherCode, promoVoucherCode) have no state conditions
|
||||
// They are enabled by default for all participants in create mode
|
||||
// No visibility rules - always shown to allow optional voucher entry
|
||||
// Voucher fields - hidden for inquiry bookings (status='A')
|
||||
// Vouchers cannot be redeemed or submitted for inquiry bookings
|
||||
$finalBookingOnlyCondition = new FinalBookingOnlyCondition();
|
||||
|
||||
$this->fieldStateConditions['purchaseVoucherCode'] = [
|
||||
'hidden' => CompositeCondition::not($finalBookingOnlyCondition),
|
||||
];
|
||||
|
||||
$this->fieldStateConditions['promoVoucherCode'] = [
|
||||
'hidden' => CompositeCondition::not($finalBookingOnlyCondition),
|
||||
];
|
||||
|
||||
// Example field state conditions would be registered here
|
||||
// For demonstration purposes, here are some example patterns:
|
||||
|
||||
Reference in New Issue
Block a user