<?php

namespace App\Http\Requests;

use App\Http\Requests\Concerns\ValidatesLeadExportStructure;
use Illuminate\Validation\Rule;

class UpdateLeadExportTemplate extends LeadExportTemplateRequest
{
    use ValidatesLeadExportStructure;

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
     */
    #[\Override]
    public function rules(): array
    {
        return array_merge([
            'is_published' => ['required', 'boolean'],
            'title' => ['required', 'string', 'max:255'],
            'type' => ['sometimes', 'string', 'max:60'],
            'sales_channel' => ['nullable', 'string', 'max:100'],
            'format' => ['nullable', 'string', Rule::in(['json'])],
        ], $this->structureRules());
    }
}
