diff --git a/apps/api-gateway/src/verification/dto/request-proof.dto.ts b/apps/api-gateway/src/verification/dto/request-proof.dto.ts index e7cd8abed..4b756df3e 100644 --- a/apps/api-gateway/src/verification/dto/request-proof.dto.ts +++ b/apps/api-gateway/src/verification/dto/request-proof.dto.ts @@ -1,3 +1,5 @@ +import { IsArray, IsBoolean, IsEmail, IsEnum, IsNotEmpty, IsNumberString, IsObject, IsOptional, IsString, IsUUID } from 'class-validator'; +import { toLowerCase, trim } from '@credebl/common/cast.helper'; import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger'; import { ArrayNotEmpty, IsArray, IsBoolean, IsEmail, IsEnum, IsNotEmpty, IsNumberString, IsObject, IsOptional, IsString, IsUUID, ValidateIf, ValidateNested } from 'class-validator'; import { Transform, Type } from 'class-transformer'; @@ -169,6 +171,13 @@ export class SendProofRequestPayload { @IsString({ message: 'comment must be in string' }) comment: string; + @ApiProperty() + @IsString() + @Transform(({ value }) => trim(value)) + @Transform(({ value }) => toLowerCase(value)) + @IsNotEmpty({ message: 'connectionId is required.' }) + connectionId: string; + @ApiProperty({ 'example': [ { @@ -176,16 +185,7 @@ export class SendProofRequestPayload { name: 'Verify national identity', version: '1.0', // eslint-disable-next-line camelcase - requested_attributes: { - verifynameAddress: { - names: ['name', 'address'], - restrictions: [{ 'schema_id': 'KU583UbI4yAKfaBTSz1rqG:2:National ID:1.0.0' }] - }, - verifyBirthPlace: { - name: 'Place', - restrictions: [{ 'schema_id': 'KU583UbI4yAKfaBTSz1rqG:2:Birth Certificate:1.0.0' }] - } - }, + requested_attributes: {}, // eslint-disable-next-line camelcase requested_predicates: {} } @@ -214,12 +214,6 @@ export class SendProofRequestPayload { @IsOptional() @IsUUID() @IsNotEmpty({ message: 'please provide valid parentThreadId' }) - parentThreadId: string; - - @ApiProperty({ example: true }) - @IsBoolean() - @IsOptional() - @IsNotEmpty({message:'Please provide the flag for shorten url.'}) - isShortenUrl?: boolean; + parentThreadId: string; }