<?php

namespace Database\Seeders;

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

class GuruSeeder extends Seeder
{
    public function run(): void
    {
        $data = [
            ['nama_guru' => 'IMAM MUZAENI, S.Pd.T',      'nip' => '197804130201011013'],
            ['nama_guru' => 'DIAN SRIANDINI, M.Pd',       'nip' => '197307162006021005'],
            ['nama_guru' => 'DIAN YUDIANTONO, S.Pd',      'nip' => '198110712011011008'],
            ['nama_guru' => 'Dr. NANA JULIAWNA',           'nip' => '196602141990031006'],
            ['nama_guru' => 'H. NASRUDIN, S.Pd',           'nip' => '197106152005011006'],
            ['nama_guru' => 'FUAD, S.Pd',                  'nip' => '198105152022211038'],
            ['nama_guru' => 'JAMALUDIN ZUHRI, S.Pd',      'nip' => ''],
            ['nama_guru' => 'SYAHRUL RONNY, M.Pd',        'nip' => '198704022006041005'],
            ['nama_guru' => 'HELENA KURNASIH, M.Pd',      'nip' => '197805052003122003'],
            ['nama_guru' => 'PRIYONO, S.Pd',               'nip' => ''],
            ['nama_guru' => 'ALFIANDIE SHOFIA WARDAI, S.S.', 'nip' => ''],
            ['nama_guru' => 'SRIKADIS, T',                 'nip' => '197810132022211005'],
            ['nama_guru' => 'HERAWATI, S.Pd. M.Pd',       'nip' => ''],
            ['nama_guru' => 'SUKMANAH, S.Pd. MM',         'nip' => '197208043200112001'],
            ['nama_guru' => 'ELI LIMAENAH, S.Ag',         'nip' => '198009221995122001'],
            ['nama_guru' => 'SELLY APRILIANI, S.Pd',      'nip' => '199704221232212005'],
            ['nama_guru' => 'ANITA ZULFA1, S.Pd',         'nip' => '197002152008042006'],
            ['nama_guru' => 'ADE CAHYANI WIDKUM, S.Pd',   'nip' => ''],
            ['nama_guru' => 'TRIUTAMI, S.H',               'nip' => ''],
            ['nama_guru' => 'MAMAN SUHERMAN, M.Pd',       'nip' => '156502192005011056'],
            ['nama_guru' => 'INSULINDE VULYANTI, M.Pd',   'nip' => '197807022022512005'],
            ['nama_guru' => 'TRESNA SUSLIAWATI, S.Pd',    'nip' => '198605224201201216'],
        ];

        foreach ($data as $guru) {
            DB::table('guru')->updateOrInsert(
                ['nama_guru' => $guru['nama_guru']],
                array_merge($guru, [
                    'id_profil' => 1,
                    'mapel'    => '',
                    'jabatan'  => '',
                    'foto'     => '',
                ])
            );
        }

        $this->command->info('✅ Data guru berhasil di-seed (' . count($data) . ' data)');
    }
}
