<?php
/**
 * Seeder Class
 *
 * @version     1.0.$Revision:$
 * @version     SVN: $Id:$
 * @package     bplan-base\globals
 * @subpackage  Seeders
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 * @copyright   Copyright (C) 2025, 2026 bplan-solutions GmbH & Co. KG <https://www.bplan-solutions.de/>
 * /Δ\
 */

namespace BplanBase\Globals\Database\Seeders\Dev;


use App\Models\User;
use BplanBase\Globals\Enums\UserAccessLevel;
use BplanBase\Globals\Models\Tenant;
use BplanBase\Globals\Setup\Logger;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;


/**
 * Seeder Class
 *
 * Seed development users with records and roles.
 *
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 */
class CombinedUserSeeder extends Seeder
{

    /**
     * Run the database seeds.
     *
     * @return void
     *
     * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
     */
    public function run()
    {
        $date = date('Y-m-d H:i:s');
        $env = strtolower(config('app.env'));

        $SystemTenant = Tenant::where('identifier', 'System')->first();
        $ProjectTenant = Tenant::where('identifier', '=', config('globals.global-tenant'))->first();

        $users = [
            [
                'data' => [
                    'access_level' => UserAccessLevel::Developer->name,
                    'email' => 'emilio.cannarozzo@bplan-solutions.de',
                    'internal' => 1,
                    'name' => 'Emilio Cannarozzo',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Developer->name,
                    'email' => 'wassilios.meletiadis@bplan-solutions.de',
                    'internal' => 1,
                    'name' => 'Wassilios Meletiadis',
                    'tenant_id' => $SystemTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',
                ],
            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Developer->name,
                    'email' => 'tolga.kocer@bplan-solutions.de',
                    'internal' => 1,
                    'name' => 'Tolga Kocer',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Developer->name,
                    'email' => 'malte.bliefernicht@bplan-solutions.de',
                    'internal' => 1,
                    'name' => 'Malte Bliefernicht',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Developer->name,
                    'email' => 'marco.odenthal@bplan-solutions.de',
                    'internal' => 1,
                    'name' => 'Marco Odenthal',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Developer->name,
                    'email' => 'norbert.buendgen@bplan-solutions.de',
                    'internal' => 1,
                    'name' => 'Norbert Bündgen',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Developer->name,
                    'email' => 'lea.buendgen@bplan-solutions.de',
                    'internal' => 1,
                    'name' => 'Lea Bündgen',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Developer->name,
                    'email' => 'andrea.bockholt@bplan-solutions.de',
                    'internal' => 1,
                    'name' => 'Andrea Bockholt',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Developer->name,
                    'email' => 'nicole.beth@bplan-solutions.de',
                    'internal' => 1,
                    'name' => 'Nicole Beth',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Staff->name,
                    'email' => 'admin@lucky-pc.de',
                    'internal' => 1,
                    'name' => 'Admin User',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Admin',     // Rolle gehört eigentlich nach Entry. Da es sich hier aber nur um einen Dev-Seeder handelt, ist das okay.
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Staff->name,
                    'email' => 'host@lucky-pc.de',
                    'internal' => 1,
                    'name' => 'Host User',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Host',     // Rolle gehört eigentlich nach Entry. Da es sich hier aber nur um einen Dev-Seeder handelt, ist das okay.
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Staff->name,
                    'email' => 'logistics@lucky-pc.de',
                    'internal' => 1,
                    'name' => 'Logistics User',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Logistics',   // Rolle gehört eigentlich nach Entry. Da es sich hier aber nur um einen Dev-Seeder handelt, ist das okay.
                ],

            ],
            [
                'data' => [
                    'access_level' => UserAccessLevel::Staff->name,
                    'email' => 'report@lucky-pc.de',
                    'internal' => 1,
                    'name' => 'Report User',
                    'tenant_id' => $ProjectTenant->id,
                ],
                'password' => true,
                'roles' => [
                    'Report',   // Rolle gehört eigentlich nach Entry. Da es sich hier aber nur um einen Dev-Seeder handelt, ist das okay.
                ],

            ],

            // [
            //     'data' => [
            //         'access_level' => UserAccessLevel::Staff->name,
            //         'email' => 'test.admin@bplan-solutions.de',
            //         'internal' => 0,
            //         'name' => 'Test Admin',
            //         'tenant_id' => Tenant::where('identifier', '=', 'Sportbund')->first()->id,
            //     ],
            //     'password' => true,
            //     'roles' => [
            //         'Admin',
            //     ],

            // ],
        ];
        seed_users($users);

    } // run()


} // class CombinedUserSeeder extends Seeder {}
