<?php

namespace App\Http\Requests\V1\Payroll;

use Illuminate\Foundation\Http\FormRequest;

class CalculatePayrollRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'year' => ['required', 'integer', 'min:2000', 'max:2100'],
            'month' => ['required', 'integer', 'min:1', 'max:12'],
            'user_ids' => ['nullable', 'array'],
            'user_ids.*' => ['integer', 'exists:users,id'],
        ];
    }

    public function attributes(): array
    {
        return [
            'year' => __('validation.attributes.pay_year'),
            'month' => __('validation.attributes.pay_month'),
            'user_ids' => __('validation.attributes.user_ids'),
        ];
    }
}
