<?php

namespace App\Http\Requests\Identity;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class SyncRoleUsersRequest extends FormRequest
{
    public function rules(): array
    {
        return [
            'action' => ['required', Rule::in(['attach', 'detach'])],
            'users' => ['required', 'array', 'min:1'],
            'users.*' => ['uuid', Rule::exists('users', 'uuid')->whereNull('deleted_at')],
        ];
    }
}
