feat: implement screendesign
This commit is contained in:
@@ -68,17 +68,30 @@ class BookingDataProcessor
|
||||
$participantData = ParticipantDto::fromPersonalData($participant);
|
||||
$participantData->index = $index;
|
||||
|
||||
// First participant (applicant): copy address from applicant if participant address is empty
|
||||
// BPN API may return full address only in <anmelder> but minimal/empty address in <teilnehmer id="1">
|
||||
// Only copy if first participant has no street (indicating empty/incomplete address)
|
||||
// This allows applicant and first participant to be different people with different addresses
|
||||
if (0 === $index && null !== $booking->applicant->address) {
|
||||
$isEmpty = null === $participantData->address
|
||||
|| null === $participantData->address->street
|
||||
|| '' === trim($participantData->address->street);
|
||||
// First participant (applicant): copy data from applicant if participant data is empty
|
||||
// BPN API may return full data only in <anmelder> but minimal/empty data in <teilnehmer id="1">
|
||||
if (0 === $index) {
|
||||
// Copy address if first participant has no street (indicating empty/incomplete address)
|
||||
// This allows applicant and first participant to be different people with different addresses
|
||||
if (null !== $booking->applicant->address) {
|
||||
$isEmpty = null === $participantData->address
|
||||
|| null === $participantData->address->street
|
||||
|| '' === trim($participantData->address->street);
|
||||
|
||||
if ($isEmpty) {
|
||||
$participantData->address = clone $booking->applicant->address;
|
||||
if ($isEmpty) {
|
||||
$participantData->address = clone $booking->applicant->address;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy body dimensions from applicant if not present in participant
|
||||
if (null === $participantData->height && null !== $booking->applicant->height) {
|
||||
$participantData->height = $booking->applicant->height;
|
||||
}
|
||||
if (null === $participantData->weight && null !== $booking->applicant->weight) {
|
||||
$participantData->weight = $booking->applicant->weight;
|
||||
}
|
||||
if (null === $participantData->shoeSize && null !== $booking->applicant->shoeSize) {
|
||||
$participantData->shoeSize = $booking->applicant->shoeSize;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -304,6 +304,17 @@ class BookingPayloadBuilder
|
||||
}
|
||||
}
|
||||
|
||||
// Add body dimensions
|
||||
if (null !== $participant->height) {
|
||||
$participantData['sonstiges1'] = $participant->height;
|
||||
}
|
||||
if (null !== $participant->weight) {
|
||||
$participantData['sonstiges2'] = $participant->weight;
|
||||
}
|
||||
if (null !== $participant->shoeSize) {
|
||||
$participantData['sonstiges3'] = $participant->shoeSize;
|
||||
}
|
||||
|
||||
// Add wishes (room remarks and license plate)
|
||||
if (null !== $participant->remarksRoom || null !== $participant->licensePlate) {
|
||||
$participantData['wünsche'] = [];
|
||||
|
||||
@@ -20,7 +20,7 @@ class PersonalDataSynchronizer
|
||||
/**
|
||||
* Updates participant personal data from form input.
|
||||
*
|
||||
* Only processes participants with status 'F' (active/confirmed participants).
|
||||
* Processes all active participants (status 'F' or 'A'). Skips canceled participants (status 'S').
|
||||
* Updates all personal data fields and communication information.
|
||||
*
|
||||
* IMPORTANT: The applicant's address must never be modified. This method updates
|
||||
@@ -32,7 +32,8 @@ class PersonalDataSynchronizer
|
||||
public function updateParticipantPersonalData(array $participants, Booking $bookingData): void
|
||||
{
|
||||
foreach ($participants as $participant) {
|
||||
if ('F' !== $participant->status) {
|
||||
// Skip canceled participants (status 'S')
|
||||
if ('S' === $participant->status) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class PersonalData
|
||||
public ?string $name = null;
|
||||
|
||||
#[Assert\NotBlank(message: 'Bitte angeben', groups: ['Default', 'personal_data'])]
|
||||
public string $firstName = '';
|
||||
public ?string $firstName = '';
|
||||
|
||||
public ?string $salutation = null;
|
||||
public ?string $title = null;
|
||||
@@ -55,6 +55,11 @@ class PersonalData
|
||||
$this->communication = new Communication();
|
||||
}
|
||||
|
||||
public function getFullName(): string
|
||||
{
|
||||
return sprintf('%s %s', $this->firstName, $this->name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts the personal data to API payload format.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user