<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use App\Models\User;
use App\Models\Order;
use App\Models\Service;
use Illuminate\Support\Facades\Hash;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
		Service::create([
			'name' => 'Youtube Views',
			'type' => 'views',
			'site' => 'youtube',
			'available' => true,
		]);
		Service::create([
			'name' => 'Instagram Views',
			'type' => 'views',
			'site' => 'instagram',
			'available' => true,
		]);
		Service::create([
			'name' => 'Spotify Views',
			'type' => 'plays',
			'site' => 'spotify',
			'available' => true,
		]);
		Service::create([
			'name' => 'Twitter Likes',
			'type' => 'likes',
			'site' => 'spotify',
			'available' => false,
		]);
		 User::create([
			'name' => 'test_user_unverified',
			'email' => 'unverified@example.com',
			'role' => 'client',
			'active' => true,
			'password' => Hash::make("test123")
		]);
		$test_user = User::create([
			'name' => 'test_user_verified',
			'email' => 'verified@example.com',
			'email_verified_at' => now(),
			'credits' => 250,
			'role' => 'client',
			'active' => true,
			'password' => Hash::make("test123")
		]);
		User::create([
			'name' => 'test_admin_verified',
			'email' => 'admin_verified@example.com',
			'email_verified_at' => now(),
			'role' => 'admin',
			'active' => true,
			'password' => Hash::make("test123")
		]);

		Order::factory()->count(15)->for($test_user)->create();
		Order::factory()->count(25)->create();
    }
}
