<?php

namespace App\Http\Requests\WorkOrder;

use App\Models\Production\WorkOrderIssue;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

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

    public function rules(): array
    {
        return [
            'title' => 'required|string|max:200',
            'description' => 'nullable|string',
            'priority' => ['nullable', Rule::in(WorkOrderIssue::PRIORITIES)],
        ];
    }

    public function messages(): array
    {
        return [
            'title.required' => __('validation.required', ['attribute' => '이슈 제목']),
        ];
    }
}
