<?php

namespace App\Http\Requests\ClassPreparation;

use App\Http\Requests\ApiFormRequest;

class ClassPreparationMarkPrintedRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return $this->user() !== null || auth()->user() !== null;
    }

    public function rules(): array
    {
        return [
            'school_year' => ['required', 'string', 'max:9'],
            'semester' => ['nullable', 'string', 'max:255'],
            'class_section_ids' => ['required', 'array'],
            'class_section_ids.*' => ['required', 'string', 'max:32'],
        ];
    }
}
