feat: extensible participant status determination for booking creation

Adds a rule-based system to determine participant status in CREATE
payloads. Participants selecting a 'Begleitperson' service now receive
status 'O' (Option), all others default to 'F' (Final).

- Add ParticipantStatusRuleInterface for defining status rules
- Add ParticipantStatusRuleRegistry for priority-based rule evaluation
- Add ChaperonServiceStatusRule for Begleitperson detection
- Integrate status evaluation into BookingPayloadBuilder
This commit is contained in:
Björn Fromme committed 2026-01-21 10:16:57 +01:00
1 parent 512b63b88b
commit 2aeed762fd
10 files changed
+525 -4

No files matched your search

@@ -6,6 +6,7 @@ namespace App\BusProNet\DataProcessor;
use App\BusProNet\Constants;
use App\BusProNet\Model\Booking;
use App\BusProNet\Service\ParticipantStatusRuleRegistry;
use App\Form\Model\BookingDto;
/**
@@ -18,6 +19,7 @@ class BookingPayloadBuilder
{
public function __construct(
private readonly ServiceMappingCollector $mappingCollector,
private readonly ParticipantStatusRuleRegistry $statusRuleRegistry,
) {
}
@@ -275,6 +277,7 @@ class BookingPayloadBuilder
foreach ($bookingDto->participants as $index => $participant) {
$participantData = [
'@id' => $index + 1,
'status' => $this->statusRuleRegistry->evaluateStatus($participant),
'name' => $participant->lastName,
'vorname' => $participant->firstName,
'geschlecht' => $participant->gender ?? '',