Skip to content

Commit ffc22bd

Browse files
committed
add title field to Job model
- update ES mapping for the Job index - update Joi schema
1 parent 0dfe906 commit ffc22bd

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
@@ -8,6 +8,7 @@ Joi.rateType = () => Joi.string().valid('hourly', 'daily', 'weekly', 'monthly')
88
Joi.jobStatus = () => Joi.string().valid('sourcing', 'in-review', 'assigned', 'closed', 'cancelled')
99
Joi.jobCandidateStatus = () => Joi.string().valid('open', 'selected', 'shortlist', 'rejected', 'cancelled')
1010
Joi.workload = () => Joi.string().valid('full-time', 'fractional')
11+
Joi.title = () => Joi.string().max(64)
1112

1213
const zapierSwitch = Joi.string().label('ZAPIER_SWITCH').valid(...Object.values(constants.Zapier.Switch))
1314

src/scripts/createIndex.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ async function createIndex () {
1818
projectId: { type: 'integer' },
1919
externalId: { type: 'keyword' },
2020
description: { type: 'text' },
21+
title: { type: 'text' },
2122
startDate: { type: 'date' },
2223
endDate: { type: 'date' },
2324
numPositions: { type: 'integer' },

src/services/JobProcessorService.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ processCreate.schema = {
4242
projectId: Joi.number().integer().required(),
4343
externalId: Joi.string().required(),
4444
description: Joi.string().required(),
45+
title: Joi.title().required(),
4546
startDate: Joi.date().required(),
4647
endDate: Joi.date().required(),
4748
numPositions: Joi.number().integer().min(1).required(),
@@ -90,6 +91,7 @@ processUpdate.schema = {
9091
projectId: Joi.number().integer(),
9192
externalId: Joi.string(),
9293
description: Joi.string(),
94+
title: Joi.title(),
9395
startDate: Joi.date(),
9496
endDate: Joi.date(),
9597
numPositions: Joi.number().integer().min(1),

0 commit comments

Comments
 (0)