import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { Settlement } from '@/entities/settlement.entity';
import { SettlementItem } from '@/entities/settlement-item.entity';
import { UserWithdrawal } from '@/entities/user-withdrawal.entity';
import { MerchantWithdrawal } from '@/entities/merchant-withdrawal.entity';
import { PlatformWithdrawal } from '@/entities/platform-withdrawal.entity';
import { UserAccount } from '@/entities/user-account.entity';
import { MerchantAccount } from '@/entities/merchant-account.entity';
import { PlatformAccount } from '@/entities/platform-account.entity';
import { UserTransaction } from '@/entities/user-transaction.entity';
import { MerchantTransaction } from '@/entities/merchant-transaction.entity';
import { PlatformTransaction } from '@/entities/platform-transaction.entity';
import { DailyReconciliation } from '@/entities/daily-reconciliation.entity';
import { PlatformConfig } from '@/entities/platform-config.entity';
import { Merchant } from '@/entities/merchant.entity';
import { Order } from '@/entities/order.entity';
import { SettlementService } from './settlement.service';
import { WithdrawalService } from './withdrawal.service';
import { AccountService } from './account.service';
import { TransactionService } from './transaction.service';
import { ReconciliationService } from './reconciliation.service';
import { ReportService } from './report.service';
import { RefundService } from './refund.service';
import { BankCardService } from './bank-card.service';
import { MerchantModule } from '@/modules/merchant/merchant.module';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      Settlement,
      SettlementItem,
      UserWithdrawal,
      MerchantWithdrawal,
      PlatformWithdrawal,
      UserAccount,
      MerchantAccount,
      PlatformAccount,
      UserTransaction,
      MerchantTransaction,
      PlatformTransaction,
      DailyReconciliation,
      PlatformConfig,
      Merchant,
      Order,
    ]),
    MerchantModule,
  ],
  providers: [
    SettlementService,
    WithdrawalService,
    AccountService,
    TransactionService,
    ReconciliationService,
    ReportService,
    RefundService,
    BankCardService,
  ],
  exports: [
    SettlementService,
    WithdrawalService,
    AccountService,
    TransactionService,
    ReconciliationService,
    ReportService,
    RefundService,
    BankCardService,
    TypeOrmModule,
  ],
})
export class FinanceModule {}
