@barchart/portfolio-api-common 1.0.69 → 1.0.70
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.
|
@@ -6,8 +6,7 @@ const array = require('@barchart/common-js/lang/array'),
|
|
|
6
6
|
is = require('@barchart/common-js/lang/is'),
|
|
7
7
|
Tree = require('@barchart/common-js/collections/Tree');
|
|
8
8
|
|
|
9
|
-
const
|
|
10
|
-
PositionSummaryFrame = require('./../data/PositionSummaryFrame');
|
|
9
|
+
const PositionSummaryFrame = require('./../data/PositionSummaryFrame');
|
|
11
10
|
|
|
12
11
|
const PositionGroup = require('./PositionGroup'),
|
|
13
12
|
PositionItem = require('./PositionItem');
|
|
@@ -24,7 +23,7 @@ module.exports = (() => {
|
|
|
24
23
|
this._defaultCurrency = defaultCurrency || Currency.CAD;
|
|
25
24
|
|
|
26
25
|
this._summaryFrame = summaryFrameType || PositionSummaryFrame.YEARLY;
|
|
27
|
-
this._summaryRanges = this._summaryFrame.getRecentRanges(
|
|
26
|
+
this._summaryRanges = this._summaryFrame.getRecentRanges(1);
|
|
28
27
|
|
|
29
28
|
this._portfolios = portfolios.reduce((map, portfolio) => {
|
|
30
29
|
map[portfolio.portfolio] = portfolio;
|
|
@@ -40,7 +39,7 @@ module.exports = (() => {
|
|
|
40
39
|
map[key] = getSummaryArray(this._summaryRanges);
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
const index = this._summaryRanges.findIndex(r => r.start
|
|
42
|
+
const index = this._summaryRanges.findIndex(r => r.start.getIsEqual(summary.start.date) && r.end.getIsEqual(summary.end.date));
|
|
44
43
|
|
|
45
44
|
if (!(index < 0)) {
|
|
46
45
|
map[key][index] = summary;
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -683,8 +683,7 @@ const array = require('@barchart/common-js/lang/array'),
|
|
|
683
683
|
is = require('@barchart/common-js/lang/is'),
|
|
684
684
|
Tree = require('@barchart/common-js/collections/Tree');
|
|
685
685
|
|
|
686
|
-
const
|
|
687
|
-
PositionSummaryFrame = require('./../data/PositionSummaryFrame');
|
|
686
|
+
const PositionSummaryFrame = require('./../data/PositionSummaryFrame');
|
|
688
687
|
|
|
689
688
|
const PositionGroup = require('./PositionGroup'),
|
|
690
689
|
PositionItem = require('./PositionItem');
|
|
@@ -701,7 +700,7 @@ module.exports = (() => {
|
|
|
701
700
|
this._defaultCurrency = defaultCurrency || Currency.CAD;
|
|
702
701
|
|
|
703
702
|
this._summaryFrame = summaryFrameType || PositionSummaryFrame.YEARLY;
|
|
704
|
-
this._summaryRanges = this._summaryFrame.getRecentRanges(
|
|
703
|
+
this._summaryRanges = this._summaryFrame.getRecentRanges(1);
|
|
705
704
|
|
|
706
705
|
this._portfolios = portfolios.reduce((map, portfolio) => {
|
|
707
706
|
map[portfolio.portfolio] = portfolio;
|
|
@@ -717,7 +716,7 @@ module.exports = (() => {
|
|
|
717
716
|
map[key] = getSummaryArray(this._summaryRanges);
|
|
718
717
|
}
|
|
719
718
|
|
|
720
|
-
const index = this._summaryRanges.findIndex(r => r.start
|
|
719
|
+
const index = this._summaryRanges.findIndex(r => r.start.getIsEqual(summary.start.date) && r.end.getIsEqual(summary.end.date));
|
|
721
720
|
|
|
722
721
|
if (!(index < 0)) {
|
|
723
722
|
map[key][index] = summary;
|
|
@@ -900,7 +899,7 @@ module.exports = (() => {
|
|
|
900
899
|
return PositionContainer;
|
|
901
900
|
})();
|
|
902
901
|
|
|
903
|
-
},{"./../data/
|
|
902
|
+
},{"./../data/PositionSummaryFrame":2,"./PositionGroup":5,"./PositionItem":7,"@barchart/common-js/collections/Tree":8,"@barchart/common-js/collections/sorting/ComparatorBuilder":9,"@barchart/common-js/collections/sorting/comparators":10,"@barchart/common-js/lang/Currency":11,"@barchart/common-js/lang/array":16,"@barchart/common-js/lang/assert":17,"@barchart/common-js/lang/is":19}],5:[function(require,module,exports){
|
|
904
903
|
const assert = require('@barchart/common-js/lang/assert'),
|
|
905
904
|
Currency = require('@barchart/common-js/lang/Currency'),
|
|
906
905
|
Decimal = require('@barchart/common-js/lang/Decimal'),
|