<?php

namespace Database\Seeders;

use App\Models\GenericBackoffice\OpenPosition;
use App\Models\GenericBackoffice\Project;
use Illuminate\Database\Seeder;
use Carbon\Carbon;
use Illuminate\Support\Facades\DB;

class ProjectsTableSeeder extends Seeder
{
    private $table = 'projects';
    private $langTable = 'project_languages';

    private $websiteTable = 'website_objects';
    private $websiteLangTable = 'website_objects_lang';

    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        // Table already deleted in DatabaseSeeder

        $now = Carbon::now();

        DB::table($this->table)->insert(
            [
                [
                    'id'                => 1,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],

                // Temporary, for testing purposes
                [
                    'id'                => 101,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 102,
                    'backend_user_id'   => 1,
                    'project_type'      => 'case',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 103,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 104,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 105,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 106,
                    'backend_user_id'   => 1,
                    'project_type'      => 'case',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 107,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 108,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 109,
                    'backend_user_id'   => 1,
                    'project_type'      => 'case',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 110,
                    'backend_user_id'   => 1,
                    'project_type'      => 'case',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 111,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 112,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 113,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 114,
                    'backend_user_id'   => 1,
                    'project_type'      => 'work',
                    'main_image_id'     => 1,
                    'meta_image_id'     => 1,
                    'created_at'        => $now
                ],
            ]
        );

        DB::table($this->langTable)->insert(
            [
                [
                    'translation_id'    => 1,
                    'project_id'        => 1,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem',
                    'title'             => 'Grass4You',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],

                // Temporary, for testing purposes
                [
                    'translation_id'    => 101,
                    'project_id'        => 101,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #1',
                    'title'             => 'Grass4You #1',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 102,
                    'project_id'        => 102,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #2',
                    'title'             => 'Grass4You #2',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 103,
                    'project_id'        => 103,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem $3',
                    'title'             => 'Grass4You #3',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 104,
                    'project_id'        => 104,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #4',
                    'title'             => 'Grass4You #4',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 105,
                    'project_id'        => 105,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #5',
                    'title'             => 'Grass4You #5',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 106,
                    'project_id'        => 106,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #6',
                    'title'             => 'Grass4You #6',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 107,
                    'project_id'        => 107,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #7',
                    'title'             => 'Grass4You #7',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 108,
                    'project_id'        => 108,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #8',
                    'title'             => 'Grass4You #8',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 109,
                    'project_id'        => 109,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #9',
                    'title'             => 'Grass4You #9',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 110,
                    'project_id'        => 110,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #10',
                    'title'             => 'Grass4You #10',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 111,
                    'project_id'        => 111,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #11',
                    'title'             => 'Grass4You #11',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 112,
                    'project_id'        => 112,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #12',
                    'title'             => 'Grass4You #12',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 113,
                    'project_id'        => 113,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #13',
                    'title'             => 'Grass4You #13',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 114,
                    'project_id'        => 114,
                    'language_id'       => 'en',
                    'project_title'     => 'Grass4You and the case of having a good problem #14',
                    'title'             => 'Grass4You #14',
                    'project_keywords'  => 'eCommerce:Shopify:User Experience',
                    'meta_title'        => 'Grass4You',
                    'meta_description'  => 'Grass4You and the case of having a good problem',
                    'created_at'        => $now
                ],
            ]
        );

