import { Module } from "@nestjs/common";
import { ConfigModule } from "@nestjs/config";
import { QueueModule } from "@bff/core/queue/queue.module";
import { WhmcsCacheService } from "./cache/whmcs-cache.service";
import { WhmcsService } from "./whmcs.service";
import { WhmcsInvoiceService } from "./services/whmcs-invoice.service";
import { WhmcsSubscriptionService } from "./services/whmcs-subscription.service";
import { WhmcsClientService } from "./services/whmcs-client.service";
import { WhmcsPaymentService } from "./services/whmcs-payment.service";
import { WhmcsSsoService } from "./services/whmcs-sso.service";
import { WhmcsOrderService } from "./services/whmcs-order.service";
import { WhmcsCurrencyService } from "./services/whmcs-currency.service";
// Connection services
import { WhmcsConnectionOrchestratorService } from "./connection/services/whmcs-connection-orchestrator.service";
import { WhmcsConfigService } from "./connection/config/whmcs-config.service";
import { WhmcsHttpClientService } from "./connection/services/whmcs-http-client.service";
import { WhmcsErrorHandlerService } from "./connection/services/whmcs-error-handler.service";
import { WhmcsApiMethodsService } from "./connection/services/whmcs-api-methods.service";

@Module({
  imports: [ConfigModule, QueueModule],
  providers: [
    // Connection services
    WhmcsConnectionOrchestratorService,
    WhmcsConfigService,
    WhmcsHttpClientService,
    WhmcsErrorHandlerService,
    WhmcsApiMethodsService,
    // Core services
    WhmcsCacheService,
    WhmcsInvoiceService,
    WhmcsSubscriptionService,
    WhmcsClientService,
    WhmcsPaymentService,
    WhmcsSsoService,
    WhmcsOrderService,
    WhmcsCurrencyService,
    WhmcsService,
  ],
  exports: [
    WhmcsService,
    WhmcsConnectionOrchestratorService,
    WhmcsCacheService,
    WhmcsOrderService,
    WhmcsPaymentService,
    WhmcsCurrencyService,
  ],
})
export class WhmcsModule {}
