ref: https://docs.nestjs.com/fundamentals/circular-dependency
Here I have 2 services that import/inject each other: TransactionsService and FundsService
So to able to use both one service in the other, I have to using forwardRef inject.
export class TransactionsService {
constructor(
@Inject(forwardRef(() => FundsService))
private fundService: FundsService
) {}
}
export class FundsService {
constructor(
@Inject(forwardRef(() => TransactionsService))
private transService: TransactionsService
) {}
}