<?php

namespace Modules\SystemCore\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\SystemCore\App\Models\CoreProductCategory;

class ProductCategorySeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $categories = [
            ['name' => 'Electronics', 'code' => 'ELEC', 'display_order' => 1],
            ['name' => 'Clothing', 'code' => 'CLTH', 'display_order' => 2],
            ['name' => 'Food & Beverages', 'code' => 'FOOD', 'display_order' => 3],
            ['name' => 'Home & Garden', 'code' => 'HOME', 'display_order' => 4],
            ['name' => 'Office Supplies', 'code' => 'OFFC', 'display_order' => 5],
            ['name' => 'Services', 'code' => 'SERV', 'display_order' => 6],
            ['name' => 'Furniture', 'code' => 'FURN', 'display_order' => 7],
            ['name' => 'Stationery', 'code' => 'STAT', 'display_order' => 8],
        ];

        foreach ($categories as $category) {
            CoreProductCategory::firstOrCreate(
                ['code' => $category['code']],
                $category
            );
        }
    }
}
