import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { JwtModule } from '@nestjs/jwt';
import { jwtConfig, DatabaseService, UploadService } from '../../config';
import { AccessControlModule } from '../access-control/access-control.module';
import { JwtStrategy } from '../owner/strategies/jwt.strategy';
import { ConfigurationsController } from './configurations.controller';
import { ConfigurationsService } from './configurations.service';

@Module({
  imports: [
    AccessControlModule,
    JwtModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: jwtConfig,
    }),
  ],
  controllers: [ConfigurationsController],
  providers: [ConfigurationsService, DatabaseService, UploadService, JwtStrategy],
})
export class ConfigurationsModule {}
