<?php

namespace App\Http\Resources\Settings;

use Illuminate\Http\Resources\Json\JsonResource;

class SchoolCalendarEventDetailResource extends JsonResource
{
    public function toArray($request): array
    {
        return [
            'id' => (int) ($this->id ?? 0),
            'title' => (string) ($this->title ?? ''),
            'description' => (string) ($this->description ?? ''),
            'event_type' => $this->event_type ?? null,
            'date' => (string) ($this->date ?? ''),
            'notify_parent' => (int) ($this->notify_parent ?? 0),
            'notify_teacher' => (int) ($this->notify_teacher ?? 0),
            'notify_admin' => (int) ($this->notify_admin ?? 0),
            'no_school' => (int) ($this->no_school ?? 0),
            'semester' => (string) ($this->semester ?? ''),
            'school_year' => (string) ($this->school_year ?? ''),
            'created_at' => $this->created_at ?? null,
            'updated_at' => $this->updated_at ?? null,
        ];
    }
}
