<?php

use Illuminate\Database\Seeder;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;

class ConsumableCategorySeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        /*
         * Permission Types
         *
         */
        $Permissionitems = [
            [
                'name'        => '{"en": "Mould", "hi":"" }',
                'created_by'  => 1,
            ],
            [
                'name'        => '{"en": "Iron Patti", "hi":"" }',
                'created_by'  => 1,
            ],
            [
                'name'        => '{"en": "Chemical", "hi":"" }',
                'created_by'  => 1,
            ],
            [
                'name'        => '{"en": "Grinding Wheel", "hi":"" }',
                'created_by'  => 1,
            ],
            
            [
                'name'        => '{"en": "Binder", "hi":"" }',
                'created_by'  => 1,
            ],
            [
                'name'        => '{"en": "Die", "hi":"" }',
                'created_by'  => 1,
            ],
            [
                'name'        => '{"en": "Coldpress Accesories", "hi":"" }',
                'created_by'  => 1,
            ],
            [
                'name'        => '{"en": "Hotpress Accesories", "hi":"" }',
                'created_by'  => 1,
            ]
        ];

        /*
         * Add Permission Items
         *
         */
        foreach ($Permissionitems as $Permissionitem) {
                DB::table('consumable_categories')->insert([
                    'name' => $Permissionitem['name'],
                    'created_by'=> $Permissionitem['created_by'],
                    'created_at' => Carbon::now()
                ]);
        }


        $Permissionitems = [
            [
                'name'        => '{"en":"GangSaw-BigPunch" , "hi": ""}',
                'spec' => '23/20X10X30mm',
                'add_spec' => 'Taper 0.25mm V Shape',
                'description' => '{"en":"Gangsaw BigPunch" , "hi": ""}',
                'unit_price' => 24,
                'opening_stock' => 216,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"GangSaw-MiddlePunch" , "hi": ""}',
                'spec' => '23/20X10X18mm',
                'add_spec' => 'Taper 0.25mm V Shape',
                'description' => '{"en":"Gangsaw MiddlePunch" , "hi": ""}',
                'unit_price' => 18,
                'opening_stock' => 216,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"GangSaw-SmallPunch" , "hi": ""}',
                'spec' => '23/20X10X15mm',
                'add_spec' => 'Taper 0.25mm V Shape',
                'description' => '{"en":"Gangsaw SmallPunch" , "hi": ""}',
                'unit_price' => 15,
                'opening_stock' => 432,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"GangSaw-Spencer" , "hi": ""}',
                'spec' => '80X10X20mm',
                'add_spec' => 'V Shape',
                'description' => '{"en":"Gangsaw Spencer" , "hi": ""}',
                'unit_price' => 55,
                'opening_stock' => 432,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"GangSaw-GraphitePlates" , "hi": ""}',
                'spec' => '80X12X82mm',
                'description' => '{"en":"Gangsaw Spencer" , "hi": ""}',
                'unit_price' => 120,
                'opening_stock' => 18,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Dressing-BigPunch" , "hi": ""}',
                'spec' => '26/23X10X37mm - V Shape',
                 'add_spec' => 'Taper 0.25mm V Shape',
                'description' => '{"en":"Dressing-BigPunch" , "hi": ""}',
                'unit_price' => 35,
                'opening_stock' => 18,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Dressing-MiddlePunch" , "hi": ""}',
                'spec' => '26/23X10X22mm - V Shape',
                'add_spec' => 'Taper 0.25mm V Shape',
                'description' => '{"en":"Dressing-MiddlePunch" , "hi": ""}',
                'unit_price' => 20,
                'opening_stock' => 18,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Dressing-SmallPunch" , "hi": ""}',
                'spec' => '26/23X10X20mm - V Shape',
                'add_spec' => 'Taper 0.25mm V Shape',
                'description' => '{"en":"Dressing-SmallPunch" , "hi": ""}',
                'unit_price' => 20,
                'opening_stock' => 18,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Dressing-Spencer" , "hi": ""}',
                'spec' => '80X10X20mm - V Shape',
                'add_spec' => 'V Shape',
                'description' => '{"en":"Dressing Spencer" , "hi": ""}',
                'unit_price' => 56,
                'opening_stock' => 432,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Dressing Side Plates(L)" , "hi": ""}',
                'spec' => '90X40X12',
                'add_spec' => 'V Shape',
                'description' => '{"en":"Dressing Center Platesr" , "hi": ""}',
                'unit_price' => 56,
                'opening_stock' => 432,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Dressing Center Plates" , "hi": ""}',
                'spec' => '75X95X12',
                'add_spec' => 'V Shape',
                'description' => '{"en":"Dressing Center Plates" , "hi": ""}',
                'unit_price' => 56,
                'opening_stock' => 432,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Dressing Side Plates" , "hi": ""}',
                'spec' => '75X95X12',
                'add_spec' => 'V Shape',
                'description' => '{"en":"Dressing Side Plates" , "hi": ""}',
                'unit_price' => 56,
                'opening_stock' => 432,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Graphite-Block-50mm" , "hi": ""}',
                'spec' => '130X130X50mm',
                'description' => '{"en":"Graphite Block for sintering machine" , "hi": ""}',
                'unit_price' => 1550,
                'opening_stock' => 4,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"IPA" , "hi": ""}',
                'spec' => 'deepak',
                'unit_price' => 85,
                'opening_stock' => 20,
                'opening_stock_unit' => 4,
                'created_by'  => 1,
                'category_id' => 3
            ],
            [
                'name'        => '{"en":"Acetone" , "hi": ""}',
                'spec' => 'Herdalia',
                'unit_price' => 82,
                'opening_stock' => 20,
                'opening_stock_unit' => 4,
                'created_by'  => 1,
                'category_id' => 3
            ],
            [
                'name'        => '{"en":"MDC" , "hi": ""}',
                'spec' => 'Taiwan',
                'unit_price' => 79,
                'opening_stock' => 150,
                'opening_stock_unit' => 4,
                'created_by'  => 1,
                'category_id' => 3
            ],
            [
                'name'        => '{"en":"Acrylic Resin Binder" , "hi": ""}',
                'spec' => 'small powder dana',
                'unit_price' => 450,
                'opening_stock' => 10,
                'opening_stock_unit' => 2,
                'created_by'  => 1,
                'category_id' => 3
            ],
            [
                'name'        => '{"en":"Plastic Dana Binder" , "hi": ""}',
                'spec' => 'coarse powder dana',
                'unit_price' => 200,
                'opening_stock' => 0,
                'opening_stock_unit' => 2,
                'created_by'  => 1,
                'category_id' => 3
            ],
            [
                'name'        => '{"en":"Gangsaw Die" , "hi": ""}',
                'spec' => 'small powder dana',
                'unit_price' => 8000,
                'opening_stock' => 150,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 7
            ],
            [
                'name'        => '{"en":"ColdPress Rubber" , "hi": ""}',
                'spec' => 'coldpress rubber',
                'unit_price' => 8000,
                'opening_stock' => 150,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 8
            ],
            [
                'name'        => '{"en":"MShape-SmallPunch" , "hi": ""}',
                'spec' => '24X10X15mm',
                'add_spec' => 'Taper 0.5mm M Shape',
                'description' => '{"en":"MShape-SmallPunch" , "hi": ""}',
                'unit_price' => 20,
                'opening_stock' => 0,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"MShape-BigPunch" , "hi": ""}',
                'spec' => '24X24X15mm',
                'add_spec' => 'Taper 0.5mm M Shape',
                'description' => '{"en":"MShape-BigPunch" , "hi": ""}',
                'unit_price' => 32,
                'opening_stock' => 0,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"MShape-Spencer" , "hi": ""}',
                'spec' => '80X24X10mm',
                'add_spec' => 'Both Side M Shape',
                'description' => '{"en":"MShape-Spencer" , "hi": ""}',
                'unit_price' => 61,
                'opening_stock' => 0,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Plain-Spencer" , "hi": ""}',
                'spec' => '80X24X10mm',
                'add_spec' => 'Both Side Plain Shape',
                'description' => '{"en":"Plain-Spencer" , "hi": ""}',
                'unit_price' => 55,
                'opening_stock' => 0,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"BoxType-23mm-BigPunch" , "hi": ""}',
                'spec' => '23X15X36mm',
                'add_spec' => 'Box Shape No Taper',
                'description' => '{"en":"BoxType-23mm-BigPunch" , "hi": ""}',
                'unit_price' => 34,
                'opening_stock' => 0,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"BoxType-23mm-MiddlePunch" , "hi": ""}',
                'spec' => '23X15X22mm',
                'add_spec' => 'Box Shape No Taper',
                'description' => '{"en":"BoxType-23mm-MiddlePunch" , "hi": ""}',
                'unit_price' => 20,
                'opening_stock' => 0,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"BoxType-23mm-SmallPunch" , "hi": ""}',
                'spec' => '23X15X18mm',
                'add_spec' => 'Box Shape No Taper',
                'description' => '{"en":"BoxType-23mm-SmallPunch" , "hi": ""}',
                'unit_price' => 16,
                'opening_stock' => 0,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"BoxType-23mm-SmallPunch" , "hi": ""}',
                'spec' => '23X15X18mm',
                'add_spec' => 'Box Shape No Taper',
                'description' => '{"en":"BoxType-23mm-SmallPunch" , "hi": ""}',
                'unit_price' => 16,
                'opening_stock' => 0,
                'opening_stock_unit' => 1,
                'created_by'  => 1,
                'category_id' => 1
            ],
            [
                'name'        => '{"en":"Natural Sand" , "hi": ""}',
                'spec' => '23X15X18mm',
                'add_spec' => 'Natural Sand',
                'description' => '{"en":"Natural Sand" , "hi": ""}',
                'unit_price' => 1,
                'opening_stock' => 0,
                'opening_stock_unit' => 3,
                'created_by'  => 1,
                'category_id' => 1
            ],
        ];

        foreach ($Permissionitems as $Permissionitem) {
            DB::table('consumable_items')->insert([
                'name' =>$Permissionitem['name'],
                'spec' => $Permissionitem['spec'],
                'unit_price' => $Permissionitem['unit_price'],
                'opening_stock' => $Permissionitem['opening_stock'],
                'opening_stock_unit' => $Permissionitem['opening_stock_unit'],
                'category_id' => $Permissionitem['category_id'],
                'created_by'=> $Permissionitem['created_by'],
                'created_at' => Carbon::now()
            ]);
    }

    }
}
