<?php

namespace Database\Seeders;

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

class KeyMessagesTableSeeder extends Seeder
{
    private $table = 'key_messages';
    private $langTable = 'key_message_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,
                    'created_at'        => $now
                ],
                [
                    'id'                => 2,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 3,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 4,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 5,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 6,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 7,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 8,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 9,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 10,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 11,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ],
                [
                    'id'                => 12,
                    'backend_user_id'   => 1,
                    'created_at'        => $now
                ]
            ]
        );

        DB::table($this->langTable)->insert(
            [
                [
                    'translation_id'    => 1,
                    'key_message_id'    => 1,
                    'language_id'       => 'en',
                    'title'             => 'EAE is independent',
                    'message_title'     => 'EAE is an independent company.',
                    'text'              => "We don't need to upsell or cross-sell you on things for the sake of group interests.",
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 2,
                    'key_message_id'    => 2,
                    'language_id'       => 'en',
                    'title'             => 'We do want to create',
                    'message_title'     => "We DO want to create the best\r\nWork of our lives with inspiring clients",
                    'text'              => "That's why we deal at eye level and play an open game.",
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 3,
                    'key_message_id'    => 3,
                    'language_id'       => 'en',
                    'title'             => 'Notice the capital W',
                    'message_title'     => "Have you noticed that we always write Work with a capital W?",
                    'text'              => 'Work is sacred to us.',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 4,
                    'key_message_id'    => 4,
                    'language_id'       => 'en',
                    'title'             => 'Value - Competence',
                    'message_title'     => 'Competence',
                    'text'              => '18 years of experience, commitment to quality in countless projects and the collective knowledge of our most senior team: that’s our definition of competence.',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 5,
                    'key_message_id'    => 5,
                    'language_id'       => 'en',
                    'title'             => 'Value - Honesty',
                    'message_title'     => 'Honesty',
                    'text'              => 'Be honest and communicate a lot. If you are honest clients trust you. And the more you communicate, the more time, money and headaches you save down the line.',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 6,
                    'key_message_id'    => 6,
                    'language_id'       => 'en',
                    'title'             => 'Value - Loyalty',
                    'message_title'     => 'Loyalty',
                    'text'              => 'We value long-term relationships over quick wins. If we are working on your project, we are on your team. That goes both ways: you are on our team too. Welcome.',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 7,
                    'key_message_id'    => 7,
                    'language_id'       => 'en',
                    'title'             => 'Perk - People Culture',
                    'message_title'     => 'A People Culture',
                    'text'              => 'Trust and responsibility go hand-in-hand here. We trust you to be flexible and manage your energy for a healthy work-life balance. We also expect from you the responsibility to deliver nothing less than your absolute best.',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 8,
                    'key_message_id'    => 8,
                    'language_id'       => 'en',
                    'title'             => 'Perk - Professional Development & Growth',
                    'message_title'     => 'Your Professional Development & Growth',
                    'text'              => 'Do you wish to expand your knowledge? Of course you do. We agree that curiosity is a driver of success. That’s why you can expect to attend relevant conferences, summits and organize on-demand training',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 9,
                    'key_message_id'    => 9,
                    'language_id'       => 'en',
                    'title'             => 'Perk - Our Get-Togethers',
                    'message_title'     => 'Our Get-Togethers',
                    'text'              => 'Do you want to thrive? Science says humans can’t thrive without social interaction. So be ready:  we like to spend time together to build our team spirits and create a healthy sense of belonging.',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 10,
                    'key_message_id'    => 10,
                    'language_id'       => 'en',
                    'title'             => 'Perk - Your Health Insurance',
                    'message_title'     => 'Your Health Insurance',
                    'text'              => 'Consider it a subscription for good health and big smiles. We have you covered with private health insurance and a dental care plan.',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 11,
                    'key_message_id'    => 11,
                    'language_id'       => 'en',
                    'title'             => 'Perk - Free Public Transport',
                    'message_title'     => 'Free Public Transport',
                    'text'              => 'Master your people-watching skills, enjoy less stressful journeys, and be green. Public transport in the Lisbon metropolitan area is on us. Plus, our office is in the coolest part of town, within walking distance of shops, restaurants and bars.',
                    'created_at'        => $now
                ],
                [
                    'translation_id'    => 12,
                    'key_message_id'    => 12,
                    'language_id'       => 'en',
                    'title'             => 'Perk - Free Fruits, Sweets and Beverages',
                    'message_title'     => 'Free Fruits, Sweets and Beverages',
                    'text'              => 'Fresh fruit, chocolates, cookies, coffee and tea await you at the office. But be warned: some of the supplies are quick to vanish. This may or may not have something to do with a secret EAE running team.',
                    'created_at'        => $now
                ]
            ]
        );

        DB::table($this->websiteTable)->insert(
            [
                [
                    'website_object_id' => 301,
                    'parent_id'         => null,
                    'object_id'         => 1,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'eae-independent',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 1,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 302,
                    'parent_id'         => null,
                    'object_id'         => 2,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'create-the-best-inspiring',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 2,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 303,
                    'parent_id'         => null,
                    'object_id'         => 3,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'work-with-capital-w',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 3,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 304,
                    'parent_id'         => null,
                    'object_id'         => 4,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'competence',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 4,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 305,
                    'parent_id'         => null,
                    'object_id'         => 5,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'honesty',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 5,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 306,
                    'parent_id'         => null,
                    'object_id'         => 6,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'loyalty',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 6,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 307,
                    'parent_id'         => null,
                    'object_id'         => 7,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'human-centered-culture',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 7,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 308,
                    'parent_id'         => null,
                    'object_id'         => 8,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'professional-development',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 8,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 309,
                    'parent_id'         => null,
                    'object_id'         => 9,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'company-events',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 9,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 310,
                    'parent_id'         => null,
                    'object_id'         => 10,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'private-health-insurance',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 10,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 311,
                    'parent_id'         => null,
                    'object_id'         => 11,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'paid-commuting',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 11,
                    'created_at'        => $now
                ],
                [
                    'website_object_id' => 312,
                    'parent_id'         => null,
                    'object_id'         => 12,
                    'object_type'       => KeyMessage::class,
                    'content_type'      => 'keyMessage',
                    'slug'              => 'free-snacks',
                    'uri'               => null,
                    'template'          => null,
                    'status'            => 'published',
                    'position'          => 12,
                    'created_at'        => $now
                ]
            ]
        );

        DB::table($this->websiteLangTable)->insert(
            [
                [
                    'wo_translation_id' => 301,
                    'website_object_id' => 301,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'eae-independent',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 302,
                    'website_object_id' => 302,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'create-the-best-inspiring',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 303,
                    'website_object_id' => 303,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'work-with-capital-w',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 304,
                    'website_object_id' => 304,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'competence',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 305,
                    'website_object_id' => 305,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'honesty',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 306,
                    'website_object_id' => 306,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'loyalty',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 307,
                    'website_object_id' => 307,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'human-centered-culture',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 308,
                    'website_object_id' => 308,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'professional-development',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 309,
                    'website_object_id' => 309,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'company-events',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 310,
                    'website_object_id' => 310,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'private-health-insurance',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 311,
                    'website_object_id' => 311,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'paid-commuting',
                    'lang_uri'          => null,
                ],
                [
                    'wo_translation_id' => 312,
                    'website_object_id' => 312,
                    'wo_language_id'    => 'en',
                    'lang_slug'         => 'free-snacks',
                    'lang_uri'          => null,
                ]
            ]
        );
    }
}
