import { Module } from '@nestjs/common';
import { ScheduleModule } from '@nestjs/schedule';
import { TypeOrmModule } from '@nestjs/typeorm';

import { KYCReviewReminderCron } from './kyc-review-reminder.cron';
import { PayoutSchedulerCron } from './payout-scheduler.cron';
import { StreamCleanupCron } from './stream-cleanup.cron';
import { AnalyticsAggregatorCron } from './analytics-aggregator.cron';

import { KYCVerification } from '../modules/kyc/entities/kyc-verification.entity';
import { KYCDocument } from '../modules/kyc/entities/kyc-document.entity';
import { Payout } from '../modules/payments/entities/payout.entity';
import { Stream } from '../modules/streams/entities/stream.entity';
import { Transaction } from '../modules/payments/entities/transaction.entity';
import { SalesMetric } from '../modules/analytics/entities/sales-metric.entity';
import { StreamMetric } from '../modules/analytics/entities/stream-metric.entity';

@Module({
  imports: [
    ScheduleModule.forRoot(),
    TypeOrmModule.forFeature([
      KYCVerification,
      KYCDocument,
      Payout,
      Stream,
      Transaction,
      SalesMetric,
      StreamMetric,
    ]),
  ],
  providers: [
    KYCReviewReminderCron,
    PayoutSchedulerCron,
    StreamCleanupCron,
    AnalyticsAggregatorCron,
  ],
})
export class JobsModule {}