From b291c05da76f4861d3d458c1f75cf731dce610ba Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20G=C3=BCnther?=
Date: Fri, 1 May 2026 13:52:53 +0200
Subject: [PATCH] Last bugfixes
---
app/Installer/Providers/BdpLvSachsenDataSeeder.php | 2 +-
app/Resources/EventParticipantResource.php | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/Installer/Providers/BdpLvSachsenDataSeeder.php b/app/Installer/Providers/BdpLvSachsenDataSeeder.php
index 1fea724..c72eef2 100644
--- a/app/Installer/Providers/BdpLvSachsenDataSeeder.php
+++ b/app/Installer/Providers/BdpLvSachsenDataSeeder.php
@@ -240,7 +240,7 @@ class BdpLvSachsenDataSeeder {
['user_role_main' => 'ROLE_USER', 'user_role_local_group' => 'ROLE_USER', 'username' => 'marlene.koehler@pfadfinden.de', 'local_group' => 'lv', 'firstname' => 'Marlene', 'lastname' => 'Köhler', 'email' => 'marlene.koehler@pfadfinden.de', 'activation_token_expires_at' => '2026-02-20 21:53:58', 'active' => true],
['user_role_main' => 'ROLE_USER', 'user_role_local_group' => 'ROLE_USER', 'username' => 'marslisdneu@aol.de', 'local_group' => 'feu', 'firstname' => 'Steffi', 'lastname' => 'Deckenbach', 'email' => 'marslisdneu@aol.de', 'activation_token_expires_at' => '2026-02-20 21:53:58', 'active' => true],
['user_role_main' => 'ROLE_USER', 'user_role_local_group' => 'ROLE_USER', 'username' => 'mascha.meyenschein@pfadfinden.de', 'local_group' => 'lv', 'firstname' => 'Mascha', 'lastname' => 'Meyenschein', 'email' => 'mascha.meyenschein@pfadfinden.de', 'activation_token_expires_at' => '2026-02-20 21:53:58', 'active' => true],
- ['user_role_main' => 'ROLE_USER', 'user_role_local_group' => 'ROLE_USER', 'username' => 'yannik@suck-taucha.de', 'local_group' => 'lv', 'firstname' => 'Nathalie', 'lastname' => 'Hammermüller', 'email' => 'Nataliehammer22@web.de', 'activation_token_expires_at' => '2026-02-20 21:53:58', 'active' => true],
+ ['user_role_main' => 'ROLE_USER', 'user_role_local_group' => 'ROLE_USER', 'username' => 'nataliehammer22@web.de', 'local_group' => 'lv', 'firstname' => 'Nathalie', 'lastname' => 'Hammermüller', 'email' => 'nataliehammer22@web.de', 'activation_token_expires_at' => '2026-02-20 21:53:58', 'active' => true],
['user_role_main' => 'ROLE_USER', 'user_role_local_group' => 'ROLE_USER', 'username' => 'pdeakova@centrum.cz', 'local_group' => 'fen', 'firstname' => 'Mikulas', 'lastname' => 'Loub', 'email' => 'pdeakova@centrum.cz', 'activation_token_expires_at' => '2026-02-20 21:53:58', 'active' => true],
['user_role_main' => 'ROLE_USER', 'user_role_local_group' => 'ROLE_USER', 'username' => 'pfadfinden@christian-schlag.org', 'local_group' => 'wm', 'firstname' => 'Christian', 'lastname' => 'Schlag', 'email' => 'pfadfinden@christian-schlag.org', 'activation_token_expires_at' => '2026-02-20 21:53:58', 'active' => true],
['user_role_main' => 'ROLE_USER', 'user_role_local_group' => 'ROLE_USER', 'username' => 'rebekka.thielen@googlemail.com', 'local_group' => 'lv', 'firstname' => 'Almuna Elisa', 'lastname' => 'Hines', 'email' => 'rebekka.thielen@googlemail.com', 'activation_token_expires_at' => '2026-02-20 21:53:58', 'active' => true],
diff --git a/app/Resources/EventParticipantResource.php b/app/Resources/EventParticipantResource.php
index 405f6f7..ccc669b 100644
--- a/app/Resources/EventParticipantResource.php
+++ b/app/Resources/EventParticipantResource.php
@@ -48,7 +48,7 @@ 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,
+ 'localgroup' => $this->resource->localGroup()?->first()?->name ?? 'Nicht im LV',
'swimmingPermission' => $this->resource->swimmingPermission()->first()->short,
'extendedFirstAid' => $this->resource->firstAidPermission()->first()->name,
'tetanusVaccination' => $this->resource->tetanus_vaccination?->format('d.m.Y') ?? 'Unbekannt',
@@ -64,10 +64,10 @@ class EventParticipantResource extends JsonResource
'amountPaid' => ['value' => $this->resource->amount_paid, 'readable' => $this->resource->amount_paid?->toString() ?? '0,00 Euro', 'short' => $this->resource->amount_paid?->getFormattedAmount() ?? '0,00'],
'amountExpected' => ['value' => $this->resource->amount, 'readable' => $this->resource->amount?->toString() ?? '0,00 Euro', 'short' => $this->resource->amount?->getFormattedAmount() ?? '0,00'],
'alcoholicsAllowed' => new Age($this->resource->birthday)->getAge() >= $event->alcoholics_age,
- 'localGroupPostcode' => $this->resource->localGroup()->first()->postcode,
- 'localGroupCity' => $this->resource->localGroup()->first()->city,
+ 'localGroupPostcode' => $this->resource->localGroup()->first()?->postcode ?? '00000',
+ 'localGroupCity' => $this->resource->localGroup()->first()?->city ?? '00000',
'state' => config('postCode.map.' . $this->resource->postcode),
- 'localGroupState' => config('postCode.map.' . $this->resource->localGroup()->first()->postcode),
+ 'localGroupState' => null !== $this->resource->localGroup()->first()?->postcode ? config('postCode.map.' . $this->resource->postcode) : '--',
'birthday' => $this->resource->birthday->format('d.m.Y'),
'eatingHabit' => EatingHabit::where('slug', $this->resource->eating_habit)->first()->name,
'cocColor' => match ($this->resource->efz_status) {