<?php
/**
 *
 * @todo        Dieser Seeder funktioniert aktuell nur im SingleTenantMode.
 *
 * @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 Database\Seeders\Globals;


use BplanBase\Globals\Models\Tenant;
use BplanBase\Globals\Models\GlobalSetting;
use Illuminate\Database\Seeder;


/**
 *
 * @author      Wassilios Meletiadis <wassilios.meletiadis@bplan-solutions.de>
 */
class GlobalSettingSeeder 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');

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

        GlobalSetting::insert([
            [
                'id'                            => $ProjectTenant->id,
                'uuid'                          => $ProjectTenant->uuid,
                'created_at'                    => $date,
                'updated_at'                    => $date,
                'anonymization_threshold_days'  => 30,
            ],
        ]);

    } // run()

} // class GlobalSettingSeeder extends Seeder {}
