<?php

namespace Maestro\Core\Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Schema;
use Maestro\Core\Modules\HourRegistration\Database\Seeders\HourRegistrationSeeder;
use Maestro\Core\Support\ModuleRuntimeState;

class DatabaseSeeder extends Seeder
{
    use WithoutModelEvents;

    /**
     * Seed the application's database.
     */
    public function run(): void
    {
        $this->call([
            UserSeeder::class,
            ModuleAndNavigationSeeder::class,
        ]);

        if (
            ModuleRuntimeState::shouldRunSeeder('hours')
            && Schema::hasTable('hour_internal_categories')
        ) {
            $this->call([HourRegistrationSeeder::class]);
        }
    }
}