        DB::table($this->websiteTable)->insert(
            [
                [
                    'website_object_id' => 1501,
                    'parent_id'         => null,
                    'object_id'         => 1,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you',
                    'uri'               => '/work/grass4you',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 1,
                    'created_at'        => $now
                ],

                // Temporary, for testing purposes
                [
                    'website_object_id' => 1551,
                    'parent_id'         => null,
                    'object_id'         => 101,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-1',
                    'uri'               => '/work/grass4you-1',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 2,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1552,
                    'parent_id'         => null,
                    'object_id'         => 102,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-2',
                    'uri'               => '/work/grass4you-2',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 3,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1553,
                    'parent_id'         => null,
                    'object_id'         => 103,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-3',
                    'uri'               => '/work/grass4you-3',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 4,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1554,
                    'parent_id'         => null,
                    'object_id'         => 104,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-4',
                    'uri'               => '/work/grass4you-4',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 5,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1555,
                    'parent_id'         => null,
                    'object_id'         => 105,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-5',
                    'uri'               => '/work/grass4you-5',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 6,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1556,
                    'parent_id'         => null,
                    'object_id'         => 106,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-6',
                    'uri'               => '/work/grass4you-6',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 7,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1557,
                    'parent_id'         => null,
                    'object_id'         => 107,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-7',
                    'uri'               => '/work/grass4you-7',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 8,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1558,
                    'parent_id'         => null,
                    'object_id'         => 108,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-8',
                    'uri'               => '/work/grass4you-8',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 9,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1559,
                    'parent_id'         => null,
                    'object_id'         => 109,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-9',
                    'uri'               => '/work/grass4you-9',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 10,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1560,
                    'parent_id'         => null,
                    'object_id'         => 110,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-10',
                    'uri'               => '/work/grass4you-10',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 11,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1561,
                    'parent_id'         => null,
                    'object_id'         => 111,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-11',
                    'uri'               => '/work/grass4you-11',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 12,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1562,
                    'parent_id'         => null,
                    'object_id'         => 112,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-12',
                    'uri'               => '/work/grass4you-12',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 13,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1563,
                    'parent_id'         => null,
                    'object_id'         => 113,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-13',
                    'uri'               => '/work/grass4you-13',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 14,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 1564,
                    'parent_id'         => null,
                    'object_id'         => 114,
                    'object_type'       => Project::class,
                    'content_type'      => 'project',
                    'slug'              => 'grass4you-14',
                    'uri'               => '/work/grass4you-14',
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 15,
                    'created_at'        => $now
                ],
            ]
        );

        DB::table($this->websiteLangTable)->insert(
            [
                [
                    'wo_translation_id' => 1501,
                    'website_object_id' => 1501,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you',
                    'lang_uri'          => '/work/grass4you',
                ],

                // Temporary, for testing purposes
                [
                    'wo_translation_id' => 1551,
                    'website_object_id' => 1551,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-1',
                    'lang_uri'          => '/work/grass4you-1',
                ],
                [
                    'wo_translation_id' => 1552,
                    'website_object_id' => 1552,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-2',
                    'lang_uri'          => '/work/grass4you-2',
                ],
                [
                    'wo_translation_id' => 1553,
                    'website_object_id' => 1553,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-3',
                    'lang_uri'          => '/work/grass4you-3',
                ],
                [
                    'wo_translation_id' => 1554,
                    'website_object_id' => 1554,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-4',
                    'lang_uri'          => '/work/grass4you-4',
                ],
                [
                    'wo_translation_id' => 1555,
                    'website_object_id' => 1555,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-5',
                    'lang_uri'          => '/work/grass4you-5',
                ],
                [
                    'wo_translation_id' => 1556,
                    'website_object_id' => 1556,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-6',
                    'lang_uri'          => '/work/grass4you-6',
                ],
                [
                    'wo_translation_id' => 1557,
                    'website_object_id' => 1557,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-7',
                    'lang_uri'          => '/work/grass4you-7',
                ],
                [
                    'wo_translation_id' => 1558,
                    'website_object_id' => 1558,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-8',
                    'lang_uri'          => '/work/grass4you-8',
                ],
                [
                    'wo_translation_id' => 1559,
                    'website_object_id' => 1559,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-9',
                    'lang_uri'          => '/work/grass4you-9',
                ],
                [
                    'wo_translation_id' => 1560,
                    'website_object_id' => 1560,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-10',
                    'lang_uri'          => '/work/grass4you-10',
                ],
                [
                    'wo_translation_id' => 1561,
                    'website_object_id' => 1561,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-11',
                    'lang_uri'          => '/work/grass4you-11',
                ],
                [
                    'wo_translation_id' => 1562,
                    'website_object_id' => 1562,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-12',
                    'lang_uri'          => '/work/grass4you-12',
                ],
                [
                    'wo_translation_id' => 1563,
                    'website_object_id' => 1563,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-13',
                    'lang_uri'          => '/work/grass4you-13',
                ],
                [
                    'wo_translation_id' => 1564,
                    'website_object_id' => 1564,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'grass4you-14',
                    'lang_uri'          => '/work/grass4you-14',
                ],
            ]
        );
    }
}
