Skip to content

API to identify whether member is external or internal. #480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 60 additions & 1 deletion docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3538,7 +3538,56 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
$ref: "#/components/schemas/Error"
/taas-teams/isExternalMember:
post:
tags:
- Teams
description: |
Finds whether member is internal or external

requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/IsExternalMemberRequestBody"
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/IsExternalMemberResponse"
"400":
description: Bad request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"401":
description: Not authenticated
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: Forbidden
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"409":
description: Conflict
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"500":
description: Internal Server Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/taas-teams/members-suggest/{fragment}:
get:
tags:
Expand Down Expand Up @@ -5772,6 +5821,16 @@ components:
paymentIntentToken:
type: string
description: " Token required by stripe for completing payment."
IsExternalMemberRequestBody:
properties:
totalAmount:
type: number
description: "Member id"
IsExternalMemberResponse:
properties:
paymentIntentToken:
type: boolean
description: "Is the user external member"
SubmitTeamRequestBody:
properties:
teamName:
Expand Down
13 changes: 12 additions & 1 deletion src/controllers/TeamController.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,16 @@ async function createPayment(req, res) {
res.send(await service.createPayment(req.body.totalAmount));
}

/**
*
* @param req the request
* @param res the response
*/
async function isExternalMember(req, res) {
res.send(await service.isExternalMember(req.body.memberId));
}


module.exports = {
searchTeams,
getTeam,
Expand All @@ -189,5 +199,6 @@ module.exports = {
searchSkills,
suggestMembers,
createPayment,
calculateAmount
calculateAmount,
isExternalMember
}
8 changes: 7 additions & 1 deletion src/routes/TeamRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,5 +123,11 @@ module.exports = {
auth: 'jwt',
scopes: [constants.Scopes.CREATE_TAAS_TEAM]
},
}
},
"/taas-teams/isExternalMember": {
post: {
controller: "TeamController",
method: "isExternalMember"
}
},
}