<?php

namespace App\Domains\Integration\Requests;

use Illuminate\Foundation\Http\FormRequest;

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

    public function rules(): array
    {
        return [
            'integration_code' => ['required', 'string', 'unique:integrations,integration_code'],
            'name' => ['required', 'string', 'max:255'],
            'url' => ['nullable', 'url', 'max:255'],
            'integration_data_schema' => ['nullable', 'array'],
            'requires_client_configuration' => ['sometimes', 'boolean'],
        ];
    }
}
