@barchart/portfolio-api-common 1.0.105 → 1.0.106

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.
@@ -35,6 +35,8 @@ module.exports = (() => {
35
35
  this._dataFormat.key = this._key;
36
36
  this._dataFormat.description = this._description;
37
37
 
38
+ this._dataFormat.quantity = null;
39
+
38
40
  if (this._single) {
39
41
  this._dataFormat.instrument = items[0].position.instrument;
40
42
  } else {
@@ -251,6 +253,10 @@ module.exports = (() => {
251
253
  format.summaryTotalCurrent = formatCurrency(updates.summaryTotalCurrent, currency);
252
254
  format.summaryTotalPrevious = formatCurrency(updates.summaryTotalPrevious, currency);
253
255
  format.summaryTotalPreviousNegative = updates.summaryTotalPrevious.getIsNegative();
256
+
257
+ if (group.single) {
258
+ format.quantity = formatDecimal(group.position.snapshot.open, 2);
259
+ }
254
260
  }
255
261
 
256
262
  function calculatePriceData(group, item, forceRefresh) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.105",
3
+ "version": "1.0.106",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -1038,6 +1038,8 @@ module.exports = (() => {
1038
1038
  this._dataFormat.key = this._key;
1039
1039
  this._dataFormat.description = this._description;
1040
1040
 
1041
+ this._dataFormat.quantity = null;
1042
+
1041
1043
  if (this._single) {
1042
1044
  this._dataFormat.instrument = items[0].position.instrument;
1043
1045
  } else {
@@ -1254,6 +1256,10 @@ module.exports = (() => {
1254
1256
  format.summaryTotalCurrent = formatCurrency(updates.summaryTotalCurrent, currency);
1255
1257
  format.summaryTotalPrevious = formatCurrency(updates.summaryTotalPrevious, currency);
1256
1258
  format.summaryTotalPreviousNegative = updates.summaryTotalPrevious.getIsNegative();
1259
+
1260
+ if (group.single) {
1261
+ format.quantity = formatDecimal(group.position.snapshot.open, 2);
1262
+ }
1257
1263
  }
1258
1264
 
1259
1265
  function calculatePriceData(group, item, forceRefresh) {