import { Module } from '@nestjs/common';
import { AnalyticsService } from './services/analytics.service';
import { AnalyticsController } from './controllers/analytics.controller';
import { MetaAdsModule } from '../meta-ads/meta-ads.module';
import { TikTokAdsModule } from '../tiktok-ads/tiktok-ads.module';
import { GoogleAdsModule } from '../google-ads/google-ads.module';
import { UsersModule } from '../users/users.module';
import { AiService } from './services/ai.service';
import { TikTokAdsService } from '../tiktok-ads/services/tiktok-ads.service';
import { GoogleAdsService } from '../google-ads/services/google-ads.service';

import { TypeOrmModule } from '@nestjs/typeorm';
import { AIAnalysis } from './entities/ai-analysis.entity';

/**
 * Analytics Module
 * وحدة التحليلات
 * 
 * Why: Orchestrates data from various sources (Meta, etc.) and runs analytical logic.
 * لماذا: ينسق البيانات من مصادر مختلفة (ميتـا، إلخ) ويجري منطق التحليل.
 */
@Module({
  imports: [
    TypeOrmModule.forFeature([AIAnalysis]),
    MetaAdsModule, 
    TikTokAdsModule, 
    GoogleAdsModule, 
    UsersModule
  ], // Support multi-platform
  providers: [AnalyticsService, AiService],
  controllers: [AnalyticsController],
  exports: [AnalyticsService, AiService],
})
export class AnalyticsModule {}
