<?php

declare(strict_types=1);

namespace Maestro\Core\Modules\HourRegistration\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class HourRejectLineRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user() !== null && ($this->user()->can('hours.approve') || $this->user()->can('hours.admin'));
    }

    /**
     * @return array<string, mixed>
     */
    public function rules(): array
    {
        return [
            'reason' => ['required', 'string', 'max:2000'],
        ];
    }
}
