forked from credebl/platform
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add organization(s) into ecosystem (credebl#670)
* feat: add self orgs in ecosystem Signed-off-by: bhavanakarwade <[email protected]> * feat: update return types Signed-off-by: bhavanakarwade <[email protected]> * refactor: error handling Signed-off-by: bhavanakarwade <[email protected]> * feat: add role filter in get all organization api Signed-off-by: bhavanakarwade <[email protected]> * refactor: get all organizations dto Signed-off-by: bhavanakarwade <[email protected]> * feat: apply filter for role Signed-off-by: bhavanakarwade <[email protected]> * feat: applied validation for uuid Signed-off-by: bhavanakarwade <[email protected]> * refactor: nats message Signed-off-by: bhavanakarwade <[email protected]> * refactor: improve error handling Signed-off-by: bhavanakarwade <[email protected]> * refactor: applied uuid validation for ecosystemId Signed-off-by: bhavanakarwade <[email protected]> * refactor: add organization function Signed-off-by: bhavanakarwade <[email protected]> * refactor: added organization functionality Signed-off-by: bhavanakarwade <[email protected]> * fix: handled empty array condition Signed-off-by: bhavanakarwade <[email protected]> * refactor: added organization into ecosystem with network validation Signed-off-by: bhavanakarwade <[email protected]> * refactor: find ecosystem member functionality Signed-off-by: bhavanakarwade <[email protected]> --------- Signed-off-by: bhavanakarwade <[email protected]>
- Loading branch information
1 parent
d880598
commit 5b09ffe
Showing
17 changed files
with
390 additions
and
63 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
apps/api-gateway/src/ecosystem/dtos/add-organizations.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { ArrayNotEmpty, ArrayUnique, IsArray, IsString, IsUUID } from 'class-validator'; | ||
|
||
export class AddOrganizationsDto { | ||
@ApiProperty({ | ||
example: ['32f54163-7166-48f1-93d8-ff217bdb0653'] | ||
}) | ||
@IsArray() | ||
@ArrayNotEmpty({ message: 'Organization Ids array must not be empty' }) | ||
@IsUUID('4', { each: true }) | ||
@ArrayUnique({ message: 'Duplicate Organization Ids are not allowed' }) | ||
@IsString({ each: true, message: 'Each organization Id in the array should be a string' }) | ||
organizationIds: string[]; | ||
|
||
ecosystemId: string; | ||
|
||
orgId: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
apps/api-gateway/src/organization/dtos/get-organizations.dto.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { trim } from '@credebl/common/cast.helper'; | ||
import { PaginationDto } from '@credebl/common/dtos/pagination.dto'; | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { Transform } from 'class-transformer'; | ||
import { IsEnum, IsOptional } from 'class-validator'; | ||
import { OrgRoles } from 'libs/org-roles/enums'; | ||
|
||
export class GetAllOrganizationsDto extends PaginationDto { | ||
@ApiProperty({ required: false, enum: OrgRoles }) | ||
@Transform(({ value }) => trim(value)) | ||
@IsOptional() | ||
@IsEnum(OrgRoles) | ||
role: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.