add refund and event logic

This commit is contained in:
root
2026-03-10 23:12:49 -04:00
parent ba1206e314
commit f6be51576c
67 changed files with 4808 additions and 1000 deletions
@@ -0,0 +1,28 @@
<?php
namespace App\Http\Resources\Events;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;
class EventChargeResource extends JsonResource
{
public function toArray(Request $request): array
{
return [
'id' => (int) ($this->id ?? 0),
'event_id' => (int) ($this->event_id ?? 0),
'event_name' => $this->event_name ?? null,
'parent_id' => (int) ($this->parent_id ?? 0),
'parent_name' => trim(($this->parent_firstname ?? '') . ' ' . ($this->parent_lastname ?? '')),
'student_id' => (int) ($this->student_id ?? 0),
'student_name' => trim(($this->student_firstname ?? '') . ' ' . ($this->student_lastname ?? '')),
'participation' => $this->getRawOriginal('participation') ?? $this->participation,
'charged' => (float) ($this->getRawOriginal('charged') ?? $this->charged ?? 0),
'school_year' => $this->school_year,
'semester' => $this->semester,
'created_at' => optional($this->created_at)->toDateTimeString(),
'updated_at' => optional($this->updated_at)->toDateTimeString(),
];
}
}