<?php

namespace Database\Seeders\Tenant;

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

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

    private function data(): array
    {
        return [
            [
                'tab' => 'Automotive',
                'section' => 'Autotrader',
                'group' => 'Enriched vehicle data',
                'name' => 'Show valuation saving on UI',
                'config_key' => 'autotrader-show-valuation-saving',
                'type' => 'boolean',
                'min_tier' => 'pro',
                'value' => false,
                'description' => 'Show how much below the Autotrader market average retail valuation the vehicle is priced',
                'order' => 23,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Autotrader',
                'group' => 'Enriched vehicle data',
                'name' => 'Minimum saving to display',
                'config_key' => 'autotrader-valuation-saving-threshold',
                'type' => 'int',
                'min_tier' => 'pro',
                'value' => 0,
                'description' => 'Only show valuation saving if it is at least this amount below market average. Set to 0 to always show when saving exists.',
                'order' => 24,
            ],
        ];
    }
}
