From 37688c78e4f11365555b80224fb56c53449b2ef7 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Thu, 4 Apr 2024 16:10:24 +0530 Subject: [PATCH 1/6] feat: multiselect connections while issuance Signed-off-by: bhavanakarwade --- .../src/issuance/dtos/issuance.dto.ts | 28 +------ .../src/issuance/dtos/multiConnection.dto.ts | 71 ++++++++++++++++ .../src/issuance/issuance.controller.ts | 4 +- .../src/issuance/issuance.service.ts | 9 +- apps/connection/src/connection.repository.ts | 4 +- .../interfaces/issuance.interfaces.ts | 9 +- apps/issuance/src/issuance.controller.ts | 4 +- apps/issuance/src/issuance.service.ts | 82 +++++++++---------- 8 files changed, 132 insertions(+), 79 deletions(-) create mode 100644 apps/api-gateway/src/issuance/dtos/multiConnection.dto.ts diff --git a/apps/api-gateway/src/issuance/dtos/issuance.dto.ts b/apps/api-gateway/src/issuance/dtos/issuance.dto.ts index 20c1ba466..e54f2a32b 100644 --- a/apps/api-gateway/src/issuance/dtos/issuance.dto.ts +++ b/apps/api-gateway/src/issuance/dtos/issuance.dto.ts @@ -105,7 +105,7 @@ class Credential { @IsObject() public credentialStatus?: JsonLdCredentialDetailCredentialStatus; } -class Attribute { +export class Attribute { @ApiProperty() @IsString({ message: 'Attribute name should be string' }) @IsNotEmpty({ message: 'Attribute name is required' }) @@ -121,18 +121,15 @@ class Attribute { @ApiProperty({ default: false }) @IsBoolean() @IsOptional() - @IsNotEmpty({ message: 'isRequired property is required' }) isRequired?: boolean = false; } - -class CredentialsIssuanceDto { +export class CredentialsIssuanceDto { @ApiProperty({ example: 'string' }) - @IsNotEmpty({ message: 'Please provide valid credential definition id' }) + @IsNotEmpty({ message: 'credentialDefinitionId is required' }) @IsString({ message: 'credential definition id should be string' }) @Transform(({ value }) => value.trim()) - @IsOptional() - credentialDefinitionId?: string; + credentialDefinitionId: string; @ApiProperty({ example: 'string' }) @IsNotEmpty({ message: 'Please provide valid comment' }) @@ -280,23 +277,6 @@ class CredentialOffer { } -export class IssueCredentialDto extends OOBIssueCredentialDto { - @ApiProperty({ example: 'string' }) - @IsNotEmpty({ message: 'connectionId is required' }) - @IsString({ message: 'connectionId should be string' }) - @Transform(({ value }) => trim(value)) - connectionId: string; - - @ApiPropertyOptional() - @IsOptional() - @IsString({ message: 'auto accept proof must be in string' }) - @IsNotEmpty({ message: 'please provide valid auto accept proof' }) - @IsEnum(AutoAccept, { - message: `Invalid auto accept credential. It should be one of: ${Object.values(AutoAccept).join(', ')}` - }) - autoAcceptCredential?: string; -} - export class IssuanceDto { @ApiProperty() @IsOptional() diff --git a/apps/api-gateway/src/issuance/dtos/multiConnection.dto.ts b/apps/api-gateway/src/issuance/dtos/multiConnection.dto.ts new file mode 100644 index 000000000..c5b313d86 --- /dev/null +++ b/apps/api-gateway/src/issuance/dtos/multiConnection.dto.ts @@ -0,0 +1,71 @@ +import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; +import { ArrayMaxSize, ArrayMinSize, IsArray, IsBoolean, IsEnum, IsNotEmpty, IsOptional, IsString, ValidateNested } from 'class-validator'; +import { Transform, Type } from 'class-transformer'; + +import { AutoAccept } from '@credebl/enum/enum'; +import { trim } from '@credebl/common/cast.helper'; +import { Attribute, CredentialsIssuanceDto } from './issuance.dto'; + +class ConnectionAttributes { + @ApiProperty({ example: 'string' }) + @IsNotEmpty({ message: 'connectionId is required' }) + @IsString({ message: 'connectionId should be string' }) + @Transform(({ value }) => trim(value)) + connectionId: string; + + @ApiProperty({ + example: [ + { + value: 'string', + name: 'string' + } + ] + }) + @IsArray() + @ValidateNested({ each: true }) + @ArrayMinSize(1) + @IsNotEmpty({ message: 'Please provide valid attributes' }) + @Type(() => Attribute) + attributes: Attribute[]; +} + +export class IssueCredentialDto extends CredentialsIssuanceDto { + @ApiProperty({ + example: [ + { + connectionId: 'string', + attributes: [ + { + value: 'string', + name: 'string' + } + ] + } + ] + }) + @IsArray() + @ValidateNested({ each: true }) + @ArrayMinSize(1) + @ArrayMaxSize(Number(process.env.OOB_BATCH_SIZE), { message: `Limit reached (${process.env.OOB_BATCH_SIZE} connections max).` }) + @IsNotEmpty({ message: 'credentialData is required' }) + @Type(() => ConnectionAttributes) + credentialData: ConnectionAttributes[]; + + @ApiPropertyOptional() + @IsOptional() + @IsString({ message: 'auto accept proof must be in string' }) + @IsNotEmpty({ message: 'please provide valid auto accept proof' }) + @IsEnum(AutoAccept, { + message: `Invalid auto accept credential. It should be one of: ${Object.values(AutoAccept).join(', ')}` + }) + autoAcceptCredential?: string; + + @ApiProperty({ + example: false + }) + @IsOptional() + @IsNotEmpty() + @IsBoolean({message: 'isShortenUrl must be boolean'}) + isShortenUrl?: boolean; + +} diff --git a/apps/api-gateway/src/issuance/issuance.controller.ts b/apps/api-gateway/src/issuance/issuance.controller.ts index f640f0c64..5f96d122d 100644 --- a/apps/api-gateway/src/issuance/issuance.controller.ts +++ b/apps/api-gateway/src/issuance/issuance.controller.ts @@ -43,7 +43,6 @@ import { ClientDetails, FileParameter, IssuanceDto, - IssueCredentialDto, OOBCredentialDtoWithEmail, OOBIssueCredentialDto, PreviewFileDetails @@ -63,6 +62,7 @@ import { RpcException } from '@nestjs/microservices'; /* eslint-disable @typescript-eslint/no-unused-vars */ import { user } from '@prisma/client'; import { IGetAllIssuedCredentialsDto } from './dtos/get-all-issued-credentials.dto'; +import { IssueCredentialDto } from './dtos/multiConnection.dto'; @Controller() @UseFilters(CustomExceptionFilter) @@ -527,7 +527,7 @@ export class IssuanceController { issueCredentialDto.orgId = orgId; const getCredentialDetails = await this.issueCredentialService.sendCredentialCreateOffer(issueCredentialDto, user); - + const finalResponse: IResponse = { statusCode: HttpStatus.CREATED, message: ResponseMessages.issuance.success.create, diff --git a/apps/api-gateway/src/issuance/issuance.service.ts b/apps/api-gateway/src/issuance/issuance.service.ts index 934cc80c0..cd86b11cb 100644 --- a/apps/api-gateway/src/issuance/issuance.service.ts +++ b/apps/api-gateway/src/issuance/issuance.service.ts @@ -3,9 +3,10 @@ import { Injectable, Inject } from '@nestjs/common'; import { ClientProxy } from '@nestjs/microservices'; import { BaseService } from 'libs/service/base.service'; import { IUserRequest } from '@credebl/user-request/user-request.interface'; -import { ClientDetails, FileParameter, IssuanceDto, IssueCredentialDto, OOBCredentialDtoWithEmail, OOBIssueCredentialDto, PreviewFileDetails } from './dtos/issuance.dto'; +import { ClientDetails, FileParameter, IssuanceDto, OOBCredentialDtoWithEmail, OOBIssueCredentialDto, PreviewFileDetails } from './dtos/issuance.dto'; import { FileExportResponse, IIssuedCredentialSearchParams, IssueCredentialType, RequestPayload } from './interfaces'; import { IIssuedCredential } from '@credebl/common/interfaces/issuance.interface'; +import { IssueCredentialDto } from './dtos/multiConnection.dto'; @Injectable() export class IssuanceService extends BaseService { @@ -17,11 +18,9 @@ export class IssuanceService extends BaseService { super('IssuanceService'); } - sendCredentialCreateOffer(issueCredentialDto: IssueCredentialDto, user: IUserRequest): Promise<{ - response: object; - }> { + sendCredentialCreateOffer(issueCredentialDto: IssueCredentialDto, user: IUserRequest): Promise { - const payload = { attributes: issueCredentialDto.attributes, comment: issueCredentialDto.comment, credentialDefinitionId: issueCredentialDto.credentialDefinitionId, connectionId: issueCredentialDto.connectionId, orgId: issueCredentialDto.orgId, protocolVersion: issueCredentialDto.protocolVersion, autoAcceptCredential: issueCredentialDto.autoAcceptCredential, user }; + const payload = { comment: issueCredentialDto.comment, credentialDefinitionId: issueCredentialDto.credentialDefinitionId, credentialData: issueCredentialDto.credentialData, orgId: issueCredentialDto.orgId, protocolVersion: issueCredentialDto.protocolVersion, autoAcceptCredential: issueCredentialDto.autoAcceptCredential, user }; return this.sendNats(this.issuanceProxy, 'send-credential-create-offer', payload); } diff --git a/apps/connection/src/connection.repository.ts b/apps/connection/src/connection.repository.ts index 2b7034878..58967757b 100644 --- a/apps/connection/src/connection.repository.ts +++ b/apps/connection/src/connection.repository.ts @@ -149,7 +149,7 @@ export class ConnectionRepository { break; } - const agentDetails = await this.prisma.connections.upsert({ + const connectionDetails = await this.prisma.connections.upsert({ where: { connectionId: connectionDto?.id }, @@ -169,7 +169,7 @@ export class ConnectionRepository { orgId: organisationId } }); - return agentDetails; + return connectionDetails; } catch (error) { this.logger.error(`Error in saveConnectionWebhook: ${error.message} `); throw error; diff --git a/apps/issuance/interfaces/issuance.interfaces.ts b/apps/issuance/interfaces/issuance.interfaces.ts index 5747d7a69..16095c050 100644 --- a/apps/issuance/interfaces/issuance.interfaces.ts +++ b/apps/issuance/interfaces/issuance.interfaces.ts @@ -11,12 +11,16 @@ export interface IAttributes { value: string; isRequired?: boolean; } + +interface ICredentialsAttributes { + connectionId: string; + attributes: IAttributes[]; +} export interface IIssuance { user?: IUserRequest; credentialDefinitionId: string; comment?: string; - connectionId: string; - attributes: IAttributes[]; + credentialData: ICredentialsAttributes[]; orgId: string; autoAcceptCredential?: AutoAccept, protocolVersion?: string; @@ -24,7 +28,6 @@ export interface IIssuance { parentThreadId?: string, willConfirm?: boolean, label?: string - } interface IIndy { diff --git a/apps/issuance/src/issuance.controller.ts b/apps/issuance/src/issuance.controller.ts index 1c3d0cd85..f579765dd 100644 --- a/apps/issuance/src/issuance.controller.ts +++ b/apps/issuance/src/issuance.controller.ts @@ -1,6 +1,6 @@ import { Controller } from '@nestjs/common'; import { MessagePattern } from '@nestjs/microservices'; -import { IClientDetails, ICreateOfferResponse, IIssuance, IIssueCredentials, IIssueCredentialsDefinitions, ImportFileDetails, IssueCredentialWebhookPayload, OutOfBandCredentialOffer, PreviewRequest } from '../interfaces/issuance.interfaces'; +import { IClientDetails, IIssuance, IIssueCredentials, IIssueCredentialsDefinitions, ImportFileDetails, IssueCredentialWebhookPayload, OutOfBandCredentialOffer, PreviewRequest } from '../interfaces/issuance.interfaces'; import { IssuanceService } from './issuance.service'; import { IIssuedCredential } from '@credebl/common/interfaces/issuance.interface'; import { OOBIssueCredentialDto } from 'apps/api-gateway/src/issuance/dtos/issuance.dto'; @@ -10,7 +10,7 @@ export class IssuanceController { constructor(private readonly issuanceService: IssuanceService) { } @MessagePattern({ cmd: 'send-credential-create-offer' }) - async sendCredentialCreateOffer(payload: IIssuance): Promise { + async sendCredentialCreateOffer(payload: IIssuance): Promise { return this.issuanceService.sendCredentialCreateOffer(payload); } diff --git a/apps/issuance/src/issuance.service.ts b/apps/issuance/src/issuance.service.ts index 61123836a..dc052733d 100644 --- a/apps/issuance/src/issuance.service.ts +++ b/apps/issuance/src/issuance.service.ts @@ -50,11 +50,10 @@ export class IssuanceService { @Inject(CACHE_MANAGER) private cacheService: Cache ) { } - - async sendCredentialCreateOffer(payload: IIssuance): Promise { + async sendCredentialCreateOffer(payload: IIssuance): Promise { try { - const { orgId, credentialDefinitionId, comment, connectionId, attributes } = payload || {}; + const { orgId, credentialDefinitionId, comment, credentialData } = payload || {}; const schemaResponse: SchemaDetails = await this.issuanceRepository.getCredentialDefinitionDetails( credentialDefinitionId @@ -63,26 +62,26 @@ export class IssuanceService { if (schemaResponse?.attributes) { const schemaResponseError = []; const attributesArray: IAttributes[] = JSON.parse(schemaResponse.attributes); - + attributesArray.forEach((attribute) => { - if (attribute.attributeName && attribute.isRequired) { - - payload.attributes.map((attr) => { - if (attr.name === attribute.attributeName && attribute.isRequired && !attr.value) { - schemaResponseError.push( - `Attribute ${attribute.attributeName} is required` - ); - } - return true; - }); - } + if (attribute.attributeName && attribute.isRequired) { + + credentialData.forEach((credential, i) => { + credential.attributes.forEach((attr) => { + if (attr.name === attribute.attributeName && attribute.isRequired && !attr.value) { + schemaResponseError.push( + `Attribute ${attribute.attributeName} is required at position ${i + 1}` + ); + } + }); + }); + } }); + if (0 < schemaResponseError.length) { - throw new BadRequestException(schemaResponseError); - + throw new BadRequestException(schemaResponseError); } - - } + } const agentDetails = await this.issuanceRepository.getAgentEndPoint(orgId); @@ -101,32 +100,33 @@ export class IssuanceService { const issuanceMethodLabel = 'create-offer'; const url = await this.getAgentUrl(issuanceMethodLabel, orgAgentType, agentEndPoint, agentDetails?.tenantId); - const issueData: IIssueData = { - protocolVersion: 'v1', - connectionId, - credentialFormats: { - indy: { - // eslint-disable-next-line @typescript-eslint/no-unused-vars - attributes: (attributes).map(({ isRequired, ...rest }) => rest), - credentialDefinitionId - - } - }, - autoAcceptCredential: payload.autoAcceptCredential || 'always', - comment - }; + const issuancePromises: Promise[] = []; - const credentialCreateOfferDetails: ICreateOfferResponse = await this._sendCredentialCreateOffer(issueData, url, orgId); + for (const credentials of credentialData) { + const { connectionId, attributes } = credentials; + const issueData: IIssueData = { + protocolVersion: 'v1', + connectionId, + credentialFormats: { + indy: { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + attributes: (attributes).map(({ isRequired, ...rest }) => rest), + credentialDefinitionId + + } + }, + autoAcceptCredential: payload.autoAcceptCredential || 'always', + comment + }; - if (credentialCreateOfferDetails && 0 < Object.keys(credentialCreateOfferDetails).length) { - delete credentialCreateOfferDetails._tags; - delete credentialCreateOfferDetails.metadata; - delete credentialCreateOfferDetails.credentials; - delete credentialCreateOfferDetails.credentialAttributes; - delete credentialCreateOfferDetails.autoAcceptCredential; + await this.delay(500); + const credentialCreateOfferDetails = this._sendCredentialCreateOffer(issueData, url, orgId); + issuancePromises.push(credentialCreateOfferDetails); } - return credentialCreateOfferDetails; + const results = await Promise.allSettled(issuancePromises); + return results; + } catch (error) { this.logger.error(`[sendCredentialCreateOffer] - error in create credentials : ${JSON.stringify(error)}`); const errorStack = error?.status?.message?.error?.reason || error?.status?.message?.error; From eb717255359a9d29cb28543c57d6b45031e769a7 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Thu, 4 Apr 2024 19:30:25 +0530 Subject: [PATCH 2/6] feat: multi select connections functionality while issuance Signed-off-by: bhavanakarwade --- apps/issuance/src/issuance.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/issuance/src/issuance.service.ts b/apps/issuance/src/issuance.service.ts index dc052733d..68f919739 100644 --- a/apps/issuance/src/issuance.service.ts +++ b/apps/issuance/src/issuance.service.ts @@ -98,6 +98,7 @@ export class IssuanceService { } const issuanceMethodLabel = 'create-offer'; + const url = await this.getAgentUrl(issuanceMethodLabel, orgAgentType, agentEndPoint, agentDetails?.tenantId); const issuancePromises: Promise[] = []; From 8179bd6bb38bea20005515b61d1e61fa971b264a Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Thu, 4 Apr 2024 19:49:41 +0530 Subject: [PATCH 3/6] feat: multi select connections Signed-off-by: bhavanakarwade --- apps/api-gateway/src/issuance/issuance.service.ts | 2 +- apps/issuance/src/issuance.controller.ts | 4 ++-- apps/issuance/src/issuance.service.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/api-gateway/src/issuance/issuance.service.ts b/apps/api-gateway/src/issuance/issuance.service.ts index cd86b11cb..d6ecf9f70 100644 --- a/apps/api-gateway/src/issuance/issuance.service.ts +++ b/apps/api-gateway/src/issuance/issuance.service.ts @@ -22,7 +22,7 @@ export class IssuanceService extends BaseService { const payload = { comment: issueCredentialDto.comment, credentialDefinitionId: issueCredentialDto.credentialDefinitionId, credentialData: issueCredentialDto.credentialData, orgId: issueCredentialDto.orgId, protocolVersion: issueCredentialDto.protocolVersion, autoAcceptCredential: issueCredentialDto.autoAcceptCredential, user }; - return this.sendNats(this.issuanceProxy, 'send-credential-create-offer', payload); + return this.sendNatsMessage(this.issuanceProxy, 'send-credential-create-offer', payload); } sendCredentialOutOfBand(issueCredentialDto: OOBIssueCredentialDto): Promise<{ diff --git a/apps/issuance/src/issuance.controller.ts b/apps/issuance/src/issuance.controller.ts index f579765dd..0750f85b0 100644 --- a/apps/issuance/src/issuance.controller.ts +++ b/apps/issuance/src/issuance.controller.ts @@ -1,6 +1,6 @@ import { Controller } from '@nestjs/common'; import { MessagePattern } from '@nestjs/microservices'; -import { IClientDetails, IIssuance, IIssueCredentials, IIssueCredentialsDefinitions, ImportFileDetails, IssueCredentialWebhookPayload, OutOfBandCredentialOffer, PreviewRequest } from '../interfaces/issuance.interfaces'; +import { IClientDetails, ICreateOfferResponse, IIssuance, IIssueCredentials, IIssueCredentialsDefinitions, ImportFileDetails, IssueCredentialWebhookPayload, OutOfBandCredentialOffer, PreviewRequest } from '../interfaces/issuance.interfaces'; import { IssuanceService } from './issuance.service'; import { IIssuedCredential } from '@credebl/common/interfaces/issuance.interface'; import { OOBIssueCredentialDto } from 'apps/api-gateway/src/issuance/dtos/issuance.dto'; @@ -10,7 +10,7 @@ export class IssuanceController { constructor(private readonly issuanceService: IssuanceService) { } @MessagePattern({ cmd: 'send-credential-create-offer' }) - async sendCredentialCreateOffer(payload: IIssuance): Promise { + async sendCredentialCreateOffer(payload: IIssuance): Promise[]> { return this.issuanceService.sendCredentialCreateOffer(payload); } diff --git a/apps/issuance/src/issuance.service.ts b/apps/issuance/src/issuance.service.ts index 68f919739..e89b330ff 100644 --- a/apps/issuance/src/issuance.service.ts +++ b/apps/issuance/src/issuance.service.ts @@ -50,7 +50,7 @@ export class IssuanceService { @Inject(CACHE_MANAGER) private cacheService: Cache ) { } - async sendCredentialCreateOffer(payload: IIssuance): Promise { + async sendCredentialCreateOffer(payload: IIssuance): Promise[]> { try { const { orgId, credentialDefinitionId, comment, credentialData } = payload || {}; @@ -98,7 +98,7 @@ export class IssuanceService { } const issuanceMethodLabel = 'create-offer'; - + const url = await this.getAgentUrl(issuanceMethodLabel, orgAgentType, agentEndPoint, agentDetails?.tenantId); const issuancePromises: Promise[] = []; From d3fc10231037979d68ea624af56f14f720a7a4af Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Thu, 4 Apr 2024 20:11:21 +0530 Subject: [PATCH 4/6] refactor: modify error message Signed-off-by: bhavanakarwade --- apps/api-gateway/src/authz/guards/org-roles.guard.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/api-gateway/src/authz/guards/org-roles.guard.ts b/apps/api-gateway/src/authz/guards/org-roles.guard.ts index c109525fb..f3c1178d1 100644 --- a/apps/api-gateway/src/authz/guards/org-roles.guard.ts +++ b/apps/api-gateway/src/authz/guards/org-roles.guard.ts @@ -84,7 +84,7 @@ export class OrgRolesGuard implements CanActivate { return false; } else { - throw new BadRequestException('organization is required'); + throw new BadRequestException('Please provide valid orgId'); } // Sending user friendly message if a user attempts to access an API that is inaccessible to their role From 55f266115abebc76eea739cf24e6ec7f5be0b7c8 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Thu, 4 Apr 2024 20:34:56 +0530 Subject: [PATCH 5/6] fix: resolved comments Signed-off-by: bhavanakarwade --- apps/api-gateway/src/issuance/dtos/issuance.dto.ts | 4 ++-- .../dtos/{multiConnection.dto.ts => multi-connection.dto.ts} | 0 apps/api-gateway/src/issuance/issuance.controller.ts | 2 +- apps/api-gateway/src/issuance/issuance.service.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) rename apps/api-gateway/src/issuance/dtos/{multiConnection.dto.ts => multi-connection.dto.ts} (100%) diff --git a/apps/api-gateway/src/issuance/dtos/issuance.dto.ts b/apps/api-gateway/src/issuance/dtos/issuance.dto.ts index e54f2a32b..1a887ff3f 100644 --- a/apps/api-gateway/src/issuance/dtos/issuance.dto.ts +++ b/apps/api-gateway/src/issuance/dtos/issuance.dto.ts @@ -126,8 +126,8 @@ export class Attribute { } export class CredentialsIssuanceDto { @ApiProperty({ example: 'string' }) - @IsNotEmpty({ message: 'credentialDefinitionId is required' }) - @IsString({ message: 'credential definition id should be string' }) + @IsNotEmpty({ message: 'Credential definition Id is required' }) + @IsString({ message: 'Credential definition id should be string' }) @Transform(({ value }) => value.trim()) credentialDefinitionId: string; diff --git a/apps/api-gateway/src/issuance/dtos/multiConnection.dto.ts b/apps/api-gateway/src/issuance/dtos/multi-connection.dto.ts similarity index 100% rename from apps/api-gateway/src/issuance/dtos/multiConnection.dto.ts rename to apps/api-gateway/src/issuance/dtos/multi-connection.dto.ts diff --git a/apps/api-gateway/src/issuance/issuance.controller.ts b/apps/api-gateway/src/issuance/issuance.controller.ts index 5f96d122d..e6e30c7c6 100644 --- a/apps/api-gateway/src/issuance/issuance.controller.ts +++ b/apps/api-gateway/src/issuance/issuance.controller.ts @@ -62,7 +62,7 @@ import { RpcException } from '@nestjs/microservices'; /* eslint-disable @typescript-eslint/no-unused-vars */ import { user } from '@prisma/client'; import { IGetAllIssuedCredentialsDto } from './dtos/get-all-issued-credentials.dto'; -import { IssueCredentialDto } from './dtos/multiConnection.dto'; +import { IssueCredentialDto } from './dtos/multi-connection.dto'; @Controller() @UseFilters(CustomExceptionFilter) diff --git a/apps/api-gateway/src/issuance/issuance.service.ts b/apps/api-gateway/src/issuance/issuance.service.ts index d6ecf9f70..07478a1a2 100644 --- a/apps/api-gateway/src/issuance/issuance.service.ts +++ b/apps/api-gateway/src/issuance/issuance.service.ts @@ -6,7 +6,7 @@ import { IUserRequest } from '@credebl/user-request/user-request.interface'; import { ClientDetails, FileParameter, IssuanceDto, OOBCredentialDtoWithEmail, OOBIssueCredentialDto, PreviewFileDetails } from './dtos/issuance.dto'; import { FileExportResponse, IIssuedCredentialSearchParams, IssueCredentialType, RequestPayload } from './interfaces'; import { IIssuedCredential } from '@credebl/common/interfaces/issuance.interface'; -import { IssueCredentialDto } from './dtos/multiConnection.dto'; +import { IssueCredentialDto } from './dtos/multi-connection.dto'; @Injectable() export class IssuanceService extends BaseService { From 088e3df4fe8ff0301420070f503a357c483c1628 Mon Sep 17 00:00:00 2001 From: bhavanakarwade Date: Tue, 23 Apr 2024 11:52:09 +0530 Subject: [PATCH 6/6] resolved comments Signed-off-by: bhavanakarwade --- apps/connection/src/connection.repository.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/connection/src/connection.repository.ts b/apps/connection/src/connection.repository.ts index 58967757b..430304f97 100644 --- a/apps/connection/src/connection.repository.ts +++ b/apps/connection/src/connection.repository.ts @@ -149,7 +149,7 @@ export class ConnectionRepository { break; } - const connectionDetails = await this.prisma.connections.upsert({ + return this.prisma.connections.upsert({ where: { connectionId: connectionDto?.id }, @@ -169,7 +169,6 @@ export class ConnectionRepository { orgId: organisationId } }); - return connectionDetails; } catch (error) { this.logger.error(`Error in saveConnectionWebhook: ${error.message} `); throw error;