<?php

namespace Modules\Employee\Http\Requests\Employee;

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

class DestroyEmpEmergencyContactRequest extends FormRequest
{
    use FailedValidation;

    /**
     * Get the validation rules that apply to the request.
     */
    public function rules(): array
    {
        return [
            'ids' => ['required', 'array'],
            'ids.*' => ['required', 'exists:emp_emergencies,id'],
        ];
    }


    public function messages(): array
    {
        return [
            'ids.required' => 'Please provide at least one emergencies ID.',
            'ids.*.exists' => 'One or more emergencies IDs are invalid.',
        ];
    }

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