<?php

namespace Database\Seeders;

use App\Models\Group;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        \App\Models\User::factory(10)->create();
        \App\Models\User::factory()->create(['email' => 'admin@exchange.gov.tm']);
        \App\Models\Category::factory(5)->create();
        \App\Models\Group::factory(6)->create();

        Group::all()->each(function ($group) {
            if ($group->type === 'import') {
                \App\Models\Import::factory(1000)->create(['group_id' => $group->id]);
            } else {
                \App\Models\Export::factory(1000)->create(['group_id' => $group->id]);
            }
        });
    }
}
