<?php

declare(strict_types=1);

namespace Database\Seeders\Tenant;

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

class AutoTraderHubReExportSettings extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        collect($this->data())
            ->each(fn ($setting) => Settings::make($setting));
    }

    private function data(): array
    {
        return [
            [
                'tab' => 'Automotive',
                'section' => 'AutoTrader',
                'group' => 'Stock push from website to AutoTrader',
                'name' => 'Re-export interval (days)',
                'config_key' => 'auto-trader-hub-reexport-interval-days',
                'type' => 'number',
                'value' => 3,
                'description' => 'Vehicles whose data has not changed are still re-sent to AutoTrader '
                    . 'after this many days to keep the Hub in sync.',
                'order' => 35,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'AutoTrader',
                'group' => 'Stock push from website to AutoTrader',
                'name' => 'Re-export minimum batch size',
                'config_key' => 'auto-trader-hub-reexport-batch-min',
                'type' => 'number',
                'value' => 10,
                'description' => 'Minimum number of due-for-re-export vehicles to include in each scheduled export run.',
                'order' => 36,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'AutoTrader',
                'group' => 'Stock push from website to AutoTrader',
                'name' => 'Re-export batch size percent',
                'config_key' => 'auto-trader-hub-reexport-batch-percent',
                'type' => 'number',
                'value' => 10,
                'description' => 'Cap the re-export top-up to this percentage of the main pending batch '
                    . '(actual size is max of this percentage and the minimum batch size).',
                'order' => 37,
            ],
        ];
    }
}
