<?php

namespace App\Http\Resources\Assignment;

use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class AssignmentOverviewResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'classSections' => AssignmentSectionResource::collection(collect($this->classSections ?? [])),
            'schoolYears' => $this->schoolYears ?? [],
            'schoolYear' => $this->schoolYear ?? null,
            'selectedYear' => $this->selectedYear ?? null,
            'selectedSemester' => $this->selectedSemester ?? null,
            'semester' => $this->semester ?? null,
            'current_school_year' => $this->current_school_year ?? null,
        ];
    }
}
