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

Commit

Permalink
feat: made RetrochargeEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado committed Jun 18, 2020
1 parent 69f2509 commit de22e6d
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion src/sections/finances/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,25 @@ const ServiceProviderCreditEvent = SolutionProviderCreditEvent
/**
* @todo
*/
const RetrochargeEvent = unknown

enum RetrochargeEventTypeEnum {
Retrocharge = 'Retrocharge',
RetrochargeReversal = 'RetrochargeReversal',
}

const RetrochargeEventType = enumeration(RetrochargeEventTypeEnum)

const RetrochargeEvent = Codec.interface({
RetrochargeEventType: optional(RetrochargeEventType),
AmazonOrderId: optional(ensureString),
PostedDate: optional(mwsDate),
BaseTax: optional(CurrencyAmount),
ShippingTax: optional(CurrencyAmount),
MarketplaceName: optional(string),
RetrochargeTaxWithheldComponentList: optional(
ensureArray('TaxWithheldComponent', TaxWithheldComponent),
),
})
/**
* @todo
*/
Expand Down Expand Up @@ -276,6 +294,12 @@ 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),
// })
const FinancialEvents = Codec.interface({
ShipmentEventList: optional(ensureArray('ShipmentEvent', ShipmentEvent)),
RefundEventList: optional(ensureArray('RefundEvent', RefundEvent)),
Expand Down

0 comments on commit de22e6d

Please sign in to comment.