<?php

namespace Modules\Employee\Http\Requests\Employee;

use Illuminate\Foundation\Http\FormRequest;
use Modules\Core\Traits\FailedValidation;

class UpdateEmpPayrollRequest extends FormRequest
{
    use FailedValidation;

    public function rules(): array
    {
        return [
            'cpf_active' => ['sometimes', 'boolean'],
            'attendance_required' => ['sometimes', 'boolean'],
            'overtime_allowed' => ['sometimes', 'boolean'],
            'is_payroll' => ['sometimes', 'boolean'],
            'tax_deduction' => ['sometimes', 'boolean'],
            'attendance_policy_id' => ['sometimes', 'exists:attendance_policies,id'],
            'weekend_policy_id' => ['required', 'exists:weekend_policies,id'],
            'holiday_allowance_policy_id' => ['required', 'exists:holiday_allowance_policies,id'],
            'shift_id' => ['required', 'exists:shifts,id'],
        ];
    }

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