<?php

namespace Database\Seeders\Product\Traits;

use App\Models\Pos\Product\Product\Product;
use App\Repositories\Core\Status\StatusRepository;

trait ProductSeederTrait
{
    public function productSeeder()
    {
        $activeProductStatusId = resolve(StatusRepository::class)->productActive();

        $products = [
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' => $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Leather belt',
                'description' => '',
                'slug' => 'leather belt 1',
            ],
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' =>  $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Sleeves',
                'description' => '',
                'slug' => 'sleeves 1',
            ],
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' =>  $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'T Shirt',
                'description' => '',
                'slug' => 't shirt 1',
            ],
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' =>  $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Black tie',
                'description' => '',
                'slug' => 'black tie 1',
            ],
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' =>  $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Cotton women full pant',
                'description' => '',
                'slug' => 'cotton women full pant 1',
            ],
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' => $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Full jeans pant',
                'description' => '',
                'slug' => 'full jeans pant 1',
            ],
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' =>  $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Hat',
                'description' => '',
                'slug' => 'hat 1',
            ],
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' => $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Full pant for man',
                'description' => '',
                'slug' => 'full pant for man 1',
            ],
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' =>  $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Three quarter pant',
                'description' => '',
                'slug' => 'three quarter pant 1',
            ],
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' => $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'single',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Sporty Track pants',
                'description' => '',
                'slug' => 'sporty Track pants 1',
            ],
            //for variant product....01
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' =>  $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'variant',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'T Shirt for man',
                'description' => '',
                'slug' => 't-shirt-for-man1',
            ],

            //for variant product....02
            [
                'category_id' => 1,
                'sub_category_id' => 1,
                'brand_id' => 1,
                'unit_id' => 1,
                'group_id' => 1,
                'status_id' =>  $activeProductStatusId,
                'created_by' => 1,
                'product_type' => 'variant',
                'warranty_duration' => 3,
                'duration_id' => 1,
                'name' => 'Cotton Short Sleeve T-shirt',
                'description' => '',
                'slug' => 'cotton-short-sleeve-t-shirt1',
            ],
        ];

        Product::query()->insert($products);
    }

}