<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\Item;
use App\Models\Divisi;

class ItemSeeder extends Seeder
{
    public function run()
    {
        // Ambil ID salah satu divisi (misal Sekretariat) untuk relasi
        $divisiSekretariat = Divisi::where('nama', 'Sekretariat')->first();

        Item::insert([
            [
                'nama' => 'Laptop Dell',
                'sku' => 'LAP-001',
                'deskripsi' => 'Laptop untuk presentasi',
                'jumlah' => 5,
                'min_stok' => 1,
                'divisi_id' => $divisiSekretariat?->id,
                'image' => null,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'nama' => 'Proyektor',
                'sku' => 'PRJ-001',
                'deskripsi' => 'Proyektor kantor',
                'jumlah' => 2,
                'min_stok' => 1,
                'divisi_id' => $divisiSekretariat?->id,
                'image' => null,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'nama' => 'Kabel HDMI',
                'sku' => 'HDM-001',
                'deskripsi' => 'Kabel HDMI 2m',
                'jumlah' => 10,
                'min_stok' => 3,
                'divisi_id' => $divisiSekretariat?->id,
                'image' => null,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'nama' => 'Mouse Wireless',
                'sku' => 'MOU-001',
                'deskripsi' => 'Mouse wireless Logitech',
                'jumlah' => 15,
                'min_stok' => 5,
                'divisi_id' => $divisiSekretariat?->id,
                'image' => null,
                'created_at' => now(),
                'updated_at' => now(),
            ],
            [
                'nama' => 'Keyboard Mechanical',
                'sku' => 'KEY-001',
                'deskripsi' => 'Keyboard mechanical RGB',
                'jumlah' => 7,
                'min_stok' => 2,
                'divisi_id' => $divisiSekretariat?->id,
                'image' => null,
                'created_at' => now(),
                'updated_at' => now(),
            ],
        ]);
    }
}
