import { Module, forwardRef } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import { PaymentsController } from './payments.controller';
import { PaymentsService } from './payments.service';
import { WebhookService } from './webhook.service';
import { Payment } from './entities/payment.entity';
import { Invoice } from './entities/invoice.entity';
import { CouponModule } from '../coupons/coupon.module';
import { WalletModule } from '../wallet/wallet.module';

import { InvoiceIssuer } from '../invoice_issuers/entities/invoice_issuer.entity';
import { InvoiceTemplate } from '../invoice_templates/entities/invoice_template.entity';

@Module({
  imports: [
    TypeOrmModule.forFeature([
      Payment,
      Invoice,
      InvoiceIssuer,
      InvoiceTemplate,
    ]),
    CouponModule,
    forwardRef(() => WalletModule),
  ],
  controllers: [PaymentsController],
  providers: [PaymentsService, WebhookService],
  exports: [PaymentsService],
})
export class PaymentsModule {}
