import { forwardRef, HttpModule, Module } from '@nestjs/common';
import { MulterModule } from '@nestjs/platform-express';
import { ScheduleModule } from '@nestjs/schedule';
import { AppModule } from '../app.module';
import { SharedModule } from '../shared/shared.module';
import { AttachmentController } from './attachment.controller';
import { OldTemporaryAttachmentDeleteCron } from './cron/old-temporary-attachment-delete/old-temporary-attachment-delete.cron';
import { RemoveNotAllowedAttachmentsCron } from './cron/remove-not-allowed-attachments/remove-not-allowed-attachments.cron';
import { S3Service } from './services/s3/s3.service';
import { RemoveAttachmentWorkflow } from './workflows/remove-attachment/remove-attachment.workflow';
import { StreamAttachmentUploadWorkflow } from './workflows/stream-attachment-upload/stream-attachment-upload.workflow';
import { StreamAttachmentWorkflow } from './workflows/stream-attachment/stream-attachment.workflow';

@Module({
  imports: [
    HttpModule,
    MulterModule.register({
      limits: {
        fileSize: 1e10,
      },
    }),
    ScheduleModule,
    SharedModule,
    forwardRef(() => AppModule),
  ],
  controllers: [AttachmentController],
  providers: [
    S3Service,
    StreamAttachmentWorkflow,
    StreamAttachmentUploadWorkflow,
    RemoveAttachmentWorkflow,
    OldTemporaryAttachmentDeleteCron,
    RemoveNotAllowedAttachmentsCron,
  ],
})
export class AttachmentModule {}
