Skip to content

Commit 22a63bc

Browse files
Merge pull request #81 from topcoder-platform/feature/work-periods-automation
Work periods automation
2 parents d441c54 + 11264cb commit 22a63bc

File tree

4 files changed

+12
-6
lines changed

4 files changed

+12
-6
lines changed

src/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Joi.resourceBookingStatus = () => Joi.string().valid('placed', 'closed', 'cancel
1515
Joi.jobCandidateStatus = () => Joi.string().valid('open', 'placed', 'selected', 'client rejected - screening', 'client rejected - interview', 'rejected - other', 'cancelled', 'interview', 'topcoder-rejected', 'applied', 'rejected-pre-screen', 'skills-test', 'skills-test', 'phone-screen', 'job-closed', 'offered')
1616
Joi.workload = () => Joi.string().valid('full-time', 'fractional')
1717
Joi.title = () => Joi.string().max(128)
18-
Joi.paymentStatus = () => Joi.string().valid('pending', 'partially-completed', 'completed', 'cancelled')
18+
Joi.paymentStatus = () => Joi.string().valid('pending', 'in-progress', 'partially-completed', 'completed', 'failed', 'no-days')
1919
Joi.xaiTemplate = () => Joi.string().valid(...allowedXAITemplates)
2020
Joi.interviewStatus = () => Joi.string().valid(...allowedInterviewStatuses)
2121
Joi.workPeriodPaymentStatus = () => Joi.string().valid('completed', 'scheduled', 'in-progress', 'failed', 'cancelled')

src/scripts/createIndex.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,18 @@ async function createIndex () {
119119
startDate: { type: 'date', format: 'yyyy-MM-dd' },
120120
endDate: { type: 'date', format: 'yyyy-MM-dd' },
121121
daysWorked: { type: 'integer' },
122-
memberRate: { type: 'float' },
123-
customerRate: { type: 'float' },
122+
daysPaid: { type: 'integer' },
123+
paymentTotal: { type: 'float' },
124124
paymentStatus: { type: 'keyword' },
125125
payments: {
126126
type: 'nested',
127127
properties: {
128128
id: { type: 'keyword' },
129129
workPeriodId: { type: 'keyword' },
130130
challengeId: { type: 'keyword' },
131+
memberRate: { type: 'float' },
132+
customerRate: { type: 'float' },
133+
days: { type: 'integer' },
131134
amount: { type: 'float' },
132135
status: { type: 'keyword' },
133136
statusDetails: {

src/services/WorkPeriodPaymentProcessorService.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ processCreate.schema = {
6060
id: Joi.string().uuid().required(),
6161
workPeriodId: Joi.string().uuid().required(),
6262
challengeId: Joi.string().uuid().allow(null),
63+
memberRate: Joi.number().required(),
64+
customerRate: Joi.number().allow(null),
65+
days: Joi.number().integer().min(1).max(5).required(),
6366
amount: Joi.number().greater(0).allow(null),
6467
status: Joi.workPeriodPaymentStatus().required(),
6568
billingAccountId: Joi.number().allow(null),

src/services/WorkPeriodProcessorService.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ processCreate.schema = {
7272
projectId: Joi.number().integer().required(),
7373
startDate: Joi.string().required(),
7474
endDate: Joi.string().required(),
75-
daysWorked: Joi.number().integer().min(0).allow(null),
76-
memberRate: Joi.number().allow(null),
77-
customerRate: Joi.number().allow(null),
75+
daysWorked: Joi.number().integer().min(0).max(5).required(),
76+
daysPaid: Joi.number().integer().min(0).max(5).required(),
77+
paymentTotal: Joi.number().min(0).required(),
7878
paymentStatus: Joi.paymentStatus().required(),
7979
createdAt: Joi.date().required(),
8080
createdBy: Joi.string().uuid().required(),

0 commit comments

Comments
 (0)