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

Commit

Permalink
feat: create ProductAdsPaymentEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado committed Jun 19, 2020
1 parent 5455c7c commit a33514d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
26 changes: 23 additions & 3 deletions src/sections/finances/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,13 +256,33 @@ const RentalTransactionEvent = Codec.interface({
RentalTaxWithheldList: optional(TaxWithheldComponent),
})
/**
* @todo
* Leaving this as unknown because Amazon did not define it in their
*/
const PerformanceBondRefundEvent = unknown

/**
* @todo
* Not sure what case MWS returns. Fixture has them captialized but docs has them in lower case
*/
const ProductAdsPaymentEvent = unknown
enum transactionTypeEnum {
charge = 'charge',
refund = 'refund',
Charge = 'Charge',
Refund = 'Refund',
}

const transactionType = enumeration(transactionTypeEnum)

/**
* For some unknown reason this is in camel case
*/
const ProductAdsPaymentEvent = Codec.interface({
postedDate: optional(mwsDate),
transactionType: optional(transactionType),
invoiceId: optional(ensureString),
baseValue: optional(CurrencyAmount),
taxValue: optional(CurrencyAmount),
transactionValue: optional(CurrencyAmount),
})
/**
* @todo
*/
Expand Down
1 change: 0 additions & 1 deletion test/unit/__snapshots__/finances.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ Array [
"PerformanceBondRefundEventList": Array [],
"ProductAdsPaymentEventList": Array [
Object {
"PostedDate": "2017-01-11T13:17:15.000Z",
"baseValue": Object {
"CurrencyAmount": 115.34,
"CurrencyCode": "USD",
Expand Down

0 comments on commit a33514d

Please sign in to comment.