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.
This commit is contained in:
@@ -18,6 +18,10 @@ use App\Form\Service\Contract\FieldConditionInterface;
|
|||||||
* FirstParticipantReadOnlyCondition handles agency-based read-only logic for first participant,
|
* FirstParticipantReadOnlyCondition handles agency-based read-only logic for first participant,
|
||||||
* while this condition applies BPN mutability rules to all participants.
|
* 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,
|
* 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
|
* booking state, etc.). We must respect this flag to prevent users from attempting to
|
||||||
* modify data that BPN will reject.
|
* 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.
|
* that BPN does not allow modifications to this participant's data.
|
||||||
* When true, personal data fields should be hidden and displayed as static text.
|
* 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 BookingDto $bookingDto The current booking data
|
||||||
* @param int $participantIndex The index of the participant being evaluated
|
* @param int $participantIndex The index of the participant being evaluated
|
||||||
* @param array<string, mixed> $formData Current form data (unused)
|
* @param array<string, mixed> $formData Current form data (unused)
|
||||||
@@ -42,6 +49,12 @@ class PersonalDataMutabilityCondition implements FieldConditionInterface
|
|||||||
*/
|
*/
|
||||||
public function evaluate(BookingDto $bookingDto, int $participantIndex, array $formData): bool
|
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);
|
$participant = $bookingDto->getParticipant($participantIndex);
|
||||||
if (null === $participant) {
|
if (null === $participant) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user