<?php

namespace App\Http\Requests\Character;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'source_role_id' => 'required|integer',
            'target_role_id' => 'required|integer|different:source_role_id',
            'sections' => 'required|array',
            'sections.*' => 'in:base,pocket,equipment,storehouse',
        ];
    }

    public function messages(): array
    {
        return [
            'target_role_id.different' => 'Source and target roles must be different',
        ];
    }
}
