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

// ORM Entities
import { DailyStatisticsORM } from './infrastructure/database/postgres/entities/daily-statistics.orm';
import { MonthlyFinancialReportORM } from './infrastructure/database/postgres/entities/monthly-financial-report.orm';
import { AuditLogORM } from './infrastructure/database/postgres/entities/audit-log.orm';

// Services
import { StatisticsAggregationService } from './application/services/statistics-aggregation.service';
import { FinancialReportService } from './application/services/financial-report.service';
import { AuditLogService } from './application/services/audit-log.service';
import { AnalyticsSchedulerService } from './infrastructure/scheduling/analytics-scheduler.service';

// Controllers
import { AnalyticsController } from './adapters/inbound/analytics.controller';
import { AuditController } from './adapters/inbound/audit.controller';

// External dependencies
import { AdminModule } from '../admin/admin.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      DailyStatisticsORM,
      MonthlyFinancialReportORM,
      AuditLogORM,
    ]),
    AdminModule,
  ],
  controllers: [
    AnalyticsController,
    AuditController,
  ],
  providers: [
    StatisticsAggregationService,
    FinancialReportService,
    AuditLogService,
    AnalyticsSchedulerService,
  ],
  exports: [
    StatisticsAggregationService,
    FinancialReportService,
    AuditLogService,
    AnalyticsSchedulerService,
  ],
})
export class AnalyticsModule {}
