<?php

namespace App\Http\Requests\V1\ProcessStep;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'items' => ['required', 'array', 'min:1'],
            'items.*.id' => ['required', 'integer'],
            'items.*.sort_order' => ['required', 'integer', 'min:0'],
        ];
    }

    public function attributes(): array
    {
        return [
            'items' => '정렬 항목',
            'items.*.id' => '단계 ID',
            'items.*.sort_order' => '정렬순서',
        ];
    }
}
