<?php

namespace Database\Seeders\Tenant;

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

class AllowVehicleFinanceOverrideSetting 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' => 'Finance',
                'group' => 'General',
                'name' => 'Allow per-vehicle finance key override',
                'config_key' => 'finance-allow-vehicle-override',
                'type' => 'boolean',
                'value' => false,
                'description' => 'When enabled, vehicles with an "Alternate Finance Key" set will use ' .
                    'that key when requesting finance quotes instead of the dealership default. ' .
                    "Use this when standard manufacturer finance isn't available for specific vehicles " .
                    '(e.g. pack terms, cancelled fleet orders). Currently honoured by Codeweavers.',
                'order' => 14,
            ],
        ];
    }
}
