Skip to content

Commit 95800c8

Browse files
Merge pull request #48 from imcaizheng/feature/use-billing-account-for-payments
Use billing account for payments
2 parents 96ef522 + 2665ac5 commit 95800c8

6 files changed

+12
-5
lines changed

src/scripts/createIndex.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ async function createIndex () {
6868
memberRate: { type: 'float' },
6969
customerRate: { type: 'float' },
7070
rateType: { type: 'keyword' },
71+
billingAccountId: { type: 'integer' },
7172
createdAt: { type: 'date' },
7273
createdBy: { type: 'keyword' },
7374
updatedAt: { type: 'date' },
@@ -98,6 +99,7 @@ async function createIndex () {
9899
challengeId: { type: 'keyword' },
99100
amount: { type: 'float' },
100101
status: { type: 'keyword' },
102+
billingAccountId: { type: 'integer' },
101103
createdAt: { type: 'date' },
102104
createdBy: { type: 'keyword' },
103105
updatedAt: { type: 'date' },

src/services/ResourceBookingProcessorService.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ processCreate.schema = {
4646
createdBy: Joi.string().uuid().required(),
4747
updatedAt: Joi.date().allow(null),
4848
updatedBy: Joi.string().uuid().allow(null),
49-
status: Joi.resourceBookingStatus().required()
49+
status: Joi.resourceBookingStatus().required(),
50+
billingAccountId: Joi.number().allow(null)
5051
}).required()
5152
}).required(),
5253
transactionId: Joi.string().required()

src/services/WorkPeriodPaymentProcessorService.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ processCreate.schema = {
4848
challengeId: Joi.string().uuid().required(),
4949
amount: Joi.number().greater(0).allow(null),
5050
status: Joi.workPeriodPaymentStatus().required(),
51+
billingAccountId: Joi.number().allow(null),
5152
createdAt: Joi.date().required(),
5253
createdBy: Joi.string().uuid().required(),
5354
updatedAt: Joi.date().allow(null),

test/messages/taas.resourcebooking.create.event.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"id": "60d97713-8621-476e-b006-7cb9589c7777",
1616
"createdAt": "2020-11-05T19:00:23.036Z",
1717
"createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
18-
"status": "assigned"
18+
"status": "assigned",
19+
"billingAccountId": 80000071
1920
}
20-
}
21+
}

test/messages/taas.resourcebooking.update.event.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
"customerRate": 13,
1515
"rateType": "hourly",
1616
"status": "assigned",
17+
"billingAccountId": 80000071,
1718
"updatedAt": "2020-11-05T19:00:25.062Z",
1819
"updatedBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a",
1920
"createdAt": "2020-11-05T19:00:16.268Z",
2021
"createdBy": "a55fe1bc-1754-45fa-9adc-cf3d6d7c377a"
2122
}
22-
}
23+
}

test/messages/taas.workperiod.create.event.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
"projectId": 111,
1515
"userHandle": "pshah_manager",
1616
"id": "926040c4-1709-4de2-b2b6-52adf6e5e72d",
17+
"billingAccountId": 80000071
1718
"createdBy": "00000000-0000-0000-0000-000000000000",
1819
"updatedAt": "2021-03-30T20:24:17.541Z",
1920
"createdAt": "2021-03-30T20:24:17.541Z",
2021
"updatedBy": null
2122
}
22-
}
23+
}

0 commit comments

Comments
 (0)