<?php

namespace Modules\Inventory\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\Inventory\Models\InventoryDepartment;

class InventoryDepartmentSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $departments = [
            [
                'name' => 'Central Store',
                'code' => 'CSTORE',
            ],
            [
                'name' => 'Pharmacy Store',
                'code' => 'PHARM',
            ],
            [
                'name' => 'Laboratory Store',
                'code' => 'LABSTR',
            ],
            [
                'name' => 'Asset Store',
                'code' => 'ASTR',
            ],
        ];

        foreach ($departments as $dept) {
            InventoryDepartment::updateOrCreate(
                ['code' => $dept['code']],
                $dept
            );
        }
    }
}
