<?php

namespace App\Http\Requests\Api\V1;

use Illuminate\Foundation\Http\FormRequest;

class FileMoveRequest extends FormRequest
{
    public function authorize(): bool
    {
        return true;
    }

    public function rules(): array
    {
        return [
            'file_ids' => 'required|array|min:1',
            'file_ids.*' => 'required|integer|exists:files,id',
            'folder_id' => 'required|integer|exists:folders,id',
            'document_id' => 'nullable|integer',
            'document_type' => 'nullable|string|max:100',
        ];
    }

    public function messages(): array
    {
        return [
            'file_ids.required' => __('error.file_ids_required'),
            'file_ids.array' => __('error.file_ids_must_be_array'),
            'file_ids.*.exists' => __('error.file_not_found'),
            'folder_id.required' => __('error.folder_id_required'),
            'folder_id.exists' => __('error.folder_not_found'),
        ];
    }
}
