Skip to content

Commit aae8f75

Browse files
authored
Merge pull request #90 from yoution/feature/weekly-surveys
Send Weekly Surveys
2 parents f2480b5 + f846542 commit aae8f75

File tree

5 files changed

+22
-7
lines changed

5 files changed

+22
-7
lines changed

src/scripts/createIndex.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ async function createIndex () {
103103
status: { type: 'keyword' },
104104
startDate: { type: 'date', format: 'yyyy-MM-dd' },
105105
endDate: { type: 'date', format: 'yyyy-MM-dd' },
106+
sendWeeklySurvey: { type: 'boolean' },
106107
memberRate: { type: 'float' },
107108
customerRate: { type: 'float' },
108109
rateType: { type: 'keyword' },
@@ -116,6 +117,14 @@ async function createIndex () {
116117
normalizer: 'lowercaseNormalizer' },
117118
projectId: { type: 'integer' },
118119
userId: { type: 'keyword' },
120+
sentSurvey: { type: 'boolean' },
121+
sentSurveyError: {
122+
type: 'nested',
123+
properties: {
124+
errorCode: { type: 'integer' },
125+
errorMessage: { type: 'keyword' }
126+
}
127+
},
119128
startDate: { type: 'date', format: 'yyyy-MM-dd' },
120129
endDate: { type: 'date', format: 'yyyy-MM-dd' },
121130
daysWorked: { type: 'integer' },

src/services/JobCandidateProcessorService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ processCreate.schema = {
104104
updatedBy: Joi.string().uuid().allow(null),
105105
status: Joi.jobCandidateStatus().required(),
106106
externalId: Joi.string().allow(null),
107-
resume: Joi.string().uri().allow(null).allow(""),
108-
remark: Joi.stringAllowEmpty().allow(null),
107+
resume: Joi.string().uri().allow(null).allow(''),
108+
remark: Joi.stringAllowEmpty().allow(null)
109109
})
110110
.required()
111111
})

src/services/JobProcessorService.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ processCreate.schema = {
6565
topic: Joi.string().required(),
6666
originator: Joi.string().required(),
6767
timestamp: Joi.date().required(),
68-
"mime-type": Joi.string().required(),
68+
'mime-type': Joi.string().required(),
6969
payload: Joi.object()
7070
.keys({
7171
id: Joi.string().uuid().required(),
@@ -95,13 +95,13 @@ processCreate.schema = {
9595
currency: Joi.stringAllowEmpty().allow(null),
9696
roleIds: Joi.array()
9797
.items(Joi.string().uuid().required())
98-
.allow(null),
98+
.allow(null)
9999
})
100-
.required(),
100+
.required()
101101
})
102102
.required(),
103-
transactionId: Joi.string().required(),
104-
};
103+
transactionId: Joi.string().required()
104+
}
105105

106106
/**
107107
* Process update entity message

src/services/ResourceBookingProcessorService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ processCreate.schema = {
3737
id: Joi.string().uuid().required(),
3838
projectId: Joi.number().integer().required(),
3939
userId: Joi.string().uuid().required(),
40+
sendWeeklySurvey: Joi.boolean().required(),
4041
jobId: Joi.string().uuid().allow(null),
4142
startDate: Joi.string().regex(/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/).allow(null),
4243
endDate: Joi.string().regex(/^(19|20)\d\d-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])$/).allow(null),

src/services/WorkPeriodProcessorService.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ processCreate.schema = {
7272
projectId: Joi.number().integer().required(),
7373
startDate: Joi.string().required(),
7474
endDate: Joi.string().required(),
75+
sentSurvey: Joi.boolean().required(),
76+
sentSurveyError: Joi.object().keys({
77+
errorCode: Joi.number().integer().min(0),
78+
errorMessage: Joi.string()
79+
}).allow(null),
7580
daysWorked: Joi.number().integer().min(0).max(5).required(),
7681
daysPaid: Joi.number().integer().min(0).max(5).required(),
7782
paymentTotal: Joi.number().min(0).required(),

0 commit comments

Comments
 (0)