<?php

namespace Database\Seeders;

use App\Models\Setting;
use Illuminate\Database\Seeder;

class SettingSeeder extends Seeder
{
    public function run(): void
    {
        $settings = [
            [
                'key' => 'fonnte_token',
                'value' => env('FONNTE_TOKEN', '6jKRSQBzArCHrKneebdx'),
                'group' => 'fonnte'
            ],
            [
                'key' => 'wa_admin_phone',
                'value' => env('WA_ADMIN_PHONE', '62895365364817'),
                'group' => 'fonnte'
            ],
            [
                'key' => 'midtrans_server_key',
                'value' => env('MIDTRANS_SERVER_KEY', 'Mid-server-Hd-PIUQkKfZG1HfDdW6KMhVa'),
                'group' => 'midtrans'
            ],
            [
                'key' => 'midtrans_client_key',
                'value' => env('MIDTRANS_CLIENT_KEY', 'Mid-client-Wn7K4hzkLCkaRqQm'),
                'group' => 'midtrans'
            ],
            [
                'key' => 'midtrans_is_production',
                'value' => env('MIDTRANS_IS_PRODUCTION', 'true'),
                'group' => 'midtrans'
            ],
            [
                'key' => 'digiflazz_username',
                'value' => env('DIGIFLAZZ_USERNAME', ''),
                'group' => 'digiflazz'
            ],
            [
                'key' => 'digiflazz_api_key',
                'value' => env('DIGIFLAZZ_API_KEY', ''),
                'group' => 'digiflazz'
            ],
            [
                'key' => 'digiflazz_is_production',
                'value' => env('DIGIFLAZZ_IS_PRODUCTION', 'false'),
                'group' => 'digiflazz'
            ]
        ];

        foreach ($settings as $setting) {
            Setting::updateOrCreate(
                ['key' => $setting['key']],
                ['value' => $setting['value'], 'group' => $setting['group']]
            );
        }
    }
}
