<?php

namespace App\Http\Requests\Admin\AcademicClasses\Assignment;

use Illuminate\Foundation\Http\FormRequest;

class GradeSubmissionRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->can('update-assignment-submissions')
            && $this->user()->canManageAssignment($this->route('assignment'));
    }

    public function rules(): array
    {
        return [
            'score' => ['nullable', 'numeric', 'min:0', 'max:100'],
        ];
    }
}
