@barchart/portfolio-client-js 1.2.7 → 1.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/gateway/PortfolioGateway.js +9 -6
- package/lib/index.js +1 -1
- package/package.json +1 -1
|
@@ -618,6 +618,12 @@ module.exports = (() => {
|
|
|
618
618
|
assert.argumentIsRequired(portfolio, 'portfolio', Object);
|
|
619
619
|
assert.argumentIsArray(transactions, 'transactions', Object);
|
|
620
620
|
|
|
621
|
+
const batchData = { };
|
|
622
|
+
|
|
623
|
+
batchData.portfolio = portfolio;
|
|
624
|
+
batchData.transactionTypes = [ ];
|
|
625
|
+
batchData.transactionItems = [ ];
|
|
626
|
+
|
|
621
627
|
const batchData = transactions.reduce((data, transaction) => {
|
|
622
628
|
transaction.portfolio = portfolio.portfolio;
|
|
623
629
|
|
|
@@ -628,14 +634,11 @@ module.exports = (() => {
|
|
|
628
634
|
const code = getTransactionTypeCode(transaction);
|
|
629
635
|
const schema = getTransactionSchema(transaction);
|
|
630
636
|
|
|
631
|
-
data.
|
|
632
|
-
data.
|
|
637
|
+
data.transactionTypes.push(code);
|
|
638
|
+
data.transactionItems.push(JSON.stringify(schema.schema.format(transaction)));
|
|
633
639
|
|
|
634
640
|
return data;
|
|
635
|
-
},
|
|
636
|
-
types: [ ],
|
|
637
|
-
transactions: [ ]
|
|
638
|
-
});
|
|
641
|
+
}, batchData);
|
|
639
642
|
|
|
640
643
|
return Gateway.invoke(this._batchTransactionEndpoint, batchData);
|
|
641
644
|
});
|
package/lib/index.js
CHANGED