<?php

namespace App\Http\Requests\Qms;

use Illuminate\Foundation\Http\FormRequest;

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

    protected function prepareForValidation(): void
    {
        $this->merge([
            'type' => $this->route('type'),
        ]);
    }

    public function rules(): array
    {
        return [
            'type' => 'required|string|in:import,order,log,report,confirmation,shipping,product,quality',
        ];
    }

    public function messages(): array
    {
        return [
            'type.in' => __('validation.in', ['attribute' => '서류 타입']),
        ];
    }
}
