import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { CacheModule } from '@nestjs/cache-manager';
import { ReportsHistoryController } from './reports_history.controller';
import { ReportsHistoryService } from './reports_history.service';
import { ReportsHistory } from './entities/reports_history.entity';
import { Franchises } from '../franchises/entities/franchises.entity';
import { AnalyticsModule } from '../analytics/analytics.module';
import { EmailModule } from '../email/email.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([ReportsHistory, Franchises]),
    AnalyticsModule,
    CacheModule.register({
      ttl: 300000, // 5 minutes
      max: 100, // maximum number of items in cache
    }),
    EmailModule,
  ],
  controllers: [ReportsHistoryController],
  providers: [ReportsHistoryService],
  exports: [ReportsHistoryService],
})
export class ReportsHistoryModule {}
