<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class CategorySeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        $categories = [
            ['id' => 1, 'parent_id' => null, 'name' => 'Pump Selection'],
            ['id' => 2, 'parent_id' => 1, 'name' => 'Chemical Name'],
            ['id' => 3, 'parent_id' => 2, 'name' => 'Positive Suction'],
            ['id' => 4, 'parent_id' => 2, 'name' => 'Negative Suction'],
            ['id' => 5, 'parent_id' => 3, 'name' => 'Akali'],
            ['id' => 6, 'parent_id' => 5, 'name' => 'Clear Liquid'],
            ['id' => 7, 'parent_id' => 5, 'name' => 'With Slurry'],
            ['id' => 8, 'parent_id' => 6, 'name' => 'Process'],
            ['id' => 9, 'parent_id' => 6, 'name' => 'ETP'],
            ['id' => 10, 'parent_id' => 6, 'name' => 'Transfer'],
            ['id' => 11, 'parent_id' => 6, 'name' => 'Utility Area'],
            ['id' => 12, 'parent_id' => 7, 'name' => 'Filtration'],
            ['id' => 13, 'parent_id' => 12, 'name' => 'Highly Flammable'],
            ['id' => 14, 'parent_id' => 12, 'name' => 'Non Flammable'],
            ['id' => 15, 'parent_id' => 13, 'name' => '0 to 2 %'],
            ['id' => 16, 'parent_id' => 13, 'name' => '0 to 10 %'],
            ['id' => 17, 'parent_id' => 13, 'name' => '0 to 30 %'],
            ['id' => 18, 'parent_id' => 14, 'name' => '0 to 2 %'],
            ['id' => 19, 'parent_id' => 14, 'name' => '0 to 10 %'],
            ['id' => 20, 'parent_id' => 14, 'name' => '0 to 30 %'],
            ['id' => 21, 'parent_id' => 14, 'name' => '0 to 50 %'],
            ['id' => 22, 'parent_id' => 4, 'name' => 'Acidic'],
        ];

        foreach ($categories as $category) {
            \App\Models\Category::updateOrCreate(['id' => $category['id']], $category);
        }
    }
}
