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 { ConfigurationsService } from '../configurations/configurations.service';
import { AccessControlModule } from '../access-control/access-control.module';
import { OwnerController } from './owner.controller';
import { OwnerService } from './owner.service';
import { JwtStrategy } from './strategies/jwt.strategy';

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