From 31a807de80b8638342c819c2c473e8d1028f80f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iurii=20=E1=9A=BE?= Date: Tue, 2 Jul 2024 13:50:54 +0100 Subject: [PATCH] feat: adds email verification field --- CHANGELOG.md | 2 +- src/assets/asset.controller.ts | 5 ++--- src/user-profiles/dto/create-user-profile.dto.ts | 9 +++++++++ src/user-profiles/dto/update-user-profile.dto.ts | 9 +++++++++ src/user-profiles/user-profile.entity.ts | 1 + 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 524b16a..f78f86c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -370,7 +370,7 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). > 4 October 2022 - remove use of dynamic strict in the es mapping [`#93`](https://github.com/nevermined-io/marketplace-api/pull/93) -- Added new _nvm config mapping [`#92`](https://github.com/nevermined-io/marketplace-api/pull/92) +- Added new \_nvm config mapping [`#92`](https://github.com/nevermined-io/marketplace-api/pull/92) - switch to yarn [`#91`](https://github.com/nevermined-io/marketplace-api/pull/91) - rename `Nvm` to `NvmConfig` [`9b12183`](https://github.com/nevermined-io/marketplace-api/commit/9b12183e30364061c6b019f174cf6bb11ffd2b14) diff --git a/src/assets/asset.controller.ts b/src/assets/asset.controller.ts index 9ccd085..f66996a 100644 --- a/src/assets/asset.controller.ts +++ b/src/assets/asset.controller.ts @@ -314,9 +314,8 @@ export class AssetController { async getDDOMetadata(@Param('did') did: string): Promise { const assetSource = await this.assetService.findOneById(did) - const metada = GetAssetDto.fromSource(assetSource).service?.find( - (s) => s.attributes, - )?.attributes + const metada = GetAssetDto.fromSource(assetSource).service?.find((s) => s.attributes) + ?.attributes if (!metada) { throw new NotFoundException(`Asset with did ${did} doesn't have metada`) diff --git a/src/user-profiles/dto/create-user-profile.dto.ts b/src/user-profiles/dto/create-user-profile.dto.ts index 55344dc..943af8d 100644 --- a/src/user-profiles/dto/create-user-profile.dto.ts +++ b/src/user-profiles/dto/create-user-profile.dto.ts @@ -56,6 +56,15 @@ export class CreateUserProfileDto { @IsEmail() email: string + @ApiProperty({ + example: true, + description: 'Flag identifying if the user email is verified. Possible values: true or false', + required: false, + }) + @IsOptional() + @IsBoolean() + emailVerified: boolean + @ApiProperty({ example: AdditionalInformation, description: 'List of additional key-value attributes with additional information', diff --git a/src/user-profiles/dto/update-user-profile.dto.ts b/src/user-profiles/dto/update-user-profile.dto.ts index b8c5e9e..b4a86dd 100644 --- a/src/user-profiles/dto/update-user-profile.dto.ts +++ b/src/user-profiles/dto/update-user-profile.dto.ts @@ -79,6 +79,15 @@ export class UpdateUserProfileDto { @IsEmail() email: string + @ApiProperty({ + example: true, + description: 'Flag identifying if the user email is verified. Possible values: true or false', + required: false, + }) + @IsOptional() + @IsBoolean() + emailVerified: boolean + @ApiProperty({ example: AdditionalInformation, description: 'List of additional key-value attributes with additional information', diff --git a/src/user-profiles/user-profile.entity.ts b/src/user-profiles/user-profile.entity.ts index 745b44f..44ac817 100644 --- a/src/user-profiles/user-profile.entity.ts +++ b/src/user-profiles/user-profile.entity.ts @@ -10,6 +10,7 @@ export class UserProfile { nickname: string name: string email: string + emailVerified: boolean creationDate: Date updateDate: Date additionalInformation: AdditionalInformation