<?php

namespace App\Http\Requests\Employee;

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

class IndexRequest extends FormRequest
{
    use HasPagination;

    /**
     * 드롭다운 등 관리용 확장을 위해 최대 500개 허용
     */
    protected int $maxSize = 500;

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

    public function rules(): array
    {
        return [
            'q' => 'nullable|string|max:100',
            'status' => 'nullable|in:active,leave,resigned',
            'department_id' => 'nullable|integer|min:1',
            'has_account' => 'nullable|in:0,1,true,false',
            'sort_by' => 'nullable|in:created_at,name,employee_status,department_id',
            'sort_dir' => 'nullable|in:asc,desc',
            'page' => 'nullable|integer|min:1',
            'per_page' => 'nullable|integer|min:1',
        ];
    }
}
