import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { JwtModule } from '@nestjs/jwt';
import {
  DatabaseService,
  HashService,
  jwtConfig,
  MailService,
} from '../../config';
import { AccessControlModule } from '../access-control/access-control.module';
import { OnboardingModule } from '../onboarding/onboarding.module';
import { NotificationGateway } from '../../notification.socket';
import { NotificationsService } from '../notifications/notifications.service';
import { JwtStrategy } from '../owner/strategies/jwt.strategy';
import { ApiKeyGuard } from './api-key.guard';
import { PublicRecruitmentController } from './public-recruitment.controller';
import { RecruitmentController } from './recruitment.controller';
import { RecruitmentService } from './recruitment.service';

@Module({
  imports: [
    AccessControlModule,
    OnboardingModule,
    JwtModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: jwtConfig,
    }),
  ],
  controllers: [RecruitmentController, PublicRecruitmentController],
  providers: [
    RecruitmentService,
    ApiKeyGuard,
    DatabaseService,
    HashService,
    MailService,
    JwtStrategy,
    NotificationGateway,
    NotificationsService,
  ],
})
export class RecruitmentModule {}
