fix: cycle dependecy

This commit is contained in:
Ahmed Bouhuolia
2025-06-27 02:18:01 +02:00
parent 0c0e1dc22e
commit 0ca98c7ae4
3 changed files with 13 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
import { Module } from '@nestjs/common';
import { forwardRef, Module } from '@nestjs/common';
import { CreateInvoiceCheckoutSession } from './CreateInvoiceCheckoutSession';
import { GetPaymentLinkInvoicePdf } from './GetPaymentLinkInvoicePdf';
import { PaymentLinksApplication } from './PaymentLinksApplication';
@@ -13,7 +13,10 @@ import { TenancyContext } from '../Tenancy/TenancyContext.service';
const models = [InjectSystemModel(PaymentLink)];
@Module({
imports: [StripePaymentModule, SaleInvoicesModule],
imports: [
forwardRef(() => StripePaymentModule),
forwardRef(() => SaleInvoicesModule),
],
providers: [
...models,
TenancyContext,

View File

@@ -58,6 +58,7 @@ import { PaymentsReceivedModule } from '../PaymentReceived/PaymentsReceived.modu
import { SaleInvoicesCost } from './SalesInvoicesCost';
import { SaleInvoicesExportable } from './commands/SaleInvoicesExportable';
import { SaleInvoicesImportable } from './commands/SaleInvoicesImportable';
import { PaymentLinksModule } from '../PaymentLinks/PaymentLinks.module';
@Module({
imports: [
@@ -74,6 +75,7 @@ import { SaleInvoicesImportable } from './commands/SaleInvoicesImportable';
MailModule,
MailNotificationModule,
forwardRef(() => InventoryCostModule),
forwardRef(() => PaymentLinksModule),
DynamicListModule,
BullModule.registerQueue({ name: SendSaleInvoiceQueue }),
],

View File

@@ -1,4 +1,4 @@
import { Module } from '@nestjs/common';
import { forwardRef, Module } from '@nestjs/common';
import { CreateStripeAccountLinkService } from './CreateStripeAccountLink';
import { CreateStripeAccountService } from './CreateStripeAccountService';
import { StripePaymentApplication } from './StripePaymentApplication';
@@ -19,7 +19,11 @@ import { TenancyContext } from '../Tenancy/TenancyContext.service';
const models = [InjectSystemModel(PaymentIntegration)];
@Module({
imports: [AccountsModule, SaleInvoicesModule, PaymentsReceivedModule],
imports: [
AccountsModule,
PaymentsReceivedModule,
forwardRef(() => SaleInvoicesModule),
],
providers: [
...models,
StripePaymentService,