<?php

namespace App\Http\Requests\V1\ProcessStep;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'step_name' => ['required', 'string', 'max:100'],
            'is_required' => ['nullable', 'boolean'],
            'needs_approval' => ['nullable', 'boolean'],
            'needs_inspection' => ['nullable', 'boolean'],
            'is_active' => ['nullable', 'boolean'],
            'connection_type' => ['nullable', 'string', 'max:20'],
            'connection_target' => ['nullable', 'string', 'max:255'],
            'completion_type' => ['nullable', 'string', 'in:click_complete,selection_complete,inspection_complete'],
        ];
    }

    public function attributes(): array
    {
        return [
            'step_name' => '단계명',
            'is_required' => '필수여부',
            'needs_approval' => '승인필요여부',
            'needs_inspection' => '검사필요여부',
            'is_active' => '사용여부',
            'connection_type' => '연결유형',
            'connection_target' => '연결대상',
            'completion_type' => '완료유형',
        ];
    }
}
