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

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