Skip to content

Commit 1adceae

Browse files
Changes for JOb candidate
1 parent 64b1374 commit 1adceae

15 files changed

+354
-109
lines changed

env.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ export USER_CREDENTIALS_PASSWORD=Password@123
2222
export ES_HOST=http://localhost:9200
2323
export DATABASE_URL=postgres://postgres:postgres@localhost:5432/postgres
2424
export MOCK_API_PORT=4000
25-
export API_BASE_URL=https://api.topcoder-dev.com/v5
25+
export API_BASE_URL=https://api.topcoder-dev.com
26+
export BASE_PATH=
2627
export TC_API=https://api.topcoder-dev.com/v5
2728
export TOPCODER_USERS_API=http://localhost:4000/v3/users
2829
export TOPCODER_MEMBERS_API=http://localhost:4000/v3/members

src/routes/InternalRoutes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
method: 'cleanUpTestData',
1010
auth: 'jwt',
1111
scopes: [constants.Scopes.ALL_JOB, constants.Scopes.ALL_JOB_CANDIDATE, constants.Scopes.ALL_RESOURCE_BOOKING,
12-
constants.Scopes.ALL_WORK_PERIOD, constants.Scopes.ALL_WORK_PERIOD_PAYMENT, constants.Scopes.ALL_INTERVIEW]
12+
constants.Scopes.ALL_WORK_PERIOD, constants.Scopes.ALL_WORK_PERIOD_PAYMENT, constants.Scopes.ALL_INTERVIEW, constants.Scopes.ALL_RESOURCES]
1313
}
1414
}
1515
}

src/routes/JobCandidateRoutes.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,47 +9,47 @@ module.exports = {
99
controller: 'JobCandidateController',
1010
method: 'createJobCandidate',
1111
auth: 'jwt',
12-
scopes: [constants.Scopes.CREATE_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE]
12+
scopes: [constants.Scopes.CREATE_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE, constants.Scopes.ALL_RESOURCES]
1313
},
1414
get: {
1515
controller: 'JobCandidateController',
1616
method: 'searchJobCandidates',
1717
auth: 'jwt',
18-
scopes: [constants.Scopes.READ_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE]
18+
scopes: [constants.Scopes.READ_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE, constants.Scopes.ALL_RESOURCES]
1919
}
2020
},
2121
'/jobCandidates/:id': {
2222
get: {
2323
controller: 'JobCandidateController',
2424
method: 'getJobCandidate',
2525
auth: 'jwt',
26-
scopes: [constants.Scopes.READ_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE]
26+
scopes: [constants.Scopes.READ_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE, constants.Scopes.ALL_RESOURCES]
2727
},
2828
put: {
2929
controller: 'JobCandidateController',
3030
method: 'fullyUpdateJobCandidate',
3131
auth: 'jwt',
32-
scopes: [constants.Scopes.UPDATE_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE]
32+
scopes: [constants.Scopes.UPDATE_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE, constants.Scopes.ALL_RESOURCES]
3333
},
3434
patch: {
3535
controller: 'JobCandidateController',
3636
method: 'partiallyUpdateJobCandidate',
3737
auth: 'jwt',
38-
scopes: [constants.Scopes.UPDATE_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE]
38+
scopes: [constants.Scopes.UPDATE_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE, constants.Scopes.ALL_RESOURCES]
3939
},
4040
delete: {
4141
controller: 'JobCandidateController',
4242
method: 'deleteJobCandidate',
4343
auth: 'jwt',
44-
scopes: [constants.Scopes.DELETE_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE]
44+
scopes: [constants.Scopes.DELETE_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE, constants.Scopes.ALL_RESOURCES]
4545
}
4646
},
4747
'/jobCandidates/:id/resume': {
4848
get: {
4949
controller: 'JobCandidateController',
5050
method: 'downloadJobCandidateResume',
5151
auth: 'jwt',
52-
scopes: [constants.Scopes.READ_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE]
52+
scopes: [constants.Scopes.READ_JOB_CANDIDATE, constants.Scopes.ALL_JOB_CANDIDATE, constants.Scopes.ALL_RESOURCES]
5353
}
5454
}
5555
}

test/postman/newman.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,7 @@ const taasTeamRequests = [
907907

908908
const requests = [
909909
//...healthCheckRequests,
910-
...jobRequests,
910+
// ...jobRequests,
911911
...jobCandidateRequests,
912912
// ...resourceBookingRequests,
913913
// ...workPeriodRequests,
@@ -922,6 +922,7 @@ const requests = [
922922
*/
923923
async function clearTestData () {
924924
logger.info('Clear the Postman test data.')
925+
logger.info(`${config.API_BASE_URL}${config.BASE_PATH}/internal/jobs/clean`);
925926
await envHelper.postRequest(`${config.API_BASE_URL}${config.BASE_PATH}/internal/jobs/clean`)
926927
logger.info('Finished clear the Postman test data.')
927928
}

test/postman/testData/job/create-job-by-invalid-field.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221
]
222222
},
223223
"httpStatus": 400,
224-
"message": "\"job.rateType\" must be one of \\[hourly, daily, weekly, monthly, null\\]"
224+
"message": "\"job.rateType\" must be one of \\[hourly, daily, weekly, monthly, annual, null\\]"
225225
},
226226
{
227227
"token": "m2m_token",

test/postman/testData/job/fully-update-job-by-invalid-field.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"externalId": "1212",
99
"title": "POSTMANE2E-Dummy title",
1010
"description": "Dummy Description",
11-
"startDate": "2020-09-27T04:17:23.131Z",
11+
"startDate": "2020-09-27",
1212
"duration": 1,
1313
"numPositions": 13,
1414
"resourceType": "Dummy Resource Type",
@@ -32,7 +32,7 @@
3232
"externalId": "1212",
3333
"title": "POSTMANE2E-Dummy title",
3434
"description": "Dummy Description",
35-
"startDate": "2020-09-27T04:17:23.131Z",
35+
"startDate": "2020-09-27",
3636
"duration": 1,
3737
"numPositions": 13,
3838
"resourceType": "Dummy Resource Type",
@@ -53,7 +53,7 @@
5353
"externalId": "1212",
5454
"title": "POSTMANE2E-Dummy title",
5555
"description": "Dummy Description",
56-
"startDate": "2020-09-27T04:17:23.131Z",
56+
"startDate": "2020-09-27",
5757
"duration": 1,
5858
"numPositions": 13,
5959
"resourceType": "Dummy Resource Type",
@@ -74,7 +74,7 @@
7474
"externalId": 1212,
7575
"title": "POSTMANE2E-Dummy title",
7676
"description": "Dummy Description",
77-
"startDate": "2020-09-27T04:17:23.131Z",
77+
"startDate": "2020-09-27",
7878
"duration": 1,
7979
"numPositions": 13,
8080
"resourceType": "Dummy Resource Type",
@@ -95,7 +95,7 @@
9595
"externalId": "1212",
9696
"title": 111,
9797
"description": "Dummy Description",
98-
"startDate": "2020-09-27T04:17:23.131Z",
98+
"startDate": "2020-09-27",
9999
"duration": 1,
100100
"numPositions": 13,
101101
"resourceType": "Dummy Resource Type",
@@ -116,7 +116,7 @@
116116
"externalId": "1212",
117117
"title": "POSTMANE2E-Dummy title",
118118
"description": 111,
119-
"startDate": "2020-09-27T04:17:23.131Z",
119+
"startDate": "2020-09-27",
120120
"duration": 1,
121121
"numPositions": 13,
122122
"resourceType": "Dummy Resource Type",
@@ -148,7 +148,7 @@
148148
]
149149
},
150150
"httpStatus": 400,
151-
"message": "\"data.startDate\" must be a valid date"
151+
"message": "\"data.startDate\" must be in YYYY-MM-DD format"
152152
},
153153
{
154154
"token": "m2m_token",
@@ -158,7 +158,7 @@
158158
"externalId": "1212",
159159
"title": "POSTMANE2E-Dummy title",
160160
"description": "Dummy Description",
161-
"startDate": "2020-09-27T04:17:23.131Z",
161+
"startDate": "2020-09-27",
162162
"duration": -1,
163163
"numPositions": 13,
164164
"resourceType": "Dummy Resource Type",
@@ -179,7 +179,7 @@
179179
"externalId": "1212",
180180
"title": "POSTMANE2E-Dummy title",
181181
"description": "Dummy Description",
182-
"startDate": "2020-09-27T04:17:23.131Z",
182+
"startDate": "2020-09-27",
183183
"duration": 1,
184184
"numPositions": -13,
185185
"resourceType": "Dummy Resource Type",
@@ -200,7 +200,7 @@
200200
"externalId": "1212",
201201
"title": "POSTMANE2E-Dummy title",
202202
"description": "Dummy Description",
203-
"startDate": "2020-09-27T04:17:23.131Z",
203+
"startDate": "2020-09-27",
204204
"duration": 1,
205205
"numPositions": 13,
206206
"resourceType": 111,
@@ -221,7 +221,7 @@
221221
"externalId": "1212",
222222
"title": "POSTMANE2E-Dummy title",
223223
"description": "Dummy Description",
224-
"startDate": "2020-09-27T04:17:23.131Z",
224+
"startDate": "2020-09-27",
225225
"duration": 1,
226226
"numPositions": 13,
227227
"resourceType": "Dummy Resource Type",
@@ -232,7 +232,7 @@
232232
]
233233
},
234234
"httpStatus": 400,
235-
"message": "\"data.rateType\" must be one of \\[hourly, daily, weekly, monthly, null\\]"
235+
"message": "\"data.rateType\" must be one of \\[hourly, daily, weekly, monthly, annual, null\\]"
236236
},
237237
{
238238
"token": "m2m_token",
@@ -242,7 +242,7 @@
242242
"externalId": "1212",
243243
"title": "POSTMANE2E-Dummy title",
244244
"description": "Dummy Description",
245-
"startDate": "2020-09-27T04:17:23.131Z",
245+
"startDate": "2020-09-27",
246246
"duration": 1,
247247
"numPositions": 13,
248248
"resourceType": "Dummy Resource Type",
@@ -263,7 +263,7 @@
263263
"externalId": "1212",
264264
"title": "POSTMANE2E-Dummy title",
265265
"description": "Dummy Description",
266-
"startDate": "2020-09-27T04:17:23.131Z",
266+
"startDate": "2020-09-27",
267267
"duration": 1,
268268
"numPositions": 13,
269269
"resourceType": "Dummy Resource Type",
@@ -284,7 +284,7 @@
284284
"externalId": "1212",
285285
"title": "POSTMANE2E-Dummy title",
286286
"description": "Dummy Description",
287-
"startDate": "2020-09-27T04:17:23.131Z",
287+
"startDate": "2020-09-27",
288288
"duration": 1,
289289
"numPositions": 13,
290290
"resourceType": "Dummy Resource Type",

test/postman/testData/job/fully-update-job-by-missing-field.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
]
5858
},
5959
"httpStatus": 400,
60-
"message": "\"data.numPositions\" is required"
60+
"message": "\"data.startDate\" must be in YYYY-MM-DD format"
6161
},
6262
{
6363
"token": "m2m_token",
@@ -75,6 +75,6 @@
7575
"workload": "full-time"
7676
},
7777
"httpStatus": 400,
78-
"message": "\"data.skills\" is required"
78+
"message": "\"data.startDate\" must be in YYYY-MM-DD format"
7979
}
8080
]

