<?php

namespace Database\Seeders\Tenant;

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

class SkupenetFeatureSourceSettingSeeder 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' => 'DMS vehicle sync',
                'group' => 'Skupenet',
                'name' => 'Feature source',
                'config_key' => 'stock-skupenet-feature-source',
                'type' => 'string',
                'min_tier' => 'standard',
                'value' => 'description-tail',
                'order' => 7,
                'description' => 'How vehicle features are read from the feed. '
                    . '"description-tail" (default): the last double-newline block of the description '
                    . 'when it has more than 5 lines. '
                    . '"description-bullets": bullet lines anywhere in the description become features '
                    . 'and are removed from the description text. '
                    . '"none": no feature extraction, description is kept as sent.',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'DMS vehicle sync',
                'group' => 'Skupenet',
                'name' => 'Feature bullet markers',
                'config_key' => 'stock-skupenet-feature-markers',
                'type' => 'string',
                'min_tier' => 'standard',
                'value' => '•,-,*',
                'order' => 8,
                'description' => 'Comma-separated list of bullet markers recognised by the '
                    . '"description-bullets" feature source. A line counts as a feature when it starts '
                    . 'with one of these markers followed by a space, within a run of at least 3 such lines.',
            ],
        ];
    }
}
