<?php

namespace Database\Seeders\Tenant;

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

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

    private function data(): array
    {
        return [
            [
                'tab' => 'Automotive',
                'section' => 'Finance',
                'group' => 'Santander',
                'name' => 'Santander Finance Enabled',
                'config_key' => 'finance-santander-enabled',
                'min_tier' => 'standard',
                'type' => 'boolean',
                'value' => false,
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Finance',
                'group' => 'Santander',
                'name' => 'Santander Finance Dealer Code',
                'config_key' => 'finance-santander-dealer-code',
                'min_tier' => 'standard',
                'type' => 'string',
                'value' => '',
                'validation_rules' => [
                    'required_if:values.finance-santander-enabled,true',
                ],
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Finance',
                'group' => 'Santander',
                'name' => 'Santander CS Product ID',
                'config_key' => 'finance-santander-cs-product-id',
                'min_tier' => 'standard',
                'type' => 'string',
                'value' => '',
                'description' => 'Santander product code for Conditional Sale quotes',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Finance',
                'group' => 'Santander',
                'name' => 'Santander LP Product ID',
                'config_key' => 'finance-santander-lp-product-id',
                'min_tier' => 'standard',
                'type' => 'string',
                'value' => '',
                'description' => 'Santander product code for Lease Purchase quotes',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Finance',
                'group' => 'Santander',
                'name' => 'Santander DP Product ID',
                'config_key' => 'finance-santander-dp-product-id',
                'min_tier' => 'standard',
                'type' => 'string',
                'value' => '',
                'description' => 'Santander product code for Deferred Payment quotes',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Finance',
                'group' => 'Santander',
                'name' => 'Santander PCP Product ID',
                'config_key' => 'finance-santander-pcp-product-id',
                'min_tier' => 'standard',
                'type' => 'string',
                'value' => '',
                'description' => 'Santander product code for PCP (Personal Contract Purchase) quotes',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Finance',
                'group' => 'Santander',
                'name' => 'Santander DPCP Product ID',
                'config_key' => 'finance-santander-dpcp-product-id',
                'min_tier' => 'standard',
                'type' => 'string',
                'value' => '',
                'description' => 'Santander product code for Deferred PCP quotes',
            ],
        ];
    }
}
