<?php

namespace Database\Seeders\Tenant;

use App\Facades\Settings;
use Illuminate\Database\Seeder;

class VehiclesInVideoExportSeeder extends Seeder
{
    public function run()
    {
        collect($this->data())
            ->each(fn ($setting) => Settings::make($setting));
    }

    private function data(): array
    {
        return [
            [
                'tab' => 'Automotive',
                'section' => 'Sales Channels / Feeds',
                'group' => 'Vehicles In Video',
                'name' => 'Enabled',
                'config_key' => 'sales-channels-vehicles-in-video-enabled',
                'type' => 'boolean',
                'value' => false,
                'feature' => 'sales-channels',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Sales Channels / Feeds',
                'group' => 'Vehicles In Video',
                'name' => 'FTP server Username',
                'config_key' => 'sales-channels-vehicles-in-video-ftp-username',
                'type' => 'string',
                'value' => '',
                'validation_rules' => [
                    "required_if:values.sales-channels-vehicles-in-video-enabled,true",
                ],
                'feature' => 'sales-channels',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Sales Channels / Feeds',
                'group' => 'Vehicles In Video',
                'name' => 'FTP server Password',
                'config_key' => 'sales-channels-vehicles-in-video-ftp-password',
                'type' => 'secret',
                'value' => '',
                'validation_rules' => [
                    "required_if:values.sales-channels-vehicles-in-video-enabled,true",
                ],
                'feature' => 'sales-channels',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Sales Channels / Feeds',
                'group' => 'Vehicles In Video',
                'name' => 'Export file name',
                'config_key' => 'sales-channels-vehicles-in-video-file-name',
                'type' => 'string',
                'value' => '',
                'validation_rules' => [
                    "required_if:values.sales-channels-vehicles-in-video-enabled,true",
                ],
                'feature' => 'sales-channels',
                'description' => 'Confirm with Vehicles in Video whether this must be unique for the provided FTP credentials',
            ],
        ];
    }
}
