<?php

declare(strict_types=1);

namespace App\Http\Requests\Collections;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'ordered_artwork_ids' => ['required', 'array'],
            'ordered_artwork_ids.*' => ['integer', 'distinct'],
        ];
    }
}
