<?php

namespace Database\Seeders\Tenant;

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

class AutoGrabBatchSettingSeeder 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' => 'AutoGrab',
                'name' => 'Batch threshold',
                'config_key' => 'stock-autograb-batch-threshold',
                'type' => 'int',
                'value' => 100,
                'description' => 'Number of pending AutoGrab notifications that triggers a batch '
                    . 'processing run. The scheduled drain also runs every few minutes regardless.',
            ],
            [
                'tab' => 'Automotive',
                'section' => 'DMS vehicle sync',
                'group' => 'AutoGrab',
                'name' => 'Batch chunk size',
                'config_key' => 'stock-autograb-batch-chunk',
                'type' => 'int',
                'value' => 200,
                'description' => 'How many pending notifications a single batch run claims and '
                    . 'processes per iteration. Keep modest to bound transaction/lock size.',
            ],
        ];
    }
}
