feat: correct determination of inquiry status and conditional voucher field display

This commit is contained in:
Björn Fromme
2025-11-25 16:41:25 +01:00
parent f33e55f201
commit ecc4741f56
19 changed files with 468 additions and 193 deletions
+12 -3
View File
@@ -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: