Anschrift für Veranstaltungsort

This commit is contained in:
2026-09-10 11:45:52 +02:00
parent 70a57d10f5
commit ddfaab1501
19 changed files with 306 additions and 10 deletions
@@ -13,6 +13,8 @@ class UpdateEventCommand {
$this->request->event->name = $this->request->eventName;
$this->request->event->location = $this->request->eventLocation;
$this->request->event->street = $this->normalizeOptional($this->request->street);
$this->request->event->house_number = $this->normalizeOptional($this->request->houseNumber);
$this->request->event->postal_code = $this->request->postalCode;
$this->request->event->email = $this->request->email;
$this->request->event->early_bird_end = $this->request->earlyBirdEnd;
@@ -42,4 +44,15 @@ class UpdateEventCommand {
return $response;
}
/**
* Straße und Hausnummer sind optional. Ein geleertes Eingabefeld liefert einen leeren String --
* gespeichert wird dafür `null`, damit „nicht angegeben" nur eine Darstellung hat.
*/
private function normalizeOptional(?string $value): ?string
{
$value = trim((string) $value);
return '' === $value ? null : $value;
}
}
@@ -10,6 +10,8 @@ class UpdateEventRequest {
public Event $event;
public string $eventName;
public string $eventLocation;
public ?string $street;
public ?string $houseNumber;
public string $postalCode;
public string $email;
public DateTime $earlyBirdEnd;
@@ -24,11 +26,13 @@ class UpdateEventRequest {
public array $contributingLocalGroups;
public array $eatingHabits;
public function __construct(Event $event, string $eventName, string $eventLocation, string $postalCode, string $email, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $alcoholicsAge, bool $sendWeeklyReports, bool $registrationAllowed, Amount $flatSupport, Amount $supportPerPerson, array $contributingLocalGroups, array $eatingHabits, bool $shortRegistration = false, bool $swimmingPermissionRequired = true)
public function __construct(Event $event, string $eventName, string $eventLocation, string $postalCode, string $email, DateTime $earlyBirdEnd, DateTime $registrationFinalEnd, int $alcoholicsAge, bool $sendWeeklyReports, bool $registrationAllowed, Amount $flatSupport, Amount $supportPerPerson, array $contributingLocalGroups, array $eatingHabits, bool $shortRegistration = false, bool $swimmingPermissionRequired = true, ?string $street = null, ?string $houseNumber = null)
{
$this->event = $event;
$this->eventName = $eventName;
$this->eventLocation = $eventLocation;
$this->street = $street;
$this->houseNumber = $houseNumber;
$this->postalCode = $postalCode;
$this->email = $email;
$this->earlyBirdEnd = $earlyBirdEnd;