<?php

namespace Database\Seeders;

use Illuminate\Database\Seeder;
use Database\Seeders\BranchSeeder;
use Database\Seeders\UploadSeeder;
use Illuminate\Support\Facades\DB;
use Database\Seeders\SettingsSeeder;
use Database\Seeders\Admin\RoleSeeder;
use Database\Seeders\Admin\UserSeeder;
use Database\Seeders\Admin\StatusSeeder;
use Database\Seeders\DutyScheduleSeeder;
use Database\Seeders\WeekendSetupSeeder;
use Database\Seeders\Admin\CompanySeeder;
use Database\Seeders\CompanyConfigSeeder;
use Database\Seeders\Admin\PermissionSeeder;
use Database\Seeders\AllContentsTableSeeder;
use Database\Seeders\Admin\SubscriptionSeeder;
use Database\Seeders\Hrm\Country\CountrySeeder;
use Database\Seeders\Traits\ApplicationKeyGenerate;
use Database\Seeders\Hrm\AppSetting\AppScreenSeeder;
use Database\Seeders\Hospital\HospitalDatabaseSeeder;
use Modules\Break\Database\Seeders\BreakDatabaseSeeder;
use Modules\Tardy\Database\Seeders\TardyDatabaseSeeder;
use Modules\AutoAttendance\Database\Seeders\AutoAttendanceDatabaseSeeder;
use Modules\SpecialAttendance\Database\Seeders\SpecialAttendanceDatabaseSeeder;

class RegularSeeder extends Seeder
{
    use ApplicationKeyGenerate;

    /**
     * Seed the application's database.
     *
     * @return void
     */
    public function run()
    {
        DB::statement('SET FOREIGN_KEY_CHECKS=0');

        $this->call(CountrySeeder::class);
        $this->call(StatusSeeder::class);
        $this->call(CompanySeeder::class);
        $this->call(BranchSeeder::class);
        $this->call(RoleSeeder::class);
        $this->call(PermissionSeeder::class);
        $this->call(HospitalDatabaseSeeder::class);
        $this->call(UserSeeder::class);
        $this->call(SettingsSeeder::class);
        $this->call(UploadSeeder::class);
        $this->call(CompanyConfigSeeder::class);
        $this->call(SubscriptionSeeder::class);
        $this->call(DutyScheduleSeeder::class);
        $this->call(WeekendSetupSeeder::class);
        $this->call(AllContentsTableSeeder::class);
        $this->call(AppScreenSeeder::class);
        $this->call(BrandingSeeder::class);

        if (isModuleActive('Break')) {
            $this->call(BreakDatabaseSeeder::class);
        }

        if (isModuleActive('SpecialAttendance')) {
            $this->call(SpecialAttendanceDatabaseSeeder::class);
        }

        if (isModuleActive('AutoAttendance')) {
            $this->call(AutoAttendanceDatabaseSeeder::class);
        }

        if (isModuleActive('Tardy')) {
            $this->call(TardyDatabaseSeeder::class);
        }
    }
}
