diff --git a/__tests__/lib/client/models/__snapshots__/finances.js.snap b/__tests__/lib/client/models/__snapshots__/finances.js.snap index 2a2f4c7..05a82c0 100644 --- a/__tests__/lib/client/models/__snapshots__/finances.js.snap +++ b/__tests__/lib/client/models/__snapshots__/finances.js.snap @@ -1357,6 +1357,7 @@ Object { ], }, ], + "taxWithholdingEventList": Array [], "tdsReimbursementEventList": Array [ Object { "postedDate": 1969-07-21T02:56:03.000Z, diff --git a/__tests__/lib/client/parsers/finances/__snapshots__/list-financial-events-response.js.snap b/__tests__/lib/client/parsers/finances/__snapshots__/list-financial-events-response.js.snap index 87e4c35..4641a6c 100644 --- a/__tests__/lib/client/parsers/finances/__snapshots__/list-financial-events-response.js.snap +++ b/__tests__/lib/client/parsers/finances/__snapshots__/list-financial-events-response.js.snap @@ -314,6 +314,7 @@ Object { ], }, ], + "taxWithholdingEventList": Array [], "tdsReimbursementEventList": Array [], }, "nextToken": null, @@ -502,6 +503,7 @@ Object { ], }, ], + "taxWithholdingEventList": Array [], "tdsReimbursementEventList": Array [ Object { "postedDate": 2019-08-01T16:18:15.000Z, @@ -704,6 +706,7 @@ Object { ], "serviceProviderCreditEventList": Array [], "shipmentEventList": Array [], + "taxWithholdingEventList": Array [], "tdsReimbursementEventList": Array [], }, "nextToken": "e21hcmtldHBsYWNlSWQ6bnVsbCxtYXhSZXN1bHRzUGVyUGFnZTowLHNlYXJjaFF1ZXJ5Q2hlY2tzdW06bnVsbCxxdWVyeVBhZ2luYXRpb25Ub2tlbjoidDB3V25MNXFLWkRIZ2p5ZzB3ZHRWODVnV0htVExVMkM0XzlsMHpRMG9HVXFZOVhTdjFyWUNWUE8teGxWRnF3N0ZyaDIyY3lQX0VTOXYxendQNUVvc0t0V1NKM1YyQkRJdWcyWFpXdm1KVmdPVktBdzNIMXUyVHBiTGoxVmRmY3Z6ZlU1WlpNaEpsQ0RKUnYxRk16am13Y1YyQ1BoOXNWMU1xNUZqamxUMlRCeFBkSjdEa3BkbENISElVZ094aHVTN3ZfZlFCUWYyWWJYZ2l3NHNxZXkwNnQyaVBucm5PdnAzRTdKbW4xcnc1UTlaTGV1Ymk5WUV6UGJ6UnhjRmh2VUFKdlQ5U2U3eERIdHVMUzNJVWFRODBubVhja3JLeWt3dVZKeWZXQm5CY3p0bjZTbVRHenJmZ1VOanFMWFFNT2giLHNlYXJjaFF1ZXJ5Om51bGwsdG9rZW5DcmVhdGlvbkRhdGU6MTQ4NTg2MjY5ODI1NCxzZWxsZXJJZDoiQTM1SlMxREpITjdGViJ9", diff --git a/lib/client/parsers/finances/financial-events.js b/lib/client/parsers/finances/financial-events.js index 081466f..befa183 100644 --- a/lib/client/parsers/finances/financial-events.js +++ b/lib/client/parsers/finances/financial-events.js @@ -21,6 +21,7 @@ const parseAffordabilityExpenseEvent = require('./affordability-expense-event') const parseAffordabilityExpenseReversalEvent = require('./affordability-expense-reversal-event') const parseNetworkComminglingTransactionEvent = require('./network-commingling-transaction-event') const parseTDSReimbursementEvent = require('./tds-reimbursement-event') +const parseTaxWithholdingEvent = require('./tax-withholding-event') module.exports = (key, node) => ({ shipmentEventList: select(`${key}/finances:ShipmentEventList/finances:ShipmentEvent`, node).map(n => { @@ -95,5 +96,8 @@ module.exports = (key, node) => ({ }), tdsReimbursementEventList: select(`${key}/finances:TDSReimbursementEventList/finances:TDSReimbursementEvent`, node).map(n => { return parseTDSReimbursementEvent('.', n) + }), + taxWithholdingEventList: select(`${key}/finances:TaxWithholdingEventList/finances:TaxWithholdingEvent`, node).map(n => { + return parseTaxWithholdingEvent('.', n) }) }) diff --git a/lib/client/parsers/finances/tax-withholding-event.js b/lib/client/parsers/finances/tax-withholding-event.js new file mode 100644 index 0000000..7950601 --- /dev/null +++ b/lib/client/parsers/finances/tax-withholding-event.js @@ -0,0 +1,13 @@ +const nullable = require('../nullable') + +const {parseDate} = require('../base') + +const parseCurrencyAmount = require('./currency-amount') +const parseTaxWithholdingPeriod = require('./tax-withholding-period') + +module.exports = (key, node) => ({ + baseAmount: nullable(parseCurrencyAmount, `${key}/finances:BaseAmount`, node), + withheldAmount: nullable(parseCurrencyAmount, `${key}/finances:WithheldAmount`, node), + postedDate: parseDate(`${key}/finances:PostedDate`, node), + taxWithholdingPeriod: nullable(parseTaxWithholdingPeriod, `${key}/finances:TaxWithholdingPeriod`, node) +}) diff --git a/lib/client/parsers/finances/tax-withholding-period.js b/lib/client/parsers/finances/tax-withholding-period.js new file mode 100644 index 0000000..b2aaf72 --- /dev/null +++ b/lib/client/parsers/finances/tax-withholding-period.js @@ -0,0 +1,6 @@ +const {parseNumber} = require('../base') + +module.exports = (key, node) => ({ + startDateMillis: parseNumber(`${key}/finances:StartDateMillis`, node), + endDateMillis: parseNumber(`${key}/finances:EndDateMillis`, node) +})