<?php

namespace Database\Seeders\Tenant;

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

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

    private function data(): array
    {
        return [
            [
                'tab' => 'Automotive',
                'section' => 'Specification / Feature Synchronization',
                'group' => 'HPI CAP ID Lookup',
                'name' => 'Enabled',
                'config_key' => 'cap-id-lookup-hpi-enabled',
                'type' => 'boolean',
                'value' => false,
                'min_tier' => 'pro',
                'description' => 'Use HPI to lookup CAP ID for imported vehicles',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Specification / Feature Synchronization',
                'group' => 'HPI CAP ID Lookup',
                'name' => 'Customer Code',
                'config_key' => 'cap-id-lookup-hpi-customer_code',
                'type' => 'string',
                'value' => '',
                'min_tier' => 'pro',
                'validation_rules' => [
                    "required_if:values.cap-id-lookup-hpi-enabled,true"
                ],
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Specification / Feature Synchronization',
                'group' => 'HPI CAP ID Lookup',
                'name' => 'Password',
                'config_key' => 'cap-id-lookup-hpi-password',
                'type' => 'secret',
                'value' => '',
                'min_tier' => 'pro',
                'validation_rules' => [
                    "required_if:values.cap-id-lookup-hpi-enabled,true"
                ],
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Specification / Feature Synchronization',
                'group' => 'HPI CAP ID Lookup',
                'name' => 'Initials',
                'config_key' => 'cap-id-lookup-hpi-initials',
                'type' => 'string',
                'value' => '',
                'min_tier' => 'pro',
                'validation_rules' => [
                    "required_if:values.cap-id-lookup-hpi-enabled,true"
                ],
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Specification / Feature Synchronization',
                'group' => 'HPI CAP ID Lookup',
                'name' => 'Primary product code',
                'config_key' => 'cap-id-lookup-hpi-primary_product_code',
                'type' => 'string',
                'value' => 'HPI64',
                'min_tier' => 'pro',
                'description' => 'Primary product code for CAP ID lookup. Default is HPI64.',
                'validation_rules' => [
                    "required_if:values.cap-id-lookup-hpi-enabled,true"
                ],
            ],
            [
                'tab' => 'Automotive',
                'section' => 'Specification / Feature Synchronization',
                'group' => 'HPI CAP ID Lookup',
                'name' => 'Supplementary product code',
                'config_key' => 'cap-id-lookup-hpi-supplementary_product_code',
                'type' => 'string',
                'value' => 'CAPCD',
                'min_tier' => 'pro',
                'description' => 'Supplementary product code for CAP ID lookup. Default is CAPCD.',
            ],
        ];
    }
}
