<?php

namespace App\Database\Seeds;

use CodeIgniter\Database\Seeder;

class DocumentTypeSeeder extends Seeder
{
    public function run(): void
    {
        $types = [
            ['name' => 'Skripsi',             'slug' => 'skripsi'],
            ['name' => 'Jurnal Institusi',    'slug' => 'jurnal-institusi'],
            ['name' => 'Bahan Ajar',          'slug' => 'bahan-ajar'],
            ['name' => 'Prosiding Seminar',   'slug' => 'prosiding-seminar'],
            ['name' => 'Laporan PKM',         'slug' => 'laporan-pkm'],
        ];

        $now = date('Y-m-d H:i:s');
        foreach ($types as &$t) {
            $t['created_at'] = $now;
            $t['updated_at'] = $now;
        }

        $this->db->table('document_types')->insertBatch($types);
    }
}
