<?php

declare(strict_types=1);

namespace App\Http\Requests\Collections;

use Illuminate\Foundation\Http\FormRequest;

class CollectionProgrammingMergePairRequest extends FormRequest
{
    public function authorize(): bool
    {
        return $this->user() !== null;
    }

    public function rules(): array
    {
        return [
            'source_collection_id' => ['required', 'integer', 'exists:collections,id'],
            'target_collection_id' => ['required', 'integer', 'exists:collections,id', 'different:source_collection_id'],
        ];
    }
}