<?php

namespace App\Modules\HR\Attendance\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    /**
     * @return array<string, mixed>
     */
    public function rules(): array
    {
        return [
            'punches' => ['required', 'array', 'min:1'],
            'punches.*' => ['required', 'array'],
        ];
    }
}
