import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { JwtModule } from '@nestjs/jwt';
import {
  HashService,
  jwtConfig,
  MailService,
  DatabaseService,
  UploadService,
} from '../../config';
import { AccessControlModule } from '../access-control/access-control.module';
import { DevicesModule } from '../devices/devices.module';
import { JwtStrategy } from '../owner/strategies/jwt.strategy';
import { MembersController } from './members.controller';
import { MembersHelper } from './members.helper';
import { MembersService } from './members.service';

@Module({
  imports: [
    AccessControlModule,
    DevicesModule,
    JwtModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: jwtConfig,
    }),
  ],
  controllers: [MembersController],
  providers: [
    MembersService,
    MembersHelper,
    DatabaseService,
    HashService,
    MailService,
    UploadService,
    JwtStrategy,
  ],
})
export class MembersModule {}
