From dd0f1a25d0d814c2b4de8b063fb36fbb64c1d453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Fri, 9 Jan 2026 13:37:22 +0100 Subject: [PATCH] feat: always allow editing of participants for internal bookings Prior to this commit the mutability flag from BusProNet was evaluated and would potentially conflict with this rule. This flag is now completely ignored for internal bookings. --- .../Condition/PersonalDataMutabilityCondition.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Form/Service/Condition/PersonalDataMutabilityCondition.php b/src/Form/Service/Condition/PersonalDataMutabilityCondition.php index 8bd36e9..6f3cdfd 100644 --- a/src/Form/Service/Condition/PersonalDataMutabilityCondition.php +++ b/src/Form/Service/Condition/PersonalDataMutabilityCondition.php @@ -18,6 +18,10 @@ use App\Form\Service\Contract\FieldConditionInterface; * FirstParticipantReadOnlyCondition handles agency-based read-only logic for first participant, * while this condition applies BPN mutability rules to all participants. * + * Exception: For internal agency bookings (agency code 0004), the BPN mutability flag + * is ignored for all participants. Agency staff need full control over participant data + * regardless of BPN's mutability restrictions. + * * In edit mode, BPN determines mutability based on business rules (e.g., payment status, * booking state, etc.). We must respect this flag to prevent users from attempting to * modify data that BPN will reject. @@ -34,6 +38,9 @@ class PersonalDataMutabilityCondition implements FieldConditionInterface * that BPN does not allow modifications to this participant's data. * When true, personal data fields should be hidden and displayed as static text. * + * Exception: For internal agency bookings, always returns false to allow + * editing all participants regardless of BPN's mutability flag. + * * @param BookingDto $bookingDto The current booking data * @param int $participantIndex The index of the participant being evaluated * @param array $formData Current form data (unused) @@ -42,6 +49,12 @@ class PersonalDataMutabilityCondition implements FieldConditionInterface */ public function evaluate(BookingDto $bookingDto, int $participantIndex, array $formData): bool { + // For internal agency bookings, all participants are editable + // regardless of BPN's mutability flag + if ($bookingDto->isInternalAgencyBooking()) { + return false; + } + $participant = $bookingDto->getParticipant($participantIndex); if (null === $participant) { return false;