<?php

namespace App\Http\Resources\ClassPreparation;

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

class ClassPreparationResultResource extends JsonResource
{
    public function toArray(Request $request): array
    {
        return [
            'class_section' => $this->resource['class_section'] ?? null,
            'class_section_id' => $this->resource['class_section_id'] ?? null,
            'student_count' => $this->resource['student_count'] ?? 0,
            'class_level' => $this->resource['class_level'] ?? null,
            'prep_items' => $this->resource['prep_items'] ?? [],
            'needs_print' => $this->resource['needs_print'] ?? false,
            'last_printed_at' => $this->resource['last_printed_at'] ?? null,
            'adjustments' => $this->resource['adjustments'] ?? [],
        ];
    }
}
