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

Commit

Permalink
feat: make DebtRecoveryEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
justinemmanuelmercado committed Jun 19, 2020
1 parent ddac653 commit bd8eb20
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions src/sections/finances/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,35 @@ const ServiceFeeEvent = Codec.interface({
FeeDesription: optional(string),
ASIN: optional(string),
})
/**
* @todo
*/
const DebtRecoveryEvent = unknown

const DebtRecoveryItem = Codec.interface({
RecoveryAmount: optional(CurrencyAmount),
OriginalAmount: optional(CurrencyAmount),
GroupBeginDate: optional(mwsDate),
GroupEndDate: optional(mwsDate),
})

const ChargeInstrument = Codec.interface({
Description: optional(string),
Tail: optional(string),
Amount: optional(CurrencyAmount),
})

enum DebtRecoveryTypeEnum {
DebtPayment = 'DebtPayment',
DebtPaymentFailure = 'DebtPaymentFailure',
DebtAdjustment = 'DebtAdjustment',
}

const DebtRecoveryType = enumeration(DebtRecoveryTypeEnum)

const DebtRecoveryEvent = Codec.interface({
DebtRecoveryType: optional(DebtRecoveryType),
RecoveryAmount: optional(CurrencyAmount),
OverPaymentCredit: optional(CurrencyAmount),
DebtRecoveryItemList: optional(ensureArray('DebtRecoveryItem', DebtRecoveryItem)),
ChargeInstrumentList: optional(ensureArray('ChargeInstrument', ChargeInstrument)),
})
/**
* @todo
*/
Expand Down

0 comments on commit bd8eb20

Please sign in to comment.