<?php

namespace Modules\Employee\Http\Requests\Employee;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
use Modules\Core\Enums\StatusEnum;
use Modules\Core\Traits\FailedValidation;
use Modules\Employee\Models\Employee;

class UpdateEmpSalaryRequest extends FormRequest
{
    use FailedValidation;

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        $employeeId = $this->route('employee');
        $employee = Employee::with('designation.salaryGrade')->find($employeeId);
        return [
            'bank_name' => ['required', 'string'],
            'account_name' => ['required', 'string', 'max:100'],
            'account_no' => ['required', 'string', 'max:50'],
            'branch' => ['required', 'string', 'max:100'],
            'routing_no' => ['required'],
        ];
    }



    /**
     * Determine if the user is authorized to make this request.
     */
    public function authorize(): bool
    {
        return true;
    }
}
