import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { CharactersController } from './characters.controller';
import { CharactersService } from './characters.service';
import { CharactersGateway } from './characters.gateway';
import { PathbuilderImportService } from './pathbuilder-import.service';
import { AlchemyController } from './alchemy.controller';
import { AlchemyService } from './alchemy.service';
import { TranslationsModule } from '../translations/translations.module';

@Module({
  imports: [
    TranslationsModule,
    JwtModule.registerAsync({
      imports: [ConfigModule],
      useFactory: async (configService: ConfigService) => ({
        secret: configService.get<string>('JWT_SECRET'),
      }),
      inject: [ConfigService],
    }),
  ],
  controllers: [CharactersController, AlchemyController],
  providers: [CharactersService, CharactersGateway, PathbuilderImportService, AlchemyService],
  exports: [CharactersService, CharactersGateway, PathbuilderImportService, AlchemyService],
})
export class CharactersModule {}
