<?php

namespace App\Http\Requests\Admin\Manage\CourseRegistration;

use Illuminate\Foundation\Http\FormRequest;

class RejectCourseRegistrationRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()->can('reject-course-registrations')
            && $this->user()->canReviewCourseRegistrationOf($this->route('submission')->student);
    }

    public function rules(): array
    {
        return [
            'reason' => ['required', 'string', 'max:1000'],
        ];
    }
}
