<?php

namespace App\Http\Requests\Approval;

use App\Http\Requests\Traits\HasPagination;
use Illuminate\Foundation\Http\FormRequest;

class ReferenceIndexRequest extends FormRequest
{
    use HasPagination;

    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'is_read' => 'nullable|boolean',
            'sort_by' => 'nullable|string|in:created_at,drafted_at,completed_at,title',
            'sort_dir' => 'nullable|string|in:asc,desc',
            'per_page' => 'nullable|integer|min:1',
            'page' => 'nullable|integer|min:1',
        ];
    }
}
