Skip to content

Commit 6567ede

Browse files
authored
Merge pull request #16 from imcaizheng/add-duration-field
include a new duration field
2 parents 4bfd9c6 + 181960f commit 6567ede

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

src/scripts/createIndex.js

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ async function createIndex () {
2121
title: { type: 'text' },
2222
startDate: { type: 'date' },
2323
endDate: { type: 'date' },
24+
duration: { type: 'integer' },
2425
numPositions: { type: 'integer' },
2526
resourceType: { type: 'keyword' },
2627
rateType: { type: 'keyword' },
@@ -64,6 +65,7 @@ async function createIndex () {
6465
status: { type: 'keyword' },
6566
startDate: { type: 'date' },
6667
endDate: { type: 'date' },
68+
duration: { type: 'integer' },
6769
memberRate: { type: 'float' },
6870
customerRate: { type: 'float' },
6971
rateType: { type: 'keyword' },

src/services/JobProcessorService.js

+2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ processCreate.schema = {
7474
title: Joi.title().required(),
7575
startDate: Joi.date(),
7676
endDate: Joi.date(),
77+
duration: Joi.number().integer().min(1),
7778
numPositions: Joi.number().integer().min(1).required(),
7879
resourceType: Joi.string(),
7980
rateType: Joi.rateType(),
@@ -123,6 +124,7 @@ processUpdate.schema = {
123124
title: Joi.title(),
124125
startDate: Joi.date(),
125126
endDate: Joi.date(),
127+
duration: Joi.number().integer().min(1),
126128
numPositions: Joi.number().integer().min(1),
127129
resourceType: Joi.string(),
128130
rateType: Joi.rateType(),

src/services/ResourceBookingProcessorService.js

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ processCreate.schema = {
4040
jobId: Joi.string().uuid(),
4141
startDate: Joi.date(),
4242
endDate: Joi.date(),
43+
duration: Joi.number().integer().min(1),
4344
memberRate: Joi.number(),
4445
customerRate: Joi.number(),
4546
rateType: Joi.rateType().required(),
@@ -82,6 +83,7 @@ processUpdate.schema = {
8283
jobId: Joi.string().uuid(),
8384
startDate: Joi.date(),
8485
endDate: Joi.date(),
86+
duration: Joi.number().integer().min(1),
8587
memberRate: Joi.number(),
8688
customerRate: Joi.number(),
8789
rateType: Joi.rateType(),

0 commit comments

Comments
 (0)