<?php

namespace App\Http\Requests\Inspection;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

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

    public function rules(): array
    {
        return [
            'result' => ['required', Rule::in(['pass', 'fail'])],
            'opinion' => ['nullable', 'string', 'max:2000'],
        ];
    }

    public function messages(): array
    {
        return [
            'result.required' => __('validation.required', ['attribute' => '검사결과']),
            'result.in' => __('validation.in', ['attribute' => '검사결과']),
        ];
    }
}
