diff --git a/apps/api-gateway/src/issuance/issuance.controller.ts b/apps/api-gateway/src/issuance/issuance.controller.ts index 1fd591c89..a9a0905e6 100644 --- a/apps/api-gateway/src/issuance/issuance.controller.ts +++ b/apps/api-gateway/src/issuance/issuance.controller.ts @@ -312,6 +312,7 @@ async downloadBulkIssuanceCSVTemplate( }; const importCsvDetails = await this.issueCredentialService.uploadCSVTemplate(uploadedfileDetails); + this.logger.log("importCsvDetails:", importCsvDetails); const finalResponse: IResponseType = { statusCode: HttpStatus.CREATED, message: ResponseMessages.issuance.success.importCSV, diff --git a/apps/issuance/src/issuance.service.ts b/apps/issuance/src/issuance.service.ts index 8bdc7671c..00618bd2e 100644 --- a/apps/issuance/src/issuance.service.ts +++ b/apps/issuance/src/issuance.service.ts @@ -1022,6 +1022,7 @@ async sendEmailForCredentialOffer(sendEmailCredentialOffer: SendEmailCredentialO transformheader: (header) => header.toLowerCase().replace('#', '').trim(), complete: (results) => results.data }); + this.logger.log("parsedData:", parsedData); if (0 >= parsedData.data.length) { throw new BadRequestException(ResponseMessages.bulkIssuance.error.emptyFile); @@ -1031,24 +1032,30 @@ async sendEmailForCredentialOffer(sendEmailCredentialOffer: SendEmailCredentialO throw new BadRequestException(ResponseMessages.bulkIssuance.error.emptyheader); } const invalidEmails = parsedData.data.filter((entry) => !validateEmail(entry.email_identifier)); + this.logger.log("invalidEmails:", invalidEmails); if (0 < invalidEmails.length) { throw new BadRequestException(ResponseMessages.bulkIssuance.error.invalidEmails); } const fileData: string[][] = parsedData.data.map(Object.values); const fileHeader: string[] = parsedData.meta.fields; - + this.logger.log("fileData:", fileData); + this.logger.log('fileHeader:', fileHeader); const attributesArray = JSON.parse(credentialDetails.attributes); + this.logger.log('attributesArray:', attributesArray); // Extract the 'attributeName' values from the objects and store them in an array const attributeNameArray = attributesArray.map(attribute => attribute.attributeName); + this.logger.log("attributeNameArray:", attributeNameArray); if (0 >= attributeNameArray.length) { throw new BadRequestException( `Attributes are empty for credential definition ${templateId}` ); } - await this.validateFileHeaders(fileHeader, attributeNameArray); - await this.validateFileData(fileData, attributesArray, fileHeader); + const validateFileHeaders = await this.validateFileHeaders(fileHeader, attributeNameArray); + const validateFileData = await this.validateFileData(fileData, attributesArray, fileHeader); + this.logger.log("validateFileHeaders:", validateFileHeaders); + this.logger.log("validateFileData:", validateFileData); const resData = { schemaLedgerId: credDefResponse.schemaLedgerId, @@ -1059,8 +1066,9 @@ async sendEmailForCredentialOffer(sendEmailCredentialOffer: SendEmailCredentialO const newCacheKey = uuidv4(); - await this.cacheManager.set(requestId ? requestId : newCacheKey, JSON.stringify(credentialPayload), 60000); - + const cacheManager = await this.cacheManager.set(requestId ? requestId : newCacheKey, JSON.stringify(credentialPayload), 60000); + this.logger.log("cacheManager:", cacheManager); + this.logger.log("newCacheKey:", newCacheKey); return newCacheKey; } catch (error) {