<?php

namespace Database\Seeders;

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

class UserSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $superAdminGroup = PermissionGroup::where('name', 'Süper Yönetici')->first();

        // Super Admin User
        User::create([
            'username' => 'admin',
            'email' => 'admin@financepanel.com',
            'password' => Hash::make('admin123'),
            'full_name' => 'Sistem Yöneticisi',
            'permission_group_id' => $superAdminGroup->id,
            'is_active' => true,
        ]);

        // Demo Admin User
        User::create([
            'username' => 'demo',
            'email' => 'demo@financepanel.com',
            'password' => Hash::make('demo123'),
            'full_name' => 'Demo Kullanıcı',
            'permission_group_id' => $superAdminGroup->id,
            'is_active' => true,
        ]);
    }
}
