<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\Admin;
use App\Models\User;
use Faker\Factory as Faker;

class AdminSeeder extends Seeder
{
  /**
   * Run the database seeds.
   */
  public function run(): void
  {
    // 0 start

    $user = User::factory()->create([
      'name' => 'David',
      'email' => 'david_chan@school.com',
      'password' => 'david_chan',
      'role' => 'admin',
      'role_id' => '',
    ]);

    Admin::factory()->create([
      'name' => 'David',
      'firstName' => 'David',
      'lastName' => 'Chan',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'male',
      'email' => 'david_chan@school.com',
      'contact' => 'Flat A, 11/F, Block 3, Ocean View Court, Tuen Mun',
      'skills' =>
        'Feng Shui consulting, Traditional Chinese medicine diagnosis, Wonton noodle soup preparation, Dumpling making, Singing in a karaoke bar',
      'user_id' => $user->id,
      'avatar' => 'david_chan_school_com.jpg',
    ]);

    // 1 start

    $user = User::factory()->create([
      'name' => 'Karen',
      'email' => 'karen_wong@school.com',
      'password' => 'karen_wong',
      'role' => 'admin',
      'role_id' => '',
    ]);

    Admin::factory()->create([
      'name' => 'Karen',
      'firstName' => 'Karen',
      'lastName' => 'Wong',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'female',
      'email' => 'karen_wong@school.com',
      'contact' => 'G/F, 46D Shantung Street, Mong Kok',
      'skills' =>
        'Chinese tea ceremony, Tai Chi practice, Feng Shui consulting',
      'user_id' => $user->id,
      'avatar' => 'karen_wong_school_com.jpg',
    ]);

    // 2 start

    $user = User::factory()->create([
      'name' => 'William',
      'email' => 'william_lee@school.com',
      'password' => 'william_lee',
      'role' => 'admin',
      'role_id' => '',
    ]);

    Admin::factory()->create([
      'name' => 'William',
      'firstName' => 'William',
      'lastName' => 'Lee',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'male',
      'email' => 'william_lee@school.com',
      'contact' => 'Unit D, 18/F, Block 6, Kwun Tong Garden, Ngau Tau Kok',
      'skills' =>
        'Cha chaan teng cooking, Wonton noodle soup preparation, Street photography, Chinese tea ceremony, Hong Kong-style fashion design',
      'user_id' => $user->id,
      'avatar' => 'william_lee_school_com.jpg',
    ]);

    // 3 start

    $user = User::factory()->create([
      'name' => 'Emily',
      'email' => 'emily_cheung@school.com',
      'password' => 'emily_cheung',
      'role' => 'admin',
      'role_id' => '',
    ]);

    Admin::factory()->create([
      'name' => 'Emily',
      'firstName' => 'Emily',
      'lastName' => 'Cheung',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'female',
      'email' => 'emily_cheung@school.com',
      'contact' => 'Room E, 23/F, Block 8, Tai Hing Gardens, Tuen Mun',
      'skills' =>
        'Kung Fu training, Tai Chi practice, Chinese calligraphy, Cha chaan teng cooking, Street photography',
      'user_id' => $user->id,
      'avatar' => 'emily_cheung_school_com.jpg',
    ]);

    // 4 start

    $user = User::factory()->create([
      'name' => 'Michael',
      'email' => 'michael_ng@school.com',
      'password' => 'michael_ng',
      'role' => 'admin',
      'role_id' => '',
    ]);

    Admin::factory()->create([
      'name' => 'Michael',
      'firstName' => 'Michael',
      'lastName' => 'Ng',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'male',
      'email' => 'michael_ng@school.com',
      'contact' => '36E Po Tung Road, Sai Kung',
      'skills' => 'Cantonese opera singing, Dim sum making',
      'user_id' => $user->id,
      'avatar' => 'michael_ng_school_com.jpg',
    ]);

    // 5 start

    $user = User::factory()->create([
      'name' => 'Michelle',
      'email' => 'michelle_lam@school.com',
      'password' => 'michelle_lam',
      'role' => 'admin',
      'role_id' => '',
    ]);

    Admin::factory()->create([
      'name' => 'Michelle',
      'firstName' => 'Michelle',
      'lastName' => 'Lam',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'female',
      'email' => 'michelle_lam@school.com',
      'contact' => 'Flat B, 7/F, Block 2, Goldfield Industrial Centre, Sha Tin',
      'skills' =>
        'Cantonese language proficiency, Singing in a karaoke bar, Chinese calligraphy',
      'user_id' => $user->id,
      'avatar' => 'michelle_lam_school_com.jpg',
    ]);

    // $user = User::factory()->create([
    //     'name' => 'admin_1',
    //     'email' => 'admin1@school.com',
    //     'password' => 'admin1',
    //     'role' => 'admin',
    //     'role_id' => ''

    // ]);

    // Admin::factory()->create([
    //     'name' => 'admin 1',
    //     'firstName' => 'firstNameT',
    //     'lastName' => 'lastNameT',
    //     'dateOfBirth' => '1980-12-31',
    //     'gender' => 'male',
    //     'email' => 'admin1@school.com',
    //     'contact' => 'contact address admin 1',
    //     'skills' => 'skills',
    //     'user_id'=> $user->id
    // ]);

    // $faker = Faker::create();
    // foreach (range(2, 5) as $index) {
    //     $user = User::factory()->create([
    //         'name' => 'admin_'.$index,
    //         'email' => 'admin'.$index.'@school.com',
    //         'password' => 'admin'.$index,
    //         'role' => 'admin',
    //         'role_id' => ''

    //     ]);

    //     Admin::factory()->create([
    //         'name' => 'admin '.$index,
    //         'firstName' => 'firstNameT',
    //         'lastName' => 'lastNameT',
    //         'dateOfBirth' => '1980-12-31',
    //         'gender' => 'male',
    //         'email' => 'admin'.$index.'@school.com',
    //         'contact' => 'contact address admin '.$index,
    //         'skills' => 'skills',
    //         'user_id'=> $user->id
    //     ]);
    // }
  }
}
