<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

class SettingsSeeder extends Seeder
{
    // php artisan db:seed --class=SettingsSeeder
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $now = now();

        DB::table('settings')->insert([
            [
                'key' => 'hotel_name',
                'value' => 'Sunset Hotel',
                'type' => 'string',
                'description' => 'Hotel name',
                'group' => 'general',
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'key' => 'hotel_email',
                'value' => 'support@sunsethotel.lk',
                'type' => 'string',
                'description' => 'Contact email',
                'group' => 'contact',
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'key' => 'hotel_phone',
                'value' => '+94 77 123 4567',
                'type' => 'string',
                'description' => 'Contact phone',
                'group' => 'contact',
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'key' => 'system_currency',
                'value' => 'LKR',
                'type' => 'string',
                'description' => 'Hotel system default currency',
                'group' => 'currency',
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'key' => 'website_currency',
                'value' => 'USD',
                'type' => 'string',
                'description' => 'Default currency for the website',
                'group' => 'currency',
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'key' => 'currency_update_interval',
                'value' => 'daily',
                'type' => 'string',
                'description' => 'How often exchange rates update',
                'group' => 'currency',
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'key' => 'currency_update_time',
                'value' => '02:00',
                'type' => 'string',
                'description' => 'Time of day when rates update',
                'group' => 'currency',
                'created_at' => $now,
                'updated_at' => $now
            ],
            [
                'key' => 'currency_types',
                'value' => json_encode([
                    ['code' => 'LKR', 'symbol' => 'Rs', 'name' => 'Sri Lankan Rupee', 'country' => 'Sri Lanka'],
                    ['code' => 'USD', 'symbol' => '$', 'name' => 'US Dollar', 'country' => 'United States'],
                    ['code' => 'EUR', 'symbol' => '€', 'name' => 'Euro', 'country' => 'European Union'],
                    ['code' => 'GBP', 'symbol' => '£', 'name' => 'British Pound', 'country' => 'United Kingdom']
                ]),
                'type' => 'json',
                'description' => 'Supported currencies for the system',
                'group' => 'currency',
                'created_at' => $now,
                'updated_at' => $now
            ],
        ]);
    }
}
