fix: preserve selected services from booking even when unavailable

When editing a booking, services that were previously booked but are no
longer available in the travel catalog were being dropped. This caused
API error 650 ("Anzahl Leistung stimmt nicht mit Teilnehmerzuordnung
überein") because the service participant counts no longer matched.

The fix ensures that in edit mode, booked services are merged with
travel data services in both:
- Form rendering (ParticipantFieldOptionsProvider): so checkboxes appear
- Handler validation (AbstractParticipantFieldHandler): so selections
  are accepted

This allows users to keep their existing service selections or
deliberately replace them with other available options. Create mode
remains unchanged.
This commit is contained in:
Björn Fromme
2026-01-19 15:51:39 +01:00
parent 5c9f8c2a2e
commit 2776429639
16 changed files with 204 additions and 37 deletions
@@ -127,7 +127,7 @@ class PersonalDataSynchronizer
* Ensures mandatory fields have sensible defaults before submission to the
* BPN API. Currently handles nationality which defaults to 'D' (German).
*
* @param \App\BusProNet\Model\PersonalData $participant The participant to fill defaults for
* @param PersonalData $participant The participant to fill defaults for
*/
private function fillMissingParticipantFields(PersonalData $participant): void
{
+1 -1
View File
@@ -91,7 +91,7 @@ class PersonalData
];
if (true === $includeDateOfBirth) {
$dob = $this->dateOfBirth ?? new \DateTimeImmutable(self::DEFAULT_AGE_YEARS . ' years ago');
$dob = $this->dateOfBirth ?? new \DateTimeImmutable(self::DEFAULT_AGE_YEARS.' years ago');
$payload['geburtsdatum'] = $dob->format('d.m.Y');
}