Skip to content

Commit 6ea9431

Browse files
authored
Merge pull request #480 from arpitchaudhari/dev
API endpoint to identify whether member is external or internal.
2 parents 14a992f + 9cd777e commit 6ea9431

File tree

3 files changed

+79
-3
lines changed

3 files changed

+79
-3
lines changed

docs/swagger.yaml

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3538,7 +3538,56 @@ paths:
35383538
content:
35393539
application/json:
35403540
schema:
3541-
$ref: "#/components/schemas/Error"
3541+
$ref: "#/components/schemas/Error"
3542+
/taas-teams/isExternalMember:
3543+
post:
3544+
tags:
3545+
- Teams
3546+
description: |
3547+
Finds whether member is internal or external
3548+
3549+
requestBody:
3550+
content:
3551+
application/json:
3552+
schema:
3553+
$ref: "#/components/schemas/IsExternalMemberRequestBody"
3554+
responses:
3555+
"200":
3556+
description: OK
3557+
content:
3558+
application/json:
3559+
schema:
3560+
$ref: "#/components/schemas/IsExternalMemberResponse"
3561+
"400":
3562+
description: Bad request
3563+
content:
3564+
application/json:
3565+
schema:
3566+
$ref: "#/components/schemas/Error"
3567+
"401":
3568+
description: Not authenticated
3569+
content:
3570+
application/json:
3571+
schema:
3572+
$ref: "#/components/schemas/Error"
3573+
"403":
3574+
description: Forbidden
3575+
content:
3576+
application/json:
3577+
schema:
3578+
$ref: "#/components/schemas/Error"
3579+
"409":
3580+
description: Conflict
3581+
content:
3582+
application/json:
3583+
schema:
3584+
$ref: "#/components/schemas/Error"
3585+
"500":
3586+
description: Internal Server Error
3587+
content:
3588+
application/json:
3589+
schema:
3590+
$ref: "#/components/schemas/Error"
35423591
/taas-teams/members-suggest/{fragment}:
35433592
get:
35443593
tags:
@@ -5772,6 +5821,16 @@ components:
57725821
paymentIntentToken:
57735822
type: string
57745823
description: " Token required by stripe for completing payment."
5824+
IsExternalMemberRequestBody:
5825+
properties:
5826+
totalAmount:
5827+
type: number
5828+
description: "Member id"
5829+
IsExternalMemberResponse:
5830+
properties:
5831+
paymentIntentToken:
5832+
type: boolean
5833+
description: "Is the user external member"
57755834
SubmitTeamRequestBody:
57765835
properties:
57775836
teamName:

src/controllers/TeamController.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,16 @@ async function createPayment(req, res) {
173173
res.send(await service.createPayment(req.body.totalAmount));
174174
}
175175

176+
/**
177+
*
178+
* @param req the request
179+
* @param res the response
180+
*/
181+
async function isExternalMember(req, res) {
182+
res.send(await service.isExternalMember(req.body.memberId));
183+
}
184+
185+
176186
module.exports = {
177187
searchTeams,
178188
getTeam,
@@ -189,5 +199,6 @@ module.exports = {
189199
searchSkills,
190200
suggestMembers,
191201
createPayment,
192-
calculateAmount
202+
calculateAmount,
203+
isExternalMember
193204
}

src/routes/TeamRoutes.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,11 @@ module.exports = {
123123
auth: 'jwt',
124124
scopes: [constants.Scopes.CREATE_TAAS_TEAM]
125125
},
126-
}
126+
},
127+
"/taas-teams/isExternalMember": {
128+
post: {
129+
controller: "TeamController",
130+
method: "isExternalMember"
131+
}
132+
},
127133
}

0 commit comments

Comments
 (0)