import { BullModule } from '@nestjs/bullmq';
import { Module } from '@nestjs/common';
import { TOURS_QUEUE } from 'src/modules/feat-business-objects/entities/tour/tour.tokens';
import { FeatBusinessObjectsModule } from 'src/modules/feat-business-objects/feat-business-objects.module';
import { DataAccessExtractorsModule } from '../feat-extractors/data-access-extractors.module';
import { DataAccessLoadersModule } from '../feat-loaders/data-access-loaders.module';
import { DataAccessTransformersModule } from '../feat-transformers/data-access-transformers.module';
import { ImporterService } from './importer.service';
import { SchichtplanungConsumer } from './processors/schichtplanung.consumer';
import { ToursConsumer } from './processors/tours.consumer';
import { SchichtplanungSynchronizer } from './producer/schichtplanung';
import { TourUpdateChecker } from './producer/tour-update';
import { SCHICHTPLANUNG_QUEUE } from './tokens';

@Module({
  imports: [
    FeatBusinessObjectsModule,
    DataAccessExtractorsModule,
    DataAccessTransformersModule,
    DataAccessLoadersModule,
    BullModule.registerQueue({ name: TOURS_QUEUE }),
    BullModule.registerQueue({ name: SCHICHTPLANUNG_QUEUE }),
  ],
  providers: [
    ImporterService,
    ToursConsumer,
    TourUpdateChecker,
    SchichtplanungSynchronizer,
    SchichtplanungConsumer,
  ],
  exports: [ImporterService],
})
export class FeatureImporterModule {}
