<?php

namespace Database\Seeders\Tenant;

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

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

    private function data(): array
    {
        return [
            [
                'tab' => 'Automotive',
                'section' => 'SRP',
                'group' => 'Vehicle Offers',
                'name' => 'Limit to offer types',
                'config_key' => 'automotive-srp-vehicle-offers-types',
                'description' => 'Restrict SRP injection to vehicle offers of the selected types. Leave empty to include all types.',
                'type' => 'list',
                'source' => 'offer-types',
                'value' => null,
                'order' => 24,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'SRP',
                'group' => 'Vehicle Offers',
                'name' => 'Order offers by',
                'config_key' => 'automotive-srp-vehicle-offers-order-by',
                'description' => 'Choose how weighted vehicle offers are prioritised on page 1. Weight uses the Priority Weight field on each offer. Offer Order reuses the ordering already set on the offer listing page.',
                'type' => 'string',
                'choices' => [
                    ['name' => 'Priority Weight', 'value' => 'weight'],
                    ['name' => 'Offer Order', 'value' => 'order'],
                ],
                'value' => 'weight',
                'order' => 25,
            ],
        ];
    }
}
