import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { BullModule } from '@nestjs/bullmq';
import { RawEvent } from '../entities/raw-event.entity';
import { SessionFingerprint } from '../entities/session-fingerprint.entity';
import { Corp } from '../entities/corp.entity';
import { Domain } from '../entities/domain.entity';
import { VisitorSalt } from '../entities/visitor-salt.entity';
import { TrackingService } from './tracking.service';
import { TrackingController } from './tracking.controller';
import { DeviceEnrichmentService } from './device-enrichment.service';
import { AttributionService } from './attribution.service';
import { GovDetectionService } from './gov-detection.service';
import { IdentityService } from './identity.service';
import { DomainResolverService } from './domain-resolver.service';

@Module({
  imports: [
    TypeOrmModule.forFeature([RawEvent, SessionFingerprint, Corp, Domain, VisitorSalt]),
    BullModule.registerQueue({
      name: 'analytics-events',
    }),
  ],
  controllers: [TrackingController],
  providers: [
    TrackingService,
    DeviceEnrichmentService,
    AttributionService,
    GovDetectionService,
    IdentityService,
    DomainResolverService,
  ],
  exports: [TrackingService, IdentityService, DomainResolverService],
})
export class TrackingModule {}