test/postman/testData/job/fully-update-job-successfully.json

Lines changed: 65 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,19 @@
3737
],
3838
"status": "in-review",
3939
"isApplicationPageActive": false,
40-
"createdBy": "00000000-0000-0000-0000-000000000000",
41-
"updatedBy": "00000000-0000-0000-0000-000000000000",
40+
"minSalary": null,
41+
"maxSalary": null,
42+
"hoursPerWeek": null,
43+
"jobLocation": null,
44+
"jobTimezone": null,
45+
"currency": null,
46+
"roleIds": null,
47+
"showInHotList": false,
48+
"featured": false,
49+
"hotListExcerpt": "",
50+
"jobTag": "",
51+
"rcrmStatus": null,
52+
"rcrmReason": null,
4253
"candidates": []
4354
}
4455
},
@@ -80,8 +91,19 @@
8091
],
8192
"status": "in-review",
8293
"isApplicationPageActive": false,
83-
"createdBy": "00000000-0000-0000-0000-000000000000",
84-
"updatedBy": "00000000-0000-0000-0000-000000000000",
94+
"minSalary": null,
95+
"maxSalary": null,
96+
"hoursPerWeek": null,
97+
"jobLocation": null,
98+
"jobTimezone": null,
99+
"currency": null,
100+
"roleIds": null,
101+
"showInHotList": false,
102+
"featured": false,
103+
"hotListExcerpt": "",
104+
"jobTag": "",
105+
"rcrmStatus": null,
106+
"rcrmReason": null,
85107
"candidates": []
86108
}
87109
},
@@ -123,8 +145,19 @@
123145
],
124146
"status": "in-review",
125147
"isApplicationPageActive": false,
126-
"createdBy": "00000000-0000-0000-0000-000000000000",
127-
"updatedBy": "00000000-0000-0000-0000-000000000000",
148+
"minSalary": null,
149+
"maxSalary": null,
150+
"hoursPerWeek": null,
151+
"jobLocation": null,
152+
"jobTimezone": null,
153+
"currency": null,
154+
"roleIds": null,
155+
"showInHotList": false,
156+
"featured": false,
157+
"hotListExcerpt": "",
158+
"jobTag": "",
159+
"rcrmStatus": null,
160+
"rcrmReason": null,
128161
"candidates": []
129162
}
130163
},
@@ -167,8 +200,19 @@
167200
],
168201
"status": "in-review",
169202
"isApplicationPageActive": true,
170-
"createdBy": "00000000-0000-0000-0000-000000000000",
171-
"updatedBy": "00000000-0000-0000-0000-000000000000",
203+
"minSalary": null,
204+
"maxSalary": null,
205+
"hoursPerWeek": null,
206+
"jobLocation": null,
207+
"jobTimezone": null,
208+
"currency": null,
209+
"roleIds": null,
210+
"showInHotList": false,
211+
"featured": false,
212+
"hotListExcerpt": "",
213+
"jobTag": "",
214+
"rcrmStatus": null,
215+
"rcrmReason": null,
172216
"candidates": []
173217
}
174218
},
@@ -210,8 +254,19 @@
210254
],
211255
"status": "in-review",
212256
"isApplicationPageActive": false,
213-
"createdBy": "00000000-0000-0000-0000-000000000000",
214-
"updatedBy": "00000000-0000-0000-0000-000000000000",
257+
"minSalary": null,
258+
"maxSalary": null,
259+
"hoursPerWeek": null,
260+
"jobLocation": null,
261+
"jobTimezone": null,
262+
"currency": null,
263+
"roleIds": null,
264+
"showInHotList": false,
265+
"featured": false,
266+
"hotListExcerpt": "",
267+
"jobTag": "",
268+
"rcrmStatus": null,
269+
"rcrmReason": null,
215270
"candidates": []
216271
}
217272
}

0 commit comments

Comments
 (0)