import { Module } from "@nestjs/common";
import { APP_GUARD } from "@nestjs/core";
import { TextbooksModule } from "./textbooks/textbooks.module.js";
import { ChaptersModule } from "./chapters/chapters.module.js";
import { KnowledgePointsModule } from "./knowledge-points/knowledge-points.module.js";
import { QuestionsModule } from "./questions/questions.module.js";
import { HealthModule } from "./shared/health/health.module.js";
import { PermissionGuard } from "./middleware/permission.guard.js";
import { LifecycleService } from "./shared/lifecycle/lifecycle.service.js";

@Module({
  imports: [
    TextbooksModule,
    ChaptersModule,
    KnowledgePointsModule,
    QuestionsModule,
    HealthModule,
  ],
  providers: [
    { provide: APP_GUARD, useClass: PermissionGuard },
    LifecycleService,
  ],
})
export class AppModule {}
