Skip to content

Commit 7370849

Browse files
author
dengjun
committed
api-updates challenge:30186701
1 parent 1db6efc commit 7370849

9 files changed

+35
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,4 @@
6060
"test/e2e/*.js"
6161
]
6262
}
63-
}
63+
}

src/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ global.Promise = require('bluebird')
1212
Joi.rateType = () => Joi.string().valid('hourly', 'daily', 'weekly', 'monthly')
1313
Joi.jobStatus = () => Joi.string().valid('sourcing', 'in-review', 'assigned', 'closed', 'cancelled')
1414
Joi.resourceBookingStatus = () => Joi.string().valid('placed', 'closed', 'cancelled')
15-
Joi.jobCandidateStatus = () => Joi.string().valid('open', 'placed', 'selected', 'client rejected - screening', 'client rejected - interview', 'rejected - other', 'cancelled', 'interview', 'topcoder-rejected','applied','rejected-pre-screen','skills-test','skills-test','phone-screen','job-closed','offered')
15+
Joi.jobCandidateStatus = () => Joi.string().valid('open', 'placed', 'selected', 'client rejected - screening', 'client rejected - interview', 'rejected - other', 'cancelled', 'interview', 'topcoder-rejected', 'applied', 'rejected-pre-screen', 'skills-test', 'skills-test', 'phone-screen', 'job-closed', 'offered')
1616
Joi.workload = () => Joi.string().valid('full-time', 'fractional')
1717
Joi.title = () => Joi.string().max(128)
1818
Joi.paymentStatus = () => Joi.string().valid('pending', 'partially-completed', 'completed', 'cancelled')

src/scripts/createIndex.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ async function createIndex () {
2828
skills: { type: 'keyword' },
2929
status: { type: 'keyword' },
3030
isApplicationPageActive: { type: 'boolean' },
31+
minSalary: { type: 'integer' },
32+
maxSalary: { type: 'integer' },
33+
hoursPerWeek: { type: 'integer' },
34+
jobLocation: { type: 'keyword' },
35+
jobTimezone: { type: 'keyword' },
36+
currency: { type: 'keyword' },
3137
createdAt: { type: 'date' },
3238
createdBy: { type: 'keyword' },
3339
updatedAt: { type: 'date' },
@@ -46,6 +52,7 @@ async function createIndex () {
4652
status: { type: 'keyword' },
4753
externalId: { type: 'keyword' },
4854
resume: { type: 'text' },
55+
remark: { type: 'keyword' },
4956
interviews: {
5057
type: 'nested',
5158
properties: {

src/services/JobCandidateProcessorService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ processCreate.schema = {
101101
updatedBy: Joi.string().uuid().allow(null),
102102
status: Joi.jobCandidateStatus().required(),
103103
externalId: Joi.string().allow(null),
104-
resume: Joi.string().uri().allow(null)
104+
resume: Joi.string().uri().allow(null),
105+
remark: Joi.string().allow(null)
105106
}).required()
106107
}).required(),
107108
transactionId: Joi.string().required()

src/services/JobProcessorService.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,13 @@ processCreate.schema = {
8383
updatedAt: Joi.date().allow(null),
8484
updatedBy: Joi.string().uuid().allow(null),
8585
status: Joi.jobStatus().required(),
86-
isApplicationPageActive: Joi.boolean().required()
86+
isApplicationPageActive: Joi.boolean().required(),
87+
minSalary: Joi.number().integer().required(),
88+
maxSalary: Joi.number().integer().required(),
89+
hoursPerWeek: Joi.number().integer().required(),
90+
jobLocation: Joi.string().required(),
91+
jobTimezone: Joi.string().required(),
92+
currency: Joi.string().required()
8793
}).required()
8894
}).required(),
8995
transactionId: Joi.string().required()

test/messages/taas.job.create.event.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
"createdAt": "2020-11-05T19:00:16.268Z",
2525
"createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
2626
"status": "sourcing",
27-
"isApplicationPageActive": false
27+
"isApplicationPageActive": false,
28+
"minSalary": 100,
29+
"maxSalary": 200,
30+
"hoursPerWeek": 20,
31+
"jobLocation": "Any location",
32+
"jobTimezone": "GMT",
33+
"currency": "USD"
2834
}
2935
}

test/messages/taas.job.update.event.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@
2323
"updatedBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
2424
"createdAt": "2020-11-05T19:00:16.268Z",
2525
"createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
26-
"isApplicationPageActive": false
26+
"isApplicationPageActive": false,
27+
"minSalary": 100,
28+
"maxSalary": 200,
29+
"hoursPerWeek": 20,
30+
"jobLocation": "Any location",
31+
"jobTimezone": "GMT",
32+
"currency": "USD"
2733
}
2834
}

test/messages/taas.jobcandidate.create.event.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"id": "0cb99adb-8bcd-4952-9203-9867dd45ef6f",
1010
"createdAt": "2020-11-05T19:00:19.052Z",
1111
"createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
12-
"status": "open"
12+
"status": "open",
13+
"remark": "excellent"
1314
}
1415
}

test/messages/taas.jobcandidate.update.event.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"jobId": "ffbc24f7-301e-48d3-bf01-c056916056a2",
99
"userId": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
1010
"status": "selected",
11+
"remark": "excellent",
1112
"updatedAt": "2020-11-05T19:00:21.625Z",
1213
"updatedBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
1314
"createdAt": "2020-11-05T19:00:16.268Z",

0 commit comments

Comments
 (0)