import { Module, forwardRef } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { FeishuController } from './feishu.controller';
import { FeishuService } from './feishu.service';
import { FeishuBot } from './entities/feishu-bot.entity';
import { FeishuAssessmentSession } from './entities/feishu-assessment-session.entity';
import { FeishuWsManager } from './feishu-ws.manager';
import { FeishuAssessmentService } from './services/feishu-assessment.service';
import { AssessmentCommandParser } from './services/assessment-command.parser';
import { ChatModule } from '../chat/chat.module';
import { UserModule } from '../user/user.module';
import { ModelConfigModule } from '../model-config/model-config.module';
import { AssessmentModule } from '../assessment/assessment.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([FeishuBot, FeishuAssessmentSession]),
    forwardRef(() => ChatModule),
    forwardRef(() => UserModule),
    forwardRef(() => ModelConfigModule),
    forwardRef(() => AssessmentModule),
  ],
  controllers: [FeishuController],
  providers: [
    FeishuService,
    FeishuWsManager,
    FeishuAssessmentService,
    AssessmentCommandParser,
  ],
  exports: [FeishuService, FeishuAssessmentService, TypeOrmModule],
})
export class FeishuModule {}
