<?php

namespace Database\Seeders;

use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class DatabaseSeeder extends Seeder
{
    use WithoutModelEvents;

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

        User::factory()->create([
            'name' => 'Test User',
            'email' => 'test@example.com',
        ]);

        $this->call([
            ContenidoWebSeeder::class,
            ProfesionSeeder::class,
            EstadoTurnoSeeder::class,
            ModalidadSeeder::class,
            HorarioPreferenciaSeeder::class,
            DiaPreferenciaSeeder::class,
            AccionLogSeeder::class,
            FaqAsistenteSeeder::class,
            FotoSeeder::class,
            AdministradorSeeder::class,
            ServicioSeeder::class,
            BajaSeeder::class,
            DiasSeeder::class,
        ]);

        $bulkEnabled = (bool) config(
            'bulk_seed.enabled',
            filter_var(env('SEED_BULK_DATA', false), FILTER_VALIDATE_BOOLEAN)
        );

        if ($bulkEnabled) {
            $this->call(BulkDataSeeder::class);
        }
    }
}
