Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Add retrochargeTaxWithheldComponentList to retrocharge events
Browse files Browse the repository at this point in the history
  • Loading branch information
tusbar committed Jan 8, 2021
1 parent 51771d7 commit 3b4ac89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions __tests__/lib/client/models/__snapshots__/finances.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,7 @@ Object {
"marketplaceName": "String",
"postedDate": 1969-07-21T02:56:03.000Z,
"retrochargeEventType": "String",
"retrochargeTaxWithheldComponentList": Array [],
"shippingTax": Object {
"currencyAmount": 100,
"currencyCode": "String",
Expand Down
8 changes: 7 additions & 1 deletion lib/client/parsers/finances/retrocharge-event.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
const select = require('../select')

const {parseStr, parseDate} = require('../base')

const parseCurrencyAmount = require('./currency-amount')
const parseTaxWithheldComponent = require('./tax-withheld-component')

module.exports = (key, node) => ({
retrochargeEventType: parseStr(`${key}/finances:RetrochargeEventType`, node),
amazonOrderId: parseStr(`${key}/finances:AmazonOrderId`, node),
postedDate: parseDate(`${key}/finances:PostedDate`, node),
baseTax: parseCurrencyAmount(`${key}/finances:BaseTax`, node),
shippingTax: parseCurrencyAmount(`${key}/finances:ShippingTax`, node),
marketplaceName: parseStr(`${key}/finances:MarketplaceName`, node)
marketplaceName: parseStr(`${key}/finances:MarketplaceName`, node),
retrochargeTaxWithheldComponentList: select(`${key}/finances:RetrochargeTaxWithheldComponentList`, node).map(n => {
return parseTaxWithheldComponent('.', n)
})
})

0 comments on commit 3b4ac89

Please sign in to comment.