<?php

namespace Database\Seeders\Tenant;

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

class SrpVehicleOffersSettingsSeeder 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' => 'Inject vehicle offers into SRP',
                'config_key' => 'automotive-srp-vehicle-offers-enabled',
                'type' => 'boolean',
                'min_tier' => 'standard',
                'value' => false,
                'order' => 20,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'SRP',
                'group' => 'Vehicle Offers',
                'name' => 'Show on stock type',
                'config_key' => 'automotive-srp-vehicle-offers-stock-type',
                'description' => 'Which SRP context to show vehicle offers on. Used = used cars only, New = new cars only, Both = both contexts.',
                'type' => 'string',
                'choices' => [
                    ['name' => 'Used', 'value' => 'used'],
                    ['name' => 'New', 'value' => 'new'],
                    ['name' => 'Both', 'value' => 'both'],
                ],
                'value' => null,
                'order' => 21,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'SRP',
                'group' => 'Vehicle Offers',
                'name' => 'Max vehicle offers per page',
                'config_key' => 'automotive-srp-vehicle-offers-max-per-page',
                'description' => 'Maximum number of vehicle offers shown on a single SRP page. Maximum 5.',
                'type' => 'integer',
                'value' => 0,
                'order' => 22,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'SRP',
                'group' => 'Vehicle Offers',
                'name' => 'Max weighted vehicle offers',
                'config_key' => 'vehicle-offer-max-weighted',
                'description' => 'Maximum number of vehicle offers that can have weight > 0. Also controls how many weighted offers are pinned to page 1 of the SRP.',
                'type' => 'integer',
                'min_tier' => 'standard',
                'value' => 0,
                'order' => 23,
            ],
        ];
    }
}
