import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { BullModule } from '@nestjs/bullmq';
import { EventsProcessor } from './events.processor';
import { AggregationService } from './aggregation.service';
import { AggregatedMetric } from '../entities/aggregated-metric.entity';
import { RedisModule } from '../redis/redis.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([AggregatedMetric]),
    BullModule.registerQueue({
      name: 'analytics-events',
    }),
    RedisModule,
  ],
  providers: [EventsProcessor, AggregationService],
  exports: [AggregationService],
})
export class ProcessorsModule {}
