<?php

namespace App\Config;

use App\Interfaces\UserRequest;
use App\Models\StatusAkun;
use App\Models\UserRole;
use App\Repositories\UserRepo;

class UserSeeder
{

  public function init()
  {
    $userRepo = new UserRepo();
    if ($userRepo->count() > 0) {
      return;
    }

    $user = UserRequest::create(
      nama: "Admin",
      username: "admin",
      password: "admin123",
      email: "admin@gmail.com",
      noTelepon: "08637483728",
      role: UserRole::ADMIN,
      divisiId: null,
      statusAkun: StatusAkun::AKTIF,
      spesialisasi: null
    );

    $user->hashPassword();

    $userRepo->save($user);
  }
}
