import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { AuditModule } from '../audit/audit.module';
import { CommentsModule } from '../comments/comments.module';
import { Comment, CommentSchema } from '../comments/schemas/comment.schema';
import { Instrument, InstrumentSchema } from '../marketplace/schemas/instrument.schema';
import { RepairShop, RepairShopSchema } from '../marketplace/schemas/repair-shop.schema';
import { Notification, NotificationSchema } from '../notifications/schemas/notification.schema';
import { PostsModule } from '../posts/posts.module';
import { Post, PostSchema } from '../posts/schemas/post.schema';
import { UsersModule } from '../users/users.module';
import { User, UserSchema } from '../users/schemas/user.schema';
import { AuditLog, AuditLogSchema } from '../audit/schemas/audit-log.schema';
import { SuperAdminController } from './superadmin.controller';
import { SuperAdminService } from './superadmin.service';
import {
  SuperAdminSettings,
  SuperAdminSettingsSchema,
} from './schemas/superadmin-settings.schema';
import {
  SuperAdminSettingsHistory,
  SuperAdminSettingsHistorySchema,
} from './schemas/superadmin-settings-history.schema';
import { SuperAdminCase, SuperAdminCaseSchema } from './schemas/superadmin-case.schema';
import { OutboxEvent, OutboxEventSchema } from '../outbox/schemas/outbox-event.schema';
import {
  SuperAdminRefreshToken,
  SuperAdminRefreshTokenSchema,
} from '../auth/schemas/super-admin-refresh-token.schema';

@Module({
  imports: [
    MongooseModule.forFeature([
      { name: User.name, schema: UserSchema },
      { name: Post.name, schema: PostSchema },
      { name: Comment.name, schema: CommentSchema },
      { name: Instrument.name, schema: InstrumentSchema },
      { name: RepairShop.name, schema: RepairShopSchema },
      { name: Notification.name, schema: NotificationSchema },
      { name: AuditLog.name, schema: AuditLogSchema },
      { name: SuperAdminSettings.name, schema: SuperAdminSettingsSchema },
      { name: SuperAdminSettingsHistory.name, schema: SuperAdminSettingsHistorySchema },
      { name: SuperAdminCase.name, schema: SuperAdminCaseSchema },
      { name: OutboxEvent.name, schema: OutboxEventSchema },
      { name: SuperAdminRefreshToken.name, schema: SuperAdminRefreshTokenSchema },
    ]),
    AuditModule,
    PostsModule,
    CommentsModule,
    UsersModule,
  ],
  controllers: [SuperAdminController],
  providers: [SuperAdminService],
  exports: [SuperAdminService],
})
export class SuperAdminModule {}
