diff --git a/src/scripts/createIndex.js b/src/scripts/createIndex.js index 33114fb..c4601ee 100644 --- a/src/scripts/createIndex.js +++ b/src/scripts/createIndex.js @@ -68,6 +68,7 @@ async function createIndex () { memberRate: { type: 'float' }, customerRate: { type: 'float' }, rateType: { type: 'keyword' }, + billingAccountId: { type: 'integer' }, createdAt: { type: 'date' }, createdBy: { type: 'keyword' }, updatedAt: { type: 'date' }, @@ -98,6 +99,7 @@ async function createIndex () { challengeId: { type: 'keyword' }, amount: { type: 'float' }, status: { type: 'keyword' }, + billingAccountId: { type: 'integer' }, createdAt: { type: 'date' }, createdBy: { type: 'keyword' }, updatedAt: { type: 'date' }, diff --git a/src/services/ResourceBookingProcessorService.js b/src/services/ResourceBookingProcessorService.js index f507bde..f407b2b 100644 --- a/src/services/ResourceBookingProcessorService.js +++ b/src/services/ResourceBookingProcessorService.js @@ -46,7 +46,8 @@ processCreate.schema = { createdBy: Joi.string().uuid().required(), updatedAt: Joi.date().allow(null), updatedBy: Joi.string().uuid().allow(null), - status: Joi.resourceBookingStatus().required() + status: Joi.resourceBookingStatus().required(), + billingAccountId: Joi.number().allow(null) }).required() }).required(), transactionId: Joi.string().required() diff --git a/src/services/WorkPeriodPaymentProcessorService.js b/src/services/WorkPeriodPaymentProcessorService.js index 1f6cc54..d336379 100644 --- a/src/services/WorkPeriodPaymentProcessorService.js +++ b/src/services/WorkPeriodPaymentProcessorService.js @@ -48,6 +48,7 @@ processCreate.schema = { challengeId: Joi.string().uuid().required(), amount: Joi.number().greater(0).allow(null), status: Joi.workPeriodPaymentStatus().required(), + billingAccountId: Joi.number().allow(null), createdAt: Joi.date().required(), createdBy: Joi.string().uuid().required(), updatedAt: Joi.date().allow(null), diff --git a/test/messages/taas.resourcebooking.create.event.json b/test/messages/taas.resourcebooking.create.event.json index 31d6217..2f3de0a 100644 --- a/test/messages/taas.resourcebooking.create.event.json +++ b/test/messages/taas.resourcebooking.create.event.json @@ -15,6 +15,7 @@ "id": "60d97713-8621-476e-b006-7cb9589c7777", "createdAt": "2020-11-05T19:00:23.036Z", "createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", - "status": "assigned" + "status": "assigned", + "billingAccountId": 80000071 } -} \ No newline at end of file +} diff --git a/test/messages/taas.resourcebooking.update.event.json b/test/messages/taas.resourcebooking.update.event.json index e45fc86..2b96229 100644 --- a/test/messages/taas.resourcebooking.update.event.json +++ b/test/messages/taas.resourcebooking.update.event.json @@ -14,9 +14,10 @@ "customerRate": 13, "rateType": "hourly", "status": "assigned", + "billingAccountId": 80000071, "updatedAt": "2020-11-05T19:00:25.062Z", "updatedBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a", "createdAt": "2020-11-05T19:00:16.268Z", "createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a" } -} \ No newline at end of file +} diff --git a/test/messages/taas.workperiod.create.event.json b/test/messages/taas.workperiod.create.event.json index 7afea61..3c2d286 100644 --- a/test/messages/taas.workperiod.create.event.json +++ b/test/messages/taas.workperiod.create.event.json @@ -14,9 +14,10 @@ "projectId": 111, "userHandle": "pshah_manager", "id": "926040c4-1709-4de2-b2b6-52adf6e5e72d", + "billingAccountId": 80000071 "createdBy": "00000000-0000-0000-0000-000000000000", "updatedAt": "2021-03-30T20:24:17.541Z", "createdAt": "2021-03-30T20:24:17.541Z", "updatedBy": null } -} \ No newline at end of file +}