<?php

namespace Database\Seeders;

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

class PaymentSettingsSeeder extends Seeder
{
    public function run()
    {
        $settings = [
            [
                'key' => 'demo_mode_enabled',
                'value' => '1',
                'group' => 'payment',
                'type' => 'boolean',
                'label' => 'Enable Demo Mode (Simulate Payment)',
            ],
            [
                'key' => 'razorpay_enabled',
                'value' => '1',
                'group' => 'payment',
                'type' => 'boolean',
                'label' => 'Enable Razorpay',
            ],
            [
                'key' => 'razorpay_key',
                'value' => 'rzp_test_1DP5mmOlF5G5ag', // Demo Key
                'group' => 'payment',
                'type' => 'text',
                'label' => 'Razorpay Key ID',
            ],
            [
                'key' => 'razorpay_secret',
                'value' => 'demo_secret_123456789',
                'group' => 'payment',
                'type' => 'text',
                'label' => 'Razorpay Secret',
            ],
            [
                'key' => 'paypal_enabled',
                'value' => '1',
                'group' => 'payment',
                'type' => 'boolean',
                'label' => 'Enable PayPal',
            ],
            [
                'key' => 'paypal_client_id',
                'value' => 'demo_client_id_AxVI_12345_TEST',
                'group' => 'payment',
                'type' => 'text',
                'label' => 'PayPal Client ID',
            ],
            [
                'key' => 'paypal_secret',
                'value' => 'demo_secret_ELi_12345_TEST',
                'group' => 'payment',
                'type' => 'text',
                'label' => 'PayPal Secret',
            ],
            [
                'key' => 'manual_payment_enabled',
                'value' => '1',
                'group' => 'payment',
                'type' => 'boolean',
                'label' => 'Enable Manual Payment',
            ],
            [
                'key' => 'manual_payment_instructions',
                'value' => "For Demo/Testing:\nUse the 'Simulate Successful Payment' button below for instant activation.\n\nBank Name: Example Bank (Demo)\nAccount No: 1234567890",
                'group' => 'payment',
                'type' => 'text',
                'label' => 'Manual Payment Instructions',
            ],
        ];

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