From 181960f7c4d34e1512822725e24d963f3197ca20 Mon Sep 17 00:00:00 2001 From: imcaizheng Date: Tue, 26 Jan 2021 15:17:32 +0800 Subject: [PATCH] include a new duration field --- src/scripts/createIndex.js | 2 ++ src/services/JobProcessorService.js | 2 ++ src/services/ResourceBookingProcessorService.js | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/scripts/createIndex.js b/src/scripts/createIndex.js index 4edce30..50f7ba1 100644 --- a/src/scripts/createIndex.js +++ b/src/scripts/createIndex.js @@ -21,6 +21,7 @@ async function createIndex () { title: { type: 'text' }, startDate: { type: 'date' }, endDate: { type: 'date' }, + duration: { type: 'integer' }, numPositions: { type: 'integer' }, resourceType: { type: 'keyword' }, rateType: { type: 'keyword' }, @@ -64,6 +65,7 @@ async function createIndex () { status: { type: 'keyword' }, startDate: { type: 'date' }, endDate: { type: 'date' }, + duration: { type: 'integer' }, memberRate: { type: 'float' }, customerRate: { type: 'float' }, rateType: { type: 'keyword' }, diff --git a/src/services/JobProcessorService.js b/src/services/JobProcessorService.js index 72131ed..dbfce90 100644 --- a/src/services/JobProcessorService.js +++ b/src/services/JobProcessorService.js @@ -74,6 +74,7 @@ processCreate.schema = { title: Joi.title().required(), startDate: Joi.date(), endDate: Joi.date(), + duration: Joi.number().integer().min(1), numPositions: Joi.number().integer().min(1).required(), resourceType: Joi.string(), rateType: Joi.rateType(), @@ -123,6 +124,7 @@ processUpdate.schema = { title: Joi.title(), startDate: Joi.date(), endDate: Joi.date(), + duration: Joi.number().integer().min(1), numPositions: Joi.number().integer().min(1), resourceType: Joi.string(), rateType: Joi.rateType(), diff --git a/src/services/ResourceBookingProcessorService.js b/src/services/ResourceBookingProcessorService.js index 23b1de3..f7a77b6 100644 --- a/src/services/ResourceBookingProcessorService.js +++ b/src/services/ResourceBookingProcessorService.js @@ -40,6 +40,7 @@ processCreate.schema = { jobId: Joi.string().uuid(), startDate: Joi.date(), endDate: Joi.date(), + duration: Joi.number().integer().min(1), memberRate: Joi.number(), customerRate: Joi.number(), rateType: Joi.rateType().required(), @@ -82,6 +83,7 @@ processUpdate.schema = { jobId: Joi.string().uuid(), startDate: Joi.date(), endDate: Joi.date(), + duration: Joi.number().integer().min(1), memberRate: Joi.number(), customerRate: Joi.number(), rateType: Joi.rateType(),