<?php

namespace Database\Seeders;

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

class FeatureSettingsSeeder extends Seeder
{
    public function run()
    {
        $settings = [
            // Social Login Features
            [
                'key' => 'social_login_google_enabled',
                'value' => '0',
                'group' => 'features',
                'type' => 'boolean',
                'label' => 'Google Login Enabled',
            ],
            [
                'key' => 'social_login_facebook_enabled',
                'value' => '0',
                'group' => 'features',
                'type' => 'boolean',
                'label' => 'Facebook Login Enabled',
            ],
            [
                'key' => 'google_client_id',
                'value' => '',
                'group' => 'features',
                'type' => 'text',
                'label' => 'Google Client ID',
            ],
            [
                'key' => 'google_client_secret',
                'value' => '',
                'group' => 'features',
                'type' => 'password',
                'label' => 'Google Client Secret',
            ],
            [
                'key' => 'facebook_app_id',
                'value' => '',
                'group' => 'features',
                'type' => 'text',
                'label' => 'Facebook App ID',
            ],
            [
                'key' => 'facebook_app_secret',
                'value' => '',
                'group' => 'features',
                'type' => 'password',
                'label' => 'Facebook App Secret',
            ],

            // WhatsApp Features
            [
                'key' => 'whatsapp_enabled',
                'value' => '1',
                'group' => 'features',
                'type' => 'boolean',
                'label' => 'WhatsApp Chat Enabled',
            ],
            [
                'key' => 'whatsapp_number',
                'value' => '+919876543210',
                'group' => 'features',
                'type' => 'text',
                'label' => 'WhatsApp Support Number',
            ],
            [
                'key' => 'whatsapp_welcome_message',
                'value' => 'Hello! I am interested in your products on The Mini Port.',
                'group' => 'features',
                'type' => 'textarea',
                'label' => 'Default Welcome Message',
            ],

            // Core Platform Features
            [
                'key' => 'product_approval_required',
                'value' => '1',
                'group' => 'features',
                'type' => 'boolean',
                'label' => 'Product Approval Required',
            ],
            [
                'key' => 'bulk_upload_enabled',
                'value' => '1',
                'group' => 'features',
                'type' => 'boolean',
                'label' => 'Bulk Upload Feature',
            ],
            [
                'key' => 'help_page_enabled',
                'value' => '1',
                'group' => 'features',
                'type' => 'boolean',
                'label' => 'Help Page Visible',
            ],
            [
                'key' => 'newsletter_enabled',
                'value' => '1',
                'group' => 'features',
                'type' => 'boolean',
                'label' => 'Newsletter Subscription',
            ],
            [
                'key' => 'min_moq',
                'value' => '10',
                'group' => 'features',
                'type' => 'text',
                'label' => 'Global Minimum MOQ',
            ],
            [
                'key' => 'max_moq',
                'value' => '1000',
                'group' => 'features',
                'type' => 'text',
                'label' => 'Global Maximum MOQ',
            ],
        ];

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