diff --git a/src/sip.js b/src/sip.js index bcd4182..9484a80 100644 --- a/src/sip.js +++ b/src/sip.js @@ -12,21 +12,6 @@ const Calculations = { return maxPrice; }, - /** - * Get total value of the order from order config - * @returns {number} - Output A - * @param {import('./types').OrderConfig} orderConfig - Input A - * @param {import('./types').SidPriceMap} sidPriceMap - Input B - */ - calculateOrderTotalValue: function calculateOrderTotalValue(orderConfig, sidPriceMap) { - const totalValue = orderConfig.reduce((prevValue, eachSidConfig) => { - const sidPrice = sidPriceMap[eachSidConfig.sid]; - const currentConfigValue = sidPrice * eachSidConfig.shares; - return (prevValue + currentConfigValue); - }, 0); - - return totalValue; - } }; module.exports = Calculations; diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index e337501..0000000 --- a/src/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -export type sid = string; - -export interface OrderConfigElement { - sid: sid; - shares: number, -} - -export type OrderConfig = Array; - -export interface SidPriceMap { - [sid: string]: number; -}