<?php

namespace App\Modules\HR\Attendance\Requests;

use Illuminate\Foundation\Http\FormRequest;

class AttendanceImportUploadRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user()?->can('attendance.import') === true;
    }

    public function rules(): array
    {
        return [
            'file' => ['required', 'file', 'mimes:csv,txt', 'max:5120'],
        ];
    }

    public function messages(): array
    {
        return [
            'file.mimes' => __('attendance.import.csv_only'),
        ];
    }
}
