<?php

namespace Database\Seeders;

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

class EmployeeSeeder extends Seeder
{
    public function run(): void
    {
        $employees = [
            [
                'name' => 'Anil Kumar Patel',
                'email' => 'anil@example.com',
                'phone' => '9876543210',
                'department' => 'Development',
                'salary' => 55000,
                'status' => true,
            ],
            [
                'name' => 'Priya Sharma',
                'email' => 'priya@example.com',
                'phone' => '9876501234',
                'department' => 'Marketing',
                'salary' => 48000,
                'status' => true,
            ],
            [
                'name' => 'Rahul Verma',
                'email' => 'rahul@example.com',
                'phone' => '9812345678',
                'department' => 'Sales',
                'salary' => 45000,
                'status' => false,
            ],
        ];

        foreach ($employees as $employee) {
            Employee::query()->updateOrCreate(
                ['email' => $employee['email']],
                $employee,
            );
        }
    }
}
