interface MoneyField {
  amount: number
  currencyCode: String
}

export const moneyFieldToUnit = (moneyField: MoneyField) => {
  switch (moneyField.currencyCode) {
    case "USD":
      return moneyField.amount * 100
    default:
      throw new Error("Unknown currency, cannot process.")
  }
}

interface MoneyField {
  amount: number
  currencyCode: String
}

export const moneyFieldToUnit = (moneyField: MoneyField) => {
  // this currently only supports currencies with cents
  // and multiply the major value to 100 to get cent value
  return moneyField.amount * 100
}

Switch to always multiply by 100
Switch to always multiply by 100
