<?php

namespace Database\Seeders\Tenant;

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

class StockProviderSortingSettingSeeder 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' => 'Filter',
                'group' => 'Sorting',
                'name' => 'Pre sort results by stock provider priority',
                'config_key' => 'filter-results-order-by-stock-provider',
                'min_tier' => 'standard',
                'superadmin' => true,
                'type' => 'boolean',
                'value' => false,
                'description' => 'When enabled, results are initially sorted by stock provider priority '
                    . 'before applying the user-selected sort.',
                'order' => 100,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Filter',
                'group' => 'Sorting',
                'name' => 'Stock provider priority order',
                'config_key' => 'filter-results-stock-provider-priority',
                'min_tier' => 'standard',
                'superadmin' => true,
                'type' => 'list',
                'source' => 'stock-providers',
                'value' => null,
                'description' => 'Select and order stock providers by priority. '
                    . 'Vehicles from providers listed first will appear before others on the SRP.',
                'order' => 101,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Filter',
                'group' => 'Sorting',
                'name' => 'Stock provider sorting applies to',
                'config_key' => 'filter-results-stock-provider-sort-options',
                'min_tier' => 'standard',
                'superadmin' => true,
                'type' => 'list',
                'source' => 'sort-options',
                'value' => null,
                'description' => 'Select which sort options should have stock provider priority sorting applied.',
                'order' => 102,
            ],
        ];
    }
}
