<?php

namespace Database\Seeders\Tenant;

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

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

    /**
     * @return array<int, array<string, mixed>>
     */
    private function getData(): array
    {
        return [
            [
                'tab' => 'Site',
                'section' => 'General',
                'group' => 'reCAPTCHA',
                'name' => 'Site Key',
                'config_key' => 'recaptcha-site-key',
                'type' => 'string',
                'description' => 'Google reCAPTCHA v3 site key (public key used on the frontend)',
                'order' => 1,
            ],
            [
                'tab' => 'Site',
                'section' => 'General',
                'group' => 'reCAPTCHA',
                'name' => 'Secret Key',
                'config_key' => 'recaptcha-secret-key',
                'type' => 'secret',
                'description' => 'Google reCAPTCHA v3 secret key (used for server-side token verification)',
                'order' => 2,
            ],
            [
                'tab' => 'Site',
                'section' => 'General',
                'group' => 'reCAPTCHA',
                'name' => 'Score Threshold',
                'config_key' => 'recaptcha-score-threshold',
                'type' => 'string',
                'value' => '0.5',
                'description' => 'Minimum reCAPTCHA score (0.0 to 1.0) required to pass validation. Lower values are more permissive.',
                'order' => 3,
            ],
        ];
    }
}
