Skip to content

Commit 533b68f

Browse files
authored
Merge pull request #312 from eisbilir/role-matching-backend
Role matching backend
2 parents 57cb38a + 49926fe commit 533b68f

13 files changed

+678
-104
lines changed

app-constants.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ const ChallengeStatus = {
8484
COMPLETED: 'Completed'
8585
}
8686

87-
const PaymentProcessingSwitch = {
88-
ON: 'ON',
89-
OFF: 'OFF'
87+
const WorkPeriodPaymentStatus = {
88+
COMPLETED: 'completed',
89+
CANCELLED: 'cancelled',
90+
SCHEDULED: 'scheduled'
9091
}
9192

9293
module.exports = {
@@ -95,5 +96,5 @@ module.exports = {
9596
Scopes,
9697
Interviews,
9798
ChallengeStatus,
98-
PaymentProcessingSwitch
99+
WorkPeriodPaymentStatus
99100
}

config/default.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,6 @@ module.exports = {
170170
TYPE_ID_TASK: process.env.TYPE_ID_TASK || 'ecd58c69-238f-43a4-a4bb-d172719b9f31',
171171
DEFAULT_TIMELINE_TEMPLATE_ID: process.env.DEFAULT_TIMELINE_TEMPLATE_ID || '53a307ce-b4b3-4d6f-b9a1-3741a58f77e6',
172172
DEFAULT_TRACK_ID: process.env.DEFAULT_TRACK_ID || '9b6fc876-f4d9-4ccb-9dfd-419247628825',
173-
174-
PAYMENT_PROCESSING_SWITCH: process.env.PAYMENT_PROCESSING_SWITCH || 'OFF',
175173
// the minimum matching rate when searching roles by skills
176174
ROLE_MATCHING_RATE: process.env.ROLE_MATCHING_RATE || 0.70,
177175
// member groups representing Wipro or TopCoder employee

docs/Topcoder-bookings-api.postman_collection.json

Lines changed: 282 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16907,6 +16907,55 @@
1690716907
},
1690816908
"response": []
1690916909
},
16910+
{
16911+
"name": "create work period2",
16912+
"event": [
16913+
{
16914+
"listen": "test",
16915+
"script": {
16916+
"exec": [
16917+
"pm.test('Status code is 200', function () {\r",
16918+
" pm.response.to.have.status(200);\r",
16919+
" if(pm.response.status === \"OK\"){\r",
16920+
" const response = pm.response.json()\r",
16921+
" pm.environment.set(\"workPeriodId2\", response.id);\r",
16922+
" }\r",
16923+
"});"
16924+
],
16925+
"type": "text/javascript"
16926+
}
16927+
}
16928+
],
16929+
"request": {
16930+
"method": "POST",
16931+
"header": [
16932+
{
16933+
"key": "Authorization",
16934+
"type": "text",
16935+
"value": "Bearer {{token_bookingManager}}"
16936+
}
16937+
],
16938+
"body": {
16939+
"mode": "raw",
16940+
"raw": "{\r\n \"resourceBookingId\": \"{{resourceBookingId}}\",\r\n \"startDate\": \"2021-03-14\",\r\n \"endDate\": \"2021-03-20\",\r\n \"daysWorked\": 2,\r\n \"memberRate\": 13.13,\r\n \"customerRate\": 13.13,\r\n \"paymentStatus\": \"pending\"\r\n}",
16941+
"options": {
16942+
"raw": {
16943+
"language": "json"
16944+
}
16945+
}
16946+
},
16947+
"url": {
16948+
"raw": "{{URL}}/work-periods",
16949+
"host": [
16950+
"{{URL}}"
16951+
],
16952+
"path": [
16953+
"work-periods"
16954+
]
16955+
}
16956+
},
16957+
"response": []
16958+
},
1691016959
{
1691116960
"name": "create work period with m2m",
1691216961
"event": [
@@ -17007,6 +17056,97 @@
1700717056
},
1700817057
"response": []
1700917058
},
17059+
{
17060+
"name": "create multiple work period payments with boooking manager",
17061+
"event": [
17062+
{
17063+
"listen": "test",
17064+
"script": {
17065+
"exec": [
17066+
"pm.test('Status code is 200', function () {\r",
17067+
" pm.response.to.have.status(200);\r",
17068+
"});"
17069+
],
17070+
"type": "text/javascript"
17071+
}
17072+
}
17073+
],
17074+
"request": {
17075+
"method": "POST",
17076+
"header": [
17077+
{
17078+
"key": "Authorization",
17079+
"type": "text",
17080+
"value": "Bearer {{token_bookingManager}}"
17081+
}
17082+
],
17083+
"body": {
17084+
"mode": "raw",
17085+
"raw": "[{\r\n \"workPeriodId\": \"{{workPeriodId}}\",\r\n \"amount\": 600\r\n},{\r\n \"workPeriodId\": \"{{workPeriodId2}}\",\r\n \"amount\": 900\r\n}]",
17086+
"options": {
17087+
"raw": {
17088+
"language": "json"
17089+
}
17090+
}
17091+
},
17092+
"url": {
17093+
"raw": "{{URL}}/work-period-payments",
17094+
"host": [
17095+
"{{URL}}"
17096+
],
17097+
"path": [
17098+
"work-period-payments"
17099+
]
17100+
}
17101+
},
17102+
"response": []
17103+
},
17104+
{
17105+
"name": "create query work period payments with boooking manager",
17106+
"event": [
17107+
{
17108+
"listen": "test",
17109+
"script": {
17110+
"exec": [
17111+
"pm.test('Status code is 200', function () {\r",
17112+
" pm.response.to.have.status(200);\r",
17113+
"});"
17114+
],
17115+
"type": "text/javascript"
17116+
}
17117+
}
17118+
],
17119+
"request": {
17120+
"method": "POST",
17121+
"header": [
17122+
{
17123+
"key": "Authorization",
17124+
"type": "text",
17125+
"value": "Bearer {{token_bookingManager}}"
17126+
}
17127+
],
17128+
"body": {
17129+
"mode": "raw",
17130+
"raw": "{\"query\": { \"workPeriods.paymentStatus\": \"pending\" } }",
17131+
"options": {
17132+
"raw": {
17133+
"language": "json"
17134+
}
17135+
}
17136+
},
17137+
"url": {
17138+
"raw": "{{URL}}/work-period-payments/query",
17139+
"host": [
17140+
"{{URL}}"
17141+
],
17142+
"path": [
17143+
"work-period-payments",
17144+
"query"
17145+
]
17146+
}
17147+
},
17148+
"response": []
17149+
},
1701017150
{
1701117151
"name": "create work period payment with m2m create",
1701217152
"event": [
@@ -29066,6 +29206,52 @@
2906629206
},
2906729207
"response": []
2906829208
},
29209+
{
29210+
"name": "✔ create multiple work period payment with administrator",
29211+
"event": [
29212+
{
29213+
"listen": "test",
29214+
"script": {
29215+
"exec": [
29216+
"pm.test('Status code is 200', function () {\r",
29217+
" pm.response.to.have.status(200);\r",
29218+
"});"
29219+
],
29220+
"type": "text/javascript"
29221+
}
29222+
}
29223+
],
29224+
"request": {
29225+
"method": "POST",
29226+
"header": [
29227+
{
29228+
"key": "Authorization",
29229+
"type": "text",
29230+
"value": "Bearer {{token_administrator}}"
29231+
}
29232+
],
29233+
"body": {
29234+
"mode": "raw",
29235+
"raw": "{\"query\": { \"workPeriods.paymentStatus\": \"pending\" } }",
29236+
"options": {
29237+
"raw": {
29238+
"language": "json"
29239+
}
29240+
}
29241+
},
29242+
"url": {
29243+
"raw": "{{URL}}/work-period-payments/query",
29244+
"host": [
29245+
"{{URL}}"
29246+
],
29247+
"path": [
29248+
"work-period-payments",
29249+
"query"
29250+
]
29251+
}
29252+
},
29253+
"response": []
29254+
},
2906929255
{
2907029256
"name": "✔ get work period payment with administrator",
2907129257
"event": [
@@ -31518,6 +31704,54 @@
3151831704
},
3151931705
"response": []
3152031706
},
31707+
{
31708+
"name": "✘ create query work period payment with member",
31709+
"event": [
31710+
{
31711+
"listen": "test",
31712+
"script": {
31713+
"exec": [
31714+
"pm.test('Status code is 403', function () {\r",
31715+
" pm.response.to.have.status(403);\r",
31716+
" const response = pm.response.json()\r",
31717+
" pm.expect(response.message).to.eq(\"You are not allowed to perform this action!\")\r",
31718+
"});"
31719+
],
31720+
"type": "text/javascript"
31721+
}
31722+
}
31723+
],
31724+
"request": {
31725+
"method": "POST",
31726+
"header": [
31727+
{
31728+
"key": "Authorization",
31729+
"type": "text",
31730+
"value": "Bearer {{token_member_tester1234}}"
31731+
}
31732+
],
31733+
"body": {
31734+
"mode": "raw",
31735+
"raw": "{\"query\": { \"workPeriods.paymentStatus\": \"pending\" } }",
31736+
"options": {
31737+
"raw": {
31738+
"language": "json"
31739+
}
31740+
}
31741+
},
31742+
"url": {
31743+
"raw": "{{URL}}/work-period-payments/query",
31744+
"host": [
31745+
"{{URL}}"
31746+
],
31747+
"path": [
31748+
"work-period-payments",
31749+
"query"
31750+
]
31751+
}
31752+
},
31753+
"response": []
31754+
},
3152131755
{
3152231756
"name": "✘ get work period payment with member",
3152331757
"event": [
@@ -34032,6 +34266,54 @@
3403234266
},
3403334267
"response": []
3403434268
},
34269+
{
34270+
"name": "✘ create query work period payment with connect manager",
34271+
"event": [
34272+
{
34273+
"listen": "test",
34274+
"script": {
34275+
"exec": [
34276+
"pm.test('Status code is 403', function () {\r",
34277+
" pm.response.to.have.status(403);\r",
34278+
" const response = pm.response.json()\r",
34279+
" pm.expect(response.message).to.eq(\"You are not allowed to perform this action!\")\r",
34280+
"});"
34281+
],
34282+
"type": "text/javascript"
34283+
}
34284+
}
34285+
],
34286+
"request": {
34287+
"method": "POST",
34288+
"header": [
34289+
{
34290+
"key": "Authorization",
34291+
"type": "text",
34292+
"value": "Bearer {{token_connect_manager_pshahcopmanag2}}"
34293+
}
34294+
],
34295+
"body": {
34296+
"mode": "raw",
34297+
"raw": "{\"query\": { \"workPeriods.paymentStatus\": \"pending\" } }",
34298+
"options": {
34299+
"raw": {
34300+
"language": "json"
34301+
}
34302+
}
34303+
},
34304+
"url": {
34305+
"raw": "{{URL}}/work-period-payments/query",
34306+
"host": [
34307+
"{{URL}}"
34308+
],
34309+
"path": [
34310+
"work-period-payments",
34311+
"query"
34312+
]
34313+
}
34314+
},
34315+
"response": []
34316+
},
3403534317
{
3403634318
"name": "✘ get work period payment with connect manager",
3403734319
"event": [

0 commit comments

Comments
 (0)