<?php

namespace Modules\SpecialAttendance\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class DutyCalendarRequest extends FormRequest
{
    public function authorize()
    {
        return true;
    }

    public function rules()
    {
        return [
            'department_id' => 'required_without:employee_id',
            'employee_id'   => 'required_without:department_id',
            'date_range'    => 'required',
        ];
    }

    public function messages()
    {
        return [
            'department_id.required_without' => _trans('validation.Department or employee is required'),
            'employee_id.required_without'   => _trans('validation.Employee or department is required'),
            'date_range.required'            => _trans('validation.Date range or year is required'),
        ];
    }
}
