Support oft parent groups
This commit is contained in:
@@ -51,7 +51,12 @@ class EventParticipantResource extends JsonResource
|
||||
'unregisteredAt' => $this->resource->unregistered_at?->format('d.m.Y'),
|
||||
'fullname' => $this->resource->getFullName(),
|
||||
'age' => new Age($this->resource->birthday)->getAge(),
|
||||
'localgroup' => $this->resource->localGroup()?->first()?->name ?? 'Nicht im LV',
|
||||
// Die bei der Anmeldung gewählte Gruppe: Local Group oder Parent Group, je nach Veranstaltung.
|
||||
'participantGroup' => $this->resource->participantGroupName($event),
|
||||
// Wert für die Auswahl in der Verwaltung: Slug der Local Group bzw. ID der Parent Group.
|
||||
'participantGroupValue' => $event->asksForParentGroup()
|
||||
? ($this->resource->parent_group_id !== null ? (string) $this->resource->parent_group_id : '')
|
||||
: ($this->resource->local_group ?? ''),
|
||||
// Die Zuordnungen sind nullable: die Kurzanmeldung erhebt nicht alles, und in der Verwaltung
|
||||
// lassen sich Werte leeren. Ohne Fallback fielen Teilnehmerliste und Detailansicht komplett aus.
|
||||
'swimmingPermission' => $this->resource->swimmingPermission()->first()?->short ?? 'Unbekannt',
|
||||
|
||||
Reference in New Issue
Block a user