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

Commit

Permalink
feat: made NetworkComminglingTransactionEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado committed Jun 19, 2020
1 parent c087bc4 commit 1601348
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
38 changes: 24 additions & 14 deletions src/sections/finances/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,20 +436,30 @@ const AffordabilityExpenseReversalEvent = Codec.interface({
TaxTypeSGST: optional(CurrencyAmount),
MarketplaceId: optional(string),
})
/**
* @todo
*/
const NetworkComminglingTransactionEvent = unknown
/**
* @todo
*/
const TDSReimbursementEvent = unknown
// Defined this too early, want to go in order. Will fix when I get here
// const TDSReimbursementEvent = Codec.interface({
// PostedDate: optional(mwsDate),
// TdsOrderId: optional(ensureString),
// ReimbursedAmount: optional(CurrencyAmount),
// })

enum NetworkComminglingTransactionTypeEnum {
ComminglingVAT = 'ComminglingVAT',
NetCo = 'NetCo',
}

const NetworkComminglingTransactionType = enumeration(NetworkComminglingTransactionTypeEnum)

const NetworkComminglingTransactionEvent = Codec.interface({
PostedDate: optional(mwsDate),
NetCoTransactionID: optional(ensureString),
SwapReason: optional(string),
TransactionType: optional(NetworkComminglingTransactionType),
ASIN: optional(string),
MarketplaceId: optional(string),
TaxExclusiveAmount: optional(CurrencyAmount),
TaxAmount: optional(CurrencyAmount),
})

const TDSReimbursementEvent = Codec.interface({
PostedDate: optional(mwsDate),
TdsOrderId: optional(ensureString),
ReimbursedAmount: optional(CurrencyAmount),
})
const FinancialEvents = Codec.interface({
ShipmentEventList: optional(ensureArray('ShipmentEvent', ShipmentEvent)),
RefundEventList: optional(ensureArray('RefundEvent', RefundEvent)),
Expand Down
6 changes: 3 additions & 3 deletions test/unit/__snapshots__/finances.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Array [
"CurrencyCode": "INR",
},
"MarketplaceId": "A2XZLSVIQ0F4JT",
"PostedDate": "2018-02-08T13:17:15.000Z",
"PostedDate": 2018-02-08T13:17:15.000Z,
"TaxTypeCGST": Object {
"CurrencyAmount": 0,
"CurrencyCode": "INR",
Expand Down Expand Up @@ -135,7 +135,7 @@ Array [
"CurrencyCode": "INR",
},
"MarketplaceId": "A2XZLSVIQ0F4JT",
"PostedDate": "2018-02-08T13:17:15.000Z",
"PostedDate": 2018-02-08T13:17:15.000Z,
"TaxTypeCGST": Object {
"CurrencyAmount": 0,
"CurrencyCode": "INR",
Expand Down Expand Up @@ -233,7 +233,7 @@ Array [
],
"TDSReimbursementEventList": Array [
Object {
"PostedDate": "2019-08-01T16:18:15.000Z",
"PostedDate": 2019-08-01T16:18:15.000Z,
"ReimbursedAmount": Object {
"CurrencyAmount": 3.98,
"CurrencyCode": "INR",
Expand Down

0 comments on commit 1601348

Please sign in to comment.