import { Module } from '@nestjs/common';
import { ConfigModule, ConfigService } from '@nestjs/config';
import { JwtModule } from '@nestjs/jwt';
import { DatabaseService, jwtConfig, UploadService } from '../../config';
import { AccessControlModule } from '../access-control/access-control.module';
import { NotificationGateway } from '../../notification.socket';
import { NotificationsService } from '../notifications/notifications.service';
import { JwtStrategy } from '../owner/strategies/jwt.strategy';
import { LeavesController } from './leaves.controller';
import { LeavesService } from './leaves.service';

@Module({
  imports: [
    AccessControlModule,
    JwtModule.registerAsync({
      imports: [ConfigModule],
      inject: [ConfigService],
      useFactory: jwtConfig,
    }),
  ],
  controllers: [LeavesController],
  providers: [
    LeavesService,
    DatabaseService,
    UploadService,
    JwtStrategy,
    NotificationGateway,
    NotificationsService,
  ],
})
export class LeavesModule {}
