Skip to content

Commit 4a1423c

Browse files
feat: added purpose property in send proof request (#1113)
Signed-off-by: bhavanakarwade <[email protected]>
1 parent c641fbc commit 4a1423c

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

apps/agent-service/src/interface/agent-service.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ export interface IInputDescriptors {
361361
export interface IProofRequestPresentationDefinition {
362362
id: string;
363363
name: string;
364+
purpose?: string;
364365
input_descriptors: IInputDescriptors[];
365366
}
366367

apps/api-gateway/src/verification/dto/request-proof.dto.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,7 @@ export class InputDescriptors {
112112
@IsOptional()
113113
@IsNotEmpty({ message: 'purpose is required' })
114114
purpose:string;
115-
116-
115+
117116
@ApiProperty({type: () => [Schema]})
118117
@IsNotEmpty({ message: 'schema is required' })
119118
@ValidateNested()
@@ -132,6 +131,7 @@ export class InputDescriptors {
132131

133132
export class ProofRequestPresentationDefinition {
134133

134+
@ApiProperty()
135135
@IsString()
136136
@IsNotEmpty({ message: 'id is required' })
137137
id: string;
@@ -140,6 +140,11 @@ export class ProofRequestPresentationDefinition {
140140
@IsOptional()
141141
name: string;
142142

143+
@ApiPropertyOptional()
144+
@IsString()
145+
@IsOptional()
146+
purpose?: string;
147+
143148
@ApiProperty({type: () => [InputDescriptors]})
144149
@IsArray({ message: 'inputDescriptors must be an array' })
145150
@IsNotEmpty({ message: 'inputDescriptors is required' })
@@ -223,6 +228,7 @@ export class RequestProofDtoBase extends ProofPayload {
223228
'example':
224229
{
225230
id: '32f54163-7166-48f1-93d8-ff217bdb0653',
231+
purpose: 'Used for KYC verification.',
226232
// eslint-disable-next-line camelcase
227233
input_descriptors: [
228234
{
@@ -388,6 +394,7 @@ export class SendProofRequestPayload {
388394
'example':
389395
{
390396
id: '32f54163-7166-48f1-93d8-ff217bdb0653',
397+
purpose: 'Used for KYC verification.',
391398
inputDescriptors: [
392399
{
393400
'id': 'banking_input_1',

apps/verification/src/interfaces/verification.interface.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ export interface IInputDescriptors {
122122
export interface IProofRequestPresentationDefinition {
123123
id:string;
124124
name: string;
125+
purpose?: string;
125126
input_descriptors:IInputDescriptors[];
126127
}
127128

apps/verification/src/verification.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ export class VerificationService {
491491
presentationDefinition: {
492492
id: outOfBandRequestProof.presentationDefinition.id,
493493
name: outOfBandRequestProof.presentationDefinition.name,
494+
purpose: outOfBandRequestProof?.presentationDefinition?.purpose,
494495
input_descriptors: [...outOfBandRequestProof.presentationDefinition.input_descriptors]
495496
}
496497
}

0 commit comments

Comments
 (0)