<?php

namespace Database\Seeders;

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

class SettingsSeeder extends Seeder
{
    public function run(): void
    {
        $settings = [
            // Store Information
            ['key' => 'store_name', 'value' => 'Grocery Store', 'type' => 'text', 'group' => 'store'],
            ['key' => 'store_email', 'value' => 'info@grocerystore.com', 'type' => 'text', 'group' => 'store'],
            ['key' => 'store_phone', 'value' => '+1234567890', 'type' => 'text', 'group' => 'store'],
            ['key' => 'store_address', 'value' => '123 Main Street', 'type' => 'text', 'group' => 'store'],
            ['key' => 'store_city', 'value' => 'New York', 'type' => 'text', 'group' => 'store'],
            ['key' => 'store_country', 'value' => 'USA', 'type' => 'text', 'group' => 'store'],

            // Currency & Tax
            ['key' => 'currency', 'value' => 'USD', 'type' => 'text', 'group' => 'tax'],
            ['key' => 'currency_symbol', 'value' => '$', 'type' => 'text', 'group' => 'tax'],
            ['key' => 'default_tax_rate', 'value' => '0', 'type' => 'number', 'group' => 'tax'],

            // Delivery
            ['key' => 'delivery_charge', 'value' => '5.00', 'type' => 'number', 'group' => 'delivery'],
            ['key' => 'free_delivery_threshold', 'value' => '50.00', 'type' => 'number', 'group' => 'delivery'],

            // Order Settings
            ['key' => 'order_cancellation_hours', 'value' => '24', 'type' => 'number', 'group' => 'order'],
            ['key' => 'auto_confirm_orders', 'value' => 'false', 'type' => 'boolean', 'group' => 'order'],

            // App Theme (mobile app)
            ['key' => 'app_theme', 'value' => 'blinkit', 'type' => 'text', 'group' => 'app'],
        ];

        foreach ($settings as $setting) {
            Setting::create($setting);
        }
    }
}
