From a07b3e391b78d6553c061d69005e851f0c851ca4 Mon Sep 17 00:00:00 2001 From: Tom Winter Date: Fri, 16 Feb 2024 10:40:32 +0100 Subject: [PATCH] fix: add missing provider configuration for CouchSqsClient and CouchDbClient (#24) --- src/report/report.module.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/report/report.module.ts b/src/report/report.module.ts index b916f34..190f795 100644 --- a/src/report/report.module.ts +++ b/src/report/report.module.ts @@ -1,15 +1,18 @@ import { Module } from '@nestjs/common'; import { DefaultReportStorage } from './storage/report-storage.service'; import { ReportController } from './controller/report.controller'; -import { HttpModule } from '@nestjs/axios'; +import { HttpModule, HttpService } from '@nestjs/axios'; import { ReportRepository } from './repository/report-repository.service'; import { ReportCalculationRepository } from './repository/report-calculation-repository.service'; import { ReportCalculationController } from './controller/report-calculation.controller'; import { ReportCalculationTask } from './tasks/report-calculation-task.service'; import { ReportCalculationProcessor } from './tasks/report-calculation-processor.service'; import { SqsReportCalculator } from './core/sqs-report-calculator.service'; -import { CouchDbClient } from '../couchdb/couch-db-client.service'; import { CreateReportCalculationUseCase } from './core/use-cases/create-report-calculation-use-case.service'; +import { CouchSqsClient } from '../couchdb/couch-sqs.client'; +import { CouchSqsClientFactory } from './di/couchdb-sqs-configuration'; +import { ConfigService } from '@nestjs/config'; +import { CouchDbClient } from '../couchdb/couch-db-client.service'; @Module({ controllers: [ReportController, ReportCalculationController], @@ -22,6 +25,11 @@ import { CreateReportCalculationUseCase } from './core/use-cases/create-report-c ReportCalculationProcessor, SqsReportCalculator, CouchDbClient, + { + provide: CouchSqsClient, + useFactory: CouchSqsClientFactory, + inject: [HttpService, ConfigService], + }, CreateReportCalculationUseCase, ], exports: [DefaultReportStorage, CreateReportCalculationUseCase],