From 7df05802a32e5d182737bcc68975a968f262d67e Mon Sep 17 00:00:00 2001 From: EJ Mercado Date: Fri, 3 Jul 2020 06:20:45 +0800 Subject: [PATCH] fix: currency amount is different in merchant-fulfillment --- src/sections/codec.ts | 1 + src/sections/merchant-fulfillment/codec.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sections/codec.ts b/src/sections/codec.ts index 768c8a00..ca9417a3 100644 --- a/src/sections/codec.ts +++ b/src/sections/codec.ts @@ -4,6 +4,7 @@ import { Codec, number, optional, string } from 'purify-ts' * Shared codecs */ +// This is different from the CurrencyAmount used by merchant-fulfillment export const CurrencyAmount = Codec.interface({ CurrencyCode: optional(string), CurrencyAmount: optional(number), diff --git a/src/sections/merchant-fulfillment/codec.ts b/src/sections/merchant-fulfillment/codec.ts index 5de038a5..09c2c021 100644 --- a/src/sections/merchant-fulfillment/codec.ts +++ b/src/sections/merchant-fulfillment/codec.ts @@ -1,13 +1,17 @@ import { boolean, Codec, enumeration, GetInterface, number, optional, string } from 'purify-ts' import { ensureArray, ensureString, mwsDate } from '../../parsing' -import { CurrencyAmount } from '../codec' import { PredefinedPackageDimensionsEnum } from './type' export const TemporarilyUnavailableCarrier = Codec.interface({ CarrierName: string, }) +export const CurrencyAmount = Codec.interface({ + CurrencyCode: string, + Amount: number, +}) + export const RejectedShippingService = Codec.interface({ CarrierName: string, ShippingServiceId: ensureString,