<?php

namespace Modules\Category\Database\Seeders;

use Illuminate\Database\Seeder;
use Modules\Category\Models\Category;

class CategoryDatabaseSeeder extends Seeder
{
    public function run(): void
    {
        $categories = [
            ['name' => 'Obst & Gemüse', 'slug' => 'obst-gemuese', 'icon' => 'eco', 'sort_order' => 1, 'is_active' => true],
            ['name' => 'Fleisch & Wurst', 'slug' => 'fleisch-wurst', 'icon' => 'restaurant', 'sort_order' => 2, 'is_active' => true],
            ['name' => 'Milchprodukte', 'slug' => 'milchprodukte', 'icon' => 'egg', 'sort_order' => 3, 'is_active' => true],
            ['name' => 'Bäckerei', 'slug' => 'baeckerei', 'icon' => 'bakery_dining', 'sort_order' => 4, 'is_active' => true],
            ['name' => 'Frozen Food', 'slug' => 'frozen-food', 'icon' => 'ac_unit', 'sort_order' => 5, 'is_active' => true],
            ['name' => 'Save the Food', 'slug' => 'save-the-food', 'icon' => 'savings', 'sort_order' => 6, 'is_active' => true],
        ];

        foreach ($categories as $category) {
            Category::updateOrCreate(['slug' => $category['slug']], $category);
        }
    }
}
