<?php

namespace Database\Seeders;

use App\Models\Banner;
use App\Models\Category;
use App\Models\Chapter;
use App\Models\Course;
use App\Models\Lecture;
use App\Models\Review;
use App\Models\Unit;
use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        // User::factory(10)->create();

        // User::factory()->create([
        //     'name' => 'Test User',
        //     'email' => 'test@example.com',
        // ]);
        User::create([
            'name' => 'Test User',
            'password' => Hash::make(123456),
            'phone' => '+201234567891',
            'allow_any_device' => 1,
            'allow_notifications' => 1,
            'notification_id' => 123456,
            'img' => '/admin/img/doctorito-logo.png',
        ]);

        Category::create([
            'name' => 'Medical',
            'display_order' => 1,
            'img' => '/admin/img/doctorito-logo.png',
        ]);
        Category::create([
            'name' => 'test category',
            'display_order' => 2,
            'img' => '/admin/img/doctorito-logo.png',
        ]);
        Course::create([
            'title' => 'Anatomy',
            'description' => 'Anatomy is the branch of biology concerned with the study of the structure of organisms and their parts.',
            'price' => 26,
            'img' => '/admin/img/doctorito-logo.png',
            'popular' => true,
            'category_id' => 1,
        ]);
        Course::create([
            'title' => 'Medical Terminology',
            'description' => 'Medical terminology is a system of words used to describe the human body, its components, processes, conditions affecting it, and procedures performed upon it.',
            'price' => 17,
            'img' => '/admin/img/doctorito-logo.png',
            'popular' => true,
            'category_id' => 1,
        ]);
        Course::create([
            'title' => 'test course',
            'description' => 'This is a test course for demonstration purposes.',
            'price' => 30,
            'img' => '/admin/img/doctorito-logo.png',
            'popular' => false,
            'category_id' => 2,
        ]);
        Chapter::create([
            'title' => 'Anatomy structure and medical instructions',
            'category_id' => 1,
            'course_id' => 1,
        ]);
        Chapter::create([
            'title' => 'The Chemical Level of Organization',
            'category_id' => 1,
            'course_id' => 1,
        ]);
        Chapter::create([
            'title' => 'The Cellular Level of Organization',
            'category_id' => 1,
            'course_id' => 1,
        ]);
        Chapter::create([
            'title' => 'test chapter',
            'category_id' => 2,
            'course_id' => 3,
        ]);
        Unit::create([
            'title' => 'Introduction',
            'chapter_id' => 1,
            'course_id' => 1,
            'category_id' => 1,
        ]);
        Unit::create([
            'title' => 'How Structure Determines Function',
            'chapter_id' => 2,
            'course_id' => 1,
            'category_id' => 1,
        ]);
        Unit::create([
            'title' => 'Structural Organization of the Human Body',
            'chapter_id' => 2,
            'course_id' => 1,
            'category_id' => 1,
        ]);
        Unit::create([
            'title' => 'test unit',
            'chapter_id' => 4,
            'course_id' => 3,
            'category_id' => 2,
        ]);
        Lecture::create([
            'title' => 'What is Human Anatomy?',
            'description' => 'Human anatomy, including histology and gross anatomy, is the study of the structures of the human body. The discipline of human anatomy involves the identification and description of the structures within the human body.',
            'video_id' => 'MEX_r7-CGSs',
            'file' => 'anatomy_lecture_1.mp4',
            'category_id' => 1,
            'course_id' => 1,
            'chapter_id' => 1,
            'unit_id' => 1,
        ]);
        Lecture::create([
            'title' => 'Gross anatomy',
            'description' => 'The study of the larger structures of the body.',
            'video_id' => '2w_n2F2YA7Q',
            'file' => 'anatomy_lecture_2.mp4',
            'category_id' => 1,
            'course_id' => 1,
            'chapter_id' => 1,
            'unit_id' => 1,
        ]);
        Lecture::create([
            'title' => 'test lecture',
            'description' => 'This is a test lecture for demonstration purposes.',
            'video_id' => 'HJK-VpZLW6w',
            'file' => 'anatomy_lecture_2.mp4',
            'category_id' => 2,
            'course_id' => 3,
            'chapter_id' => 4,
            'unit_id' => 4,
        ]);
        Banner::create([
            'type' => 'course',
            'course_id' => 1,
            'lecture_id' => null,
            'order' => 1,
            'img' => '/admin/img/doctorito-logo.png',
        ]);
        Banner::create([
            'type' => 'lecture',
            'course_id' => 1,
            'lecture_id' => 1,
            'order' => 2,
            'img' => '/admin/img/doctorito-logo.png',
        ]);
        Banner::create([
            'type' => 'empty',
            'course_id' => null,
            'lecture_id' => null,
            'order' => 3,
            'img' => '/admin/img/doctorito-logo.png',
        ]);
    }
}
