Skip to content

Commit 25377f4

Browse files
Merge pull request #1 from imcaizheng/add-workload-field
add workload field to joi schemas in JobService
2 parents 6a8099b + 9cebcf8 commit 25377f4

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

src/bootstrap.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ global.Promise = require('bluebird')
55
Joi.rateType = () => Joi.string().valid('hourly', 'daily', 'weekly', 'monthly')
66
Joi.jobStatus = () => Joi.string().valid('sourcing', 'in-review', 'assigned', 'closed', 'cancelled')
77
Joi.jobCandidateStatus = () => Joi.string().valid('open', 'selected', 'shortlist', 'rejected')
8+
Joi.workload = () => Joi.string().valid('full-time', 'fractional')

src/scripts/createIndex.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ async function createIndex () {
2323
numPositions: { type: 'integer' },
2424
resourceType: { type: 'keyword' },
2525
rateType: { type: 'keyword' },
26+
workload: { type: 'keyword' },
2627
skills: { type: 'keyword' },
2728
status: { type: 'keyword' },
2829
createdAt: { type: 'date' },

src/services/JobProcessorService.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ processCreate.schema = {
4343
numPositions: Joi.number().integer().min(1).required(),
4444
resourceType: Joi.string().required(),
4545
rateType: Joi.rateType(),
46+
workload: Joi.workload(),
4647
skills: Joi.array().items(Joi.string().uuid()).required(),
4748
createdAt: Joi.date().required(),
4849
createdBy: Joi.string().uuid().required(),
@@ -86,6 +87,7 @@ processUpdate.schema = {
8687
numPositions: Joi.number().integer().min(1),
8788
resourceType: Joi.string(),
8889
rateType: Joi.rateType(),
90+
workload: Joi.workload(),
8991
skills: Joi.array().items(Joi.string().uuid()),
9092
status: Joi.jobStatus(),
9193
updatedAt: Joi.date(),

0 commit comments

Comments
 (0)