From f0e19c2daf2b5a75e8efaea678d40f7eb394f92c Mon Sep 17 00:00:00 2001 From: KulkarniShashank Date: Mon, 6 Nov 2023 18:02:05 +0530 Subject: [PATCH] Added the logs for the csv upload file Signed-off-by: KulkarniShashank --- apps/issuance/src/issuance.controller.ts | 11 ++++++----- apps/issuance/src/issuance.service.ts | 5 ++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/apps/issuance/src/issuance.controller.ts b/apps/issuance/src/issuance.controller.ts index 03594a208..7b08dbf74 100644 --- a/apps/issuance/src/issuance.controller.ts +++ b/apps/issuance/src/issuance.controller.ts @@ -55,19 +55,20 @@ export class IssuanceController { async importCSV(payload: { importFileDetails: ImportFileDetails }): Promise { - return this.issuanceService.importAndPreviewDataForIssuance(payload.importFileDetails); + this.logger.log(`payload.importFileDetails----${payload.importFileDetails}`); + return this.issuanceService.importAndPreviewDataForIssuance(payload.importFileDetails); } @MessagePattern({ cmd: 'preview-csv-details' }) - async previewCSVDetails(payload: {requestId:string, previewFileDetails:PreviewRequest}): Promise { + async previewCSVDetails(payload: { requestId: string, previewFileDetails: PreviewRequest }): Promise { return this.issuanceService.previewFileDataForIssuance( - payload.requestId, + payload.requestId, payload.previewFileDetails - ); + ); } @MessagePattern({ cmd: 'issue-bulk-credentials' }) - async issueBulkCredentials(payload: {requestId:string, orgId:number }): Promise { + async issueBulkCredentials(payload: { requestId: string, orgId: number }): Promise { return this.issuanceService.issueBulkCredential(payload.requestId, payload.orgId); } } diff --git a/apps/issuance/src/issuance.service.ts b/apps/issuance/src/issuance.service.ts index 9547301e1..635ac48f3 100644 --- a/apps/issuance/src/issuance.service.ts +++ b/apps/issuance/src/issuance.service.ts @@ -511,11 +511,13 @@ export class IssuanceService { async importAndPreviewDataForIssuance(importFileDetails: ImportFileDetails): Promise { - this.logger.log(`START importAndPreviewDataForIssuance`, importFileDetails); + this.logger.log(`START importAndPreviewDataForIssuance----${JSON.stringify(importFileDetails)}`); try { + const credDefResponse = await this.issuanceRepository.getCredentialDefinitionDetails(importFileDetails.credDefId); + this.logger.log(`credDefResponse----${JSON.stringify(credDefResponse)}`); const csvFile = readFileSync(importFileDetails.filePath); const csvData = csvFile.toString(); @@ -526,6 +528,7 @@ export class IssuanceService { complete: (results) => results.data }); + this.logger.log(`parsedData----${JSON.stringify(parsedData)}`); if (0 >= parsedData.data.length) { throw new BadRequestException(`File data is empty`);