<?php

namespace Database\Seeders;

use App\Models\User;
use App\Models\UserSetting;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    public function run(): void
    {
        $user = User::updateOrCreate(
            ['email' => 'user@samacevpn.com'],
            [
                'name' => 'Samace User',
                'password' => Hash::make('password123'),
            ]
        );

        UserSetting::updateOrCreate(
            ['user_id' => $user->id],
            [
                'auto_connect' => false,
                'kill_switch' => true,
                'protocol' => 'WireGuard',
                'notifications_enabled' => true,
            ]
        );

        $this->call([
            VpnServerSeeder::class,
        ]);
    }
}
