<?php

namespace App\Http\Requests\WorkOrder;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'assignee_id' => 'required|integer|exists:users,id',
            'team_id' => 'nullable|integer|exists:departments,id',
        ];
    }

    public function messages(): array
    {
        return [
            'assignee_id.required' => __('validation.required', ['attribute' => '담당자']),
            'assignee_id.exists' => __('validation.exists', ['attribute' => '담당자']),
        ];
    }
}
