First Aid list, amount list and kitchen list PDF download implemented

This commit is contained in:
2026-03-28 22:22:06 +01:00
parent df7c14442e
commit 7bea223ded
20 changed files with 92 additions and 36 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Resources;
use App\Enumerations\ParticipationType;
use App\Models\EventParticipant;
use App\ValueObjects\Age;
use Illuminate\Http\Resources\Json\JsonResource;
class EventParticipantResource extends JsonResource
@@ -34,6 +35,11 @@ class EventParticipantResource extends JsonResource
return array_merge(
$this->resource->toArray(),
[
'age' => new Age($this->resource->birthday)->getAge(),
'localgroup' => $this->resource->localGroup()->first()->name,
'swimmingPermission' => $this->resource->swimmingPermission()->first()->short,
'extendedFirstAid' => $this->resource->firstAidPermission()->first()->name,
'tetanusVaccination' => $this->resource->tetanus_vaccination?->format('d.m.Y'),
'presenceDays' => ['real' => $presenceDays, 'support' => $presenceDaysSupport],
'participationType' => ParticipationType::where(['slug' => $this->resource->participation_type])->first()->name,
'needs_payment' => $this->resource->amount->getAmount() > 0 && $event->pay_direct,
@@ -43,7 +49,8 @@ class EventParticipantResource extends JsonResource
'amount_left_string' => $amountLeft->toString(),
'amount_left_value' => $amountLeft->getAmount(),
'email_1' => $this->resource->email_1,
'amountPaid' => ['value' => $this->resource->amount_paid, 'readable' => $this->resource->amount_paid?->toString() ?? '0,00 Euro'],
'amountExpected' => ['value' => $this->resource->amount, 'readable' => $this->resource->amount?->toString() ?? '0,00 Euro'],
]
);