Skip to content
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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ install_dependency: &install_dependency
install_deploysuite: &install_deploysuite
name: Installation of install_deploysuite.
command: |
git clone --branch master https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
git clone --branch master_hostfix_v1 https://github.com/topcoder-platform/tc-deploy-scripts ../buildscript
cp ./../buildscript/master_deploy.sh .
cp ./../buildscript/buildenv.sh .
cp ./../buildscript/awsconfiguration.sh .
Expand Down
2 changes: 2 additions & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ module.exports = {
TOPCODER_USERS_API: process.env.TOPCODER_USERS_API || 'https://api.topcoder-dev.com/v3/users',
// the api to find topcoder members
TOPCODER_MEMBERS_API: process.env.TOPCODER_MEMBERS_API || 'https://api.topcoder-dev.com/v5/members',
// the v3 api to find topcoder members
TOPCODER_MEMBERS_API_V3: process.env.TOPCODER_MEMBERS_API_V3 || 'https://api.topcoder-dev.com/v3/members',
// rate limit of requests to user api
MAX_PARALLEL_REQUEST_TOPCODER_USERS_API: process.env.MAX_PARALLEL_REQUEST_TOPCODER_USERS_API || 100,

Expand Down
243 changes: 242 additions & 1 deletion docs/Topcoder-bookings-api.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info": {
"_postman_id": "15f10b58-dda5-4aaf-96e5-061a5c901717",
"_postman_id": "87477d86-2d08-40b6-93c6-99a394193e28",
"name": "Topcoder-bookings-api",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
Expand Down Expand Up @@ -19312,6 +19312,247 @@
}
]
},
{
"name": "Member Suggestion",
"item": [
{
"name": "get member suggestion successfully with administrator",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 200', function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_administrator}}"
}
],
"url": {
"raw": "{{URL}}/taas-teams/members-suggest/maxceem",
"host": [
"{{URL}}"
],
"path": [
"taas-teams",
"members-suggest",
"maxceem"
]
}
},
"response": []
},
{
"name": "get member suggestion successfully with booking manager",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 200', function () {\r",
" pm.response.to.have.status(200);\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_bookingManager}}"
}
],
"url": {
"raw": "{{URL}}/taas-teams/members-suggest/isbilir",
"host": [
"{{URL}}"
],
"path": [
"taas-teams",
"members-suggest",
"isbilir"
]
}
},
"response": []
},
{
"name": "get member suggestion with connect manager",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 403', function () {\r",
" pm.response.to.have.status(403);\r",
" const response = pm.response.json()\r",
" pm.expect(response.message).to.eq(\"You are not allowed to perform this action!\")\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_connect_manager_pshahcopmanag2}}"
}
],
"url": {
"raw": "{{URL}}/taas-teams/members-suggest/isbilir",
"host": [
"{{URL}}"
],
"path": [
"taas-teams",
"members-suggest",
"isbilir"
]
}
},
"response": []
},
{
"name": "get member suggestion with member",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 403', function () {\r",
" pm.response.to.have.status(403);\r",
" const response = pm.response.json()\r",
" pm.expect(response.message).to.eq(\"You are not allowed to perform this action!\")\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_member}}"
}
],
"url": {
"raw": "{{URL}}/taas-teams/members-suggest/isbilir",
"host": [
"{{URL}}"
],
"path": [
"taas-teams",
"members-suggest",
"isbilir"
]
}
},
"response": []
},
{
"name": "get member suggestion with m2m",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 403', function () {\r",
" pm.response.to.have.status(403);\r",
" const response = pm.response.json()\r",
" pm.expect(response.message).to.eq(\"You are not allowed to perform this action!\")\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer {{token_m2m_all_job}}"
}
],
"url": {
"raw": "{{URL}}/taas-teams/members-suggest/isbilir",
"host": [
"{{URL}}"
],
"path": [
"taas-teams",
"members-suggest",
"isbilir"
]
}
},
"response": []
},
{
"name": "get member suggestion with invalid token",
"event": [
{
"listen": "test",
"script": {
"exec": [
"pm.test('Status code is 401', function () {\r",
" pm.response.to.have.status(401);\r",
" const response = pm.response.json()\r",
" pm.expect(response.message).to.eq(\"Invalid Token.\")\r",
"});"
],
"type": "text/javascript"
}
}
],
"request": {
"method": "GET",
"header": [
{
"key": "Authorization",
"type": "text",
"value": "Bearer invalid"
}
],
"url": {
"raw": "{{URL}}/taas-teams/members-suggest/isbilir",
"host": [
"{{URL}}"
],
"path": [
"taas-teams",
"members-suggest",
"isbilir"
]
}
},
"response": []
}
]
},
{
"name": "GET /taas-teams",
"request": {
Expand Down
61 changes: 61 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3296,6 +3296,41 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/Error"
/taas-teams/members-suggest/{fragment}:
get:
tags:
- Teams
description: |
Returns suggested members for the given handle fragment
security:
- bearerAuth: []
responses:
"200":
description: OK
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/SuggestedMember"
"401":
description: Not authenticated
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: Forbidden
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"500":
description: Internal Server Error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
/taas-roles:
post:
tags:
Expand Down Expand Up @@ -5404,6 +5439,32 @@ components:
type: string
format: uuid
description: "The user Id who updated the role last time.(Will get the user info from the token)"
SuggestedMember:
properties:
userId:
type: number
example: 40157055
description: the user id
handle:
type: string
example: maxceemdev
description: the user handle
photoURL:
type: string
example: https://topcoder-dev-media.s3.amazonaws.com/member/profile/maxceem13-1587184611143.jpeg
description: the photo url
firstName:
type: string
example: Max
description: the firstname of the user
lastName:
type: string
example: Max
description: the lastname of the user
maxRating:
type: number
example: 1200
description: the maximum rating of the user
RoleRequestBody:
required:
- name
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const config = require('config')

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.changeColumn({ tableName: 'role_search_requests', schema: config.DB_SCHEMA_NAME}, 'job_description', {type: Sequelize.STRING(2000)})
},
down: async (queryInterface, Sequelize) => {
await queryInterface.changeColumn({ tableName: 'role_search_requests', schema: config.DB_SCHEMA_NAME}, 'job_description', {type: Sequelize.STRING(255)})
},
}
23 changes: 23 additions & 0 deletions migrations/2021-07-01-role-insert-custom-role.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const config = require('config')
const { v4: uuid } = require('uuid')

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.bulkInsert({ tableName: 'roles', schema: config.DB_SCHEMA_NAME }, [{
id: uuid(),
name: 'Custom',
rates: [
{
"global": 1200,
"off_shore": 1200,
"in_country": 1200,
}
],
created_by: config.m2m.M2M_AUDIT_USER_ID,
created_at: new Date()
}], {}, { rates: { type: Sequelize.ARRAY({ type: Sequelize.JSONB() })}})
},
down: async (queryInterface) => {
await queryInterface.bulkDelete({ tableName: 'roles', schema: config.DB_SCHEMA_NAME }, { name: 'Custom' })
}
}
Loading