First Aid list, amount list and kitchen list PDF download implemented
This commit is contained in:
@@ -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'],
|
||||
]
|
||||
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user