<?php

declare(strict_types=1);

/** @maestro-core-managed — reset via `php artisan core:install --force` */

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Schema;
use Maestro\Core\Database\Seeders\ModuleAndNavigationSeeder;
use Maestro\Core\Database\Seeders\UserSeeder;
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]);
        }

        if (class_exists(CustomDatabaseSeeder::class)) {
            $this->call(CustomDatabaseSeeder::class);
        }
    }
}
