<?php

namespace Database\Seeders;

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

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

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

    Student::factory()->create([
      'name' => 'John',
      'firstName' => 'John',
      'lastName' => 'Ho',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'male',
      'email' => 'john_ho@school.com',
      'address' =>
        'Shop C, G/F, Bellagio, 298 Prince Edward Road West, Kowloon',
      'user_id' => $user->id,
      'avatar' => 'john_ho_school_com.jpg',
    ]);

    // 7 start

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

    Student::factory()->create([
      'name' => 'Sarah',
      'firstName' => 'Sarah',
      'lastName' => 'Fung',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'female',
      'email' => 'sarah_fung@school.com',
      'address' => 'Flat 5C, 14/F, Block 2, Lei On Court, Cheung Sha Wan',
      'user_id' => $user->id,
      'avatar' => 'sarah_fung_school_com.jpg',
    ]);

    // 8 start

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

    Student::factory()->create([
      'name' => 'Andrew',
      'firstName' => 'Andrew',
      'lastName' => 'Yip',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'male',
      'email' => 'andrew_yip@school.com',
      'address' => '22B Tai Ho Road, Tsuen Wan',
      'user_id' => $user->id,
      'avatar' => 'andrew_yip_school_com.jpg',
    ]);

    // 9 start

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

    Student::factory()->create([
      'name' => 'Jessica',
      'firstName' => 'Jessica',
      'lastName' => 'Kwok',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'female',
      'email' => 'jessica_kwok@school.com',
      'address' => 'Room 1201, 12/F, Tung Lo Court, Sheung Shui',
      'user_id' => $user->id,
      'avatar' => 'jessica_kwok_school_com.jpg',
    ]);

    // 10 start

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

    Student::factory()->create([
      'name' => 'Richard',
      'firstName' => 'Richard',
      'lastName' => 'Cheng',
      'dateOfBirth' => '1980-12-31',
      'gender' => 'male',
      'email' => 'richard_cheng@school.com',
      'address' => 'G/F, 66-68 Main Street, Yung Shue Wan, Lamma Island',
      'user_id' => $user->id,
      'avatar' => 'richard_cheng_school_com.jpg',
    ]);

    for ($x = 0; $x <= 30; $x++) {

      $user = User::factory()->create([
        'name' => 'student_'.$x,
        'email' => 'student1@school.com',
        'password' => 'student1',
        'role' => 'student',
        'role_id' => '',
      ]);

      Student::factory()->create([
        'firstName' => 'student',
        'lastName' => $x,
        'dateOfBirth' => '1990-12-31',
        'gender' => 'male',
        'email' => 'student'.$x.'@school.com',
        'address' =>
          'Room 1201B, 12/F, Causeway Bay Plaza I, 489 Hennessy Road, Causeway Bay, Hong Kong',
        'subject_id' => '',
        'user_id' => $user->id,
        'avatar' => 'student'.$x.'_school_com.jpg',
      ]);
    }

  }
}
