<?php

namespace App\Http\Requests\ItemMaster;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'child_id' => 'required|integer|min:1',
            'order_no' => 'nullable|integer|min:0',
        ];
    }

    public function messages(): array
    {
        return [
            'child_id.required' => __('validation.required', ['attribute' => '연결 대상 ID']),
            'child_id.integer' => __('validation.integer', ['attribute' => '연결 대상 ID']),
            'child_id.min' => __('validation.min.numeric', ['attribute' => '연결 대상 ID', 'min' => 1]),
        ];
    }
}
