Remove types.ts and usage

This commit is contained in:
Abhas
2018-12-04 14:06:53 +05:30
parent 111a00f45d
commit 7376c24a5e
2 changed files with 0 additions and 27 deletions
-15
View File
@@ -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;
-12
View File
@@ -1,12 +0,0 @@
export type sid = string;
export interface OrderConfigElement {
sid: sid;
shares: number,
}
export type OrderConfig = Array<OrderConfigElement>;
export interface SidPriceMap {
[sid: string]: number;
}