<?php

namespace Database\Seeders;

use App\Models\ExpenseCategory;
use Illuminate\Database\Seeder;

class ExpenseCategorySeeder extends Seeder
{
    /**
     * Seed the expense categories table.
     */
    public function run(): void
    {
        $categories = [
            [
                'name' => 'Ingredients',
                'description' => 'Raw materials for ice cream production',
                'is_active' => true,
            ],
            [
                'name' => 'Utilities',
                'description' => 'Electricity, water, gas bills',
                'is_active' => true,
            ],
            [
                'name' => 'Rent',
                'description' => 'Shop and warehouse rent',
                'is_active' => true,
            ],
            [
                'name' => 'Salaries',
                'description' => 'Employee wages and benefits',
                'is_active' => true,
            ],
            [
                'name' => 'Equipment',
                'description' => 'Kitchen equipment, freezers, machines',
                'is_active' => true,
            ],
            [
                'name' => 'Maintenance',
                'description' => 'Repairs and upkeep',
                'is_active' => true,
            ],
            [
                'name' => 'Marketing',
                'description' => 'Advertising, promotions, social media',
                'is_active' => true,
            ],
            [
                'name' => 'Packaging',
                'description' => 'Cups, cones, spoons, napkins, boxes',
                'is_active' => true,
            ],
            [
                'name' => 'Transport',
                'description' => 'Delivery and logistics costs',
                'is_active' => true,
            ],
            [
                'name' => 'Office Supplies',
                'description' => 'Stationery, printing, software',
                'is_active' => true,
            ],
            [
                'name' => 'Cleaning',
                'description' => 'Cleaning supplies and services',
                'is_active' => true,
            ],
            [
                'name' => 'Insurance',
                'description' => 'Business and property insurance',
                'is_active' => true,
            ],
            [
                'name' => 'Taxes & Fees',
                'description' => 'Government taxes and licensing fees',
                'is_active' => true,
            ],
            [
                'name' => 'Miscellaneous',
                'description' => 'Other uncategorized expenses',
                'is_active' => true,
            ],
        ];

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

        $this->command->info('Expense categories seeded successfully!');
    }
}
