<?php

namespace Database\Seeders;

use App\Models\ProductCategory;
use Illuminate\Database\Seeder;
use Illuminate\Support\Str;

class ProductCategorySeeder extends Seeder
{
    /**
     * @var list<string>
     */
    private array $categories = [
        'Venue Hire',
        'Catering',
        'Beverages',
        'AV',
        'Furniture',
        'Decorations',
        'Signage',
        'Lighting',
        'Entertainment',
        'Internet',
        'Security',
        'Cleaning',
        'Staffing',
        'Transport',
        'Printing',
        'Photography',
        'Other',
    ];

    public function run(): void
    {
        foreach ($this->categories as $index => $name) {
            ProductCategory::query()->updateOrCreate(
                ['slug' => Str::slug($name)],
                [
                    'name' => $name,
                    'sort_order' => $index + 1,
                    'is_active' => true,
                ],
            );
        }
    }
}
