Skip to content

Commit

Permalink
feat: #82 allow search by user guid (#83)
Browse files Browse the repository at this point in the history
* chore: fix dependabot warnings

* feat(72): added endpoint for verifying bceid, refs: #72

* feat(72): add test for verifying bceid user, but skip it for now, refs: #72

* merge: update package-lock.json to be the same as main branch, refs: #72

* fix(72): fix return type, refs: #72

* fix(72): fix type in test, refs: #72

* refactor(72): refactor the service method and add comments for clarification, refs: #72

* feat(82): create a new api route to allow search bceid user by both userid and userguid, refs: #82

* fix: upgrade eslint-plugin-n

* fix dependency conflict

* fix dependency conflict

* fix(82): fix controller parameter type, refs: #82
  • Loading branch information
MCatherine1994 authored Apr 30, 2024
1 parent 17d6830 commit 7f28441
Show file tree
Hide file tree
Showing 5 changed files with 147 additions and 126 deletions.
121 changes: 2 additions & 119 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
"@nestjs/platform-express": "^10.0.0",
"@nestjs/swagger": "^7.1.10",
"dotenv": "^16.1.4",
"helmet": "^7.0.0",
"nest-winston": "^1.9.1",
"rimraf": "^5.0.0",
"rxjs": "^7.8.0",
"soap": "^1.0.0",
"swagger-ui-express": "^5.0.0",
"winston": "^3.8.2",
"nest-winston": "^1.9.1",
"helmet": "^7.0.0"
"winston": "^3.8.2"
},
"devDependencies": {
"@nestjs/schematics": "^10.0.0",
Expand All @@ -50,7 +50,7 @@
"eslint-config-prettier": "^8.6.0",
"eslint-config-standard": "^17.0.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-promise": "^6.1.1",
"istanbul-badges-readme": "^1.8.4",
Expand Down Expand Up @@ -102,4 +102,4 @@
"overrides": {
"minimist@<1.2.6": "1.2.6"
}
}
}
27 changes: 25 additions & 2 deletions backend/src/modules/idim-webservice/idim-webservice.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { ApiResponse, ApiQuery, ApiTags, ApiSecurity } from '@nestjs/swagger';
import { AuthGuard } from '../auth/auth.guard';
import { IdimWebserviceService } from './idim-webservice.service';
import {
SearchUserParameterType,
IDIRUserResponse,
BCEIDUserResponse,
RequesterAccountTypeCode,
Expand All @@ -34,7 +35,7 @@ export class IdimWebserviceController {
@Query('userId') userId: string,
@Query('requesterUserId') requesterUserId: string,
@Query('requesterAccountTypeCode')
requesterAccountTypeCode: string
requesterAccountTypeCode: RequesterAccountTypeCode
): Promise<HttpException | IDIRUserResponse> {
return this.idimWebserviceService.verifyIdirUser(
userId,
Expand All @@ -53,12 +54,34 @@ export class IdimWebserviceController {
@Query('userId') userId: string,
@Query('requesterUserGuid') requesterUserGuid: string,
@Query('requesterAccountTypeCode')
requesterAccountTypeCode: string
requesterAccountTypeCode: RequesterAccountTypeCode
): Promise<HttpException | BCEIDUserResponse> {
return this.idimWebserviceService.verifyBceidUser(
userId,
requesterUserGuid,
requesterAccountTypeCode
);
}

@Get('businessBceid')
@ApiResponse({ status: HttpStatus.OK, type: BCEIDUserResponse })
@ApiQuery({
name: 'requesterAccountTypeCode',
enum: RequesterAccountTypeCode,
})
@ApiQuery({ name: 'searchUserBy', enum: SearchUserParameterType })
async verifyBusinessBceidUser(
@Query('searchUserBy') searchUserBy: SearchUserParameterType,
@Query('searchValue') searchValue: string,
@Query('requesterUserGuid') requesterUserGuid: string,
@Query('requesterAccountTypeCode')
requesterAccountTypeCode: RequesterAccountTypeCode
): Promise<HttpException | BCEIDUserResponse> {
return this.idimWebserviceService.verifyBusinessBceidUser(
searchUserBy,
searchValue,
requesterUserGuid,
requesterAccountTypeCode
);
}
}
5 changes: 5 additions & 0 deletions backend/src/modules/idim-webservice/idim-webservice.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { ApiProperty } from '@nestjs/swagger';

export enum SearchUserParameterType {
UserGuid = "userGuid",
UserId = "userId"
}

export enum RequesterAccountTypeCode {
Internal = 'Internal',
Business = 'Business'
Expand Down
Loading

0 comments on commit 7f28441

Please sign in to comment.