<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
use Mtc\Core\Admin\User;

class AdminUsersTableSeeder extends Seeder
{
    /**
     * Auto generated seed file
     *
     * @return void
     */
    public function run()
    {
        echo 'Seeding admin_users...'.PHP_EOL;

        DB::table('admin_users')->delete();

        DB::table('admin_users')->insert(array(
            0 => array(
                'id' => '1',
                'username' => 'mtcadmin',
                'password' => '',
                'email' => 'mtc@mtcmedia.co.uk',
                'signature' => '',
                'session_id' => '',
                'name' => 'mtc.',
                'last_login' => '2024-02-01 09:35:56',
                'last_updated' => '2024-02-01 09:35:56',
                'role' => '0',
                'credentials' => '',
            ),
        ));

        if (app()->environment('local')) {
            // Doctors
            User::factory()
                ->count(2)
                ->doctor()
                ->create();

            // Pharmacists
            User::factory()
                ->count(3)
                ->pharmacist()
                ->create();

            // Shop Manager
            User::factory()
                ->shop_manager()
                ->create();

            // NHS Pharmacist
            User::factory()
                ->count(3)
                ->nhs_pharmacist()
                ->create();

            // NHS Pharmacist
            User::factory()
                ->count(3)
                ->private_pharmacist()
                ->create();
        }
    }
}
