<?php

namespace Database\Seeders;

use App\Models\CompanySetting;
use App\Models\Setting;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class SettingSeeder extends Seeder
{
    
    public function run(): void
    {
        $settings = [
            [
                // Kaydedilen ilanda fiyat düşünce e-posta (önceki özellik —
                // listeye çevrilirken düşmüştü, geri eklendi).
                'key' => 'price_drop_notifications_enabled',
                'value' => '1'
            ],
            [
                'key' => 'listing_reconfirmation_enabled',
                'value' => '1'
            ],
            [
                'key' => 'listing_reconfirmation_days',
                'value' => '30'
            ],
            [
                'key' => 'listing_reconfirmation_grace_days',
                'value' => '2'
            ],
            [
                'key' => 'listing_auto_expire_enabled',
                'value' => '1'
            ]

        ];


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

    }
}
