<?php

namespace App\Http\Requests\Grading;

use App\Http\Requests\ApiFormRequest;

class GradingScoreUpdateRequest extends ApiFormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'type' => ['required', 'string', 'in:homework,quiz,project,midterm,final,test,comments'],
            'student_id' => ['required', 'integer', 'min:1'],
            'class_section_id' => ['required', 'integer', 'min:1'],
            'semester' => ['required', 'string', 'max:50'],
            'school_year' => ['required', 'string', 'max:50'],
            'score_ids' => ['nullable', 'array'],
            'scores' => ['nullable', 'array'],
            'comments' => ['nullable', 'array'],
            'score' => ['nullable', 'numeric'],
            'comment' => ['nullable', 'string'],
        ];
    }
}
