<?php
namespace Database\Seeders;

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

class SettingsSeeder extends Seeder
{
    public function run(): void
    {
        $settings = [
            ['key' => 'site_name', 'value' => 'VendorFlow', 'group' => 'general'],
            ['key' => 'site_description', 'value' => 'Multi-Vendor eCommerce SaaS Platform', 'group' => 'general'],
            ['key' => 'site_email', 'value' => 'hello@vendorflow.com', 'group' => 'general'],
            ['key' => 'site_phone', 'value' => '+1 (555) 000-0000', 'group' => 'general'],
            ['key' => 'default_currency', 'value' => 'USD', 'group' => 'payment'],
            ['key' => 'default_commission', 'value' => '10', 'group' => 'payment'],
            ['key' => 'tax_rate', 'value' => '0', 'group' => 'payment'],
            ['key' => 'shipping_cost', 'value' => '0', 'group' => 'payment'],
            ['key' => 'allow_guest_checkout', 'value' => '0', 'group' => 'checkout'],
            ['key' => 'require_email_verification', 'value' => '0', 'group' => 'auth'],
            ['key' => 'maintenance_mode', 'value' => '0', 'group' => 'general'],
        ];

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

        $this->command->info('Settings seeded.');
    }
}
