@barchart/portfolio-api-common 1.0.183 → 1.0.187

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.
@@ -326,10 +326,10 @@ module.exports = (() => {
326
326
  const distributionCash = new TransactionType('DC', 'Distribution (Cash)', 'Cash Distribution', false, false, true, false, false);
327
327
  const distributionFund = new TransactionType('DF', 'Distribution (Units)', 'Unit Distribution', false, false, false, true, false);
328
328
 
329
- const deposit = new TransactionType('D', 'Deposit', 'Deposit', false, false, false, true, false);
330
- const withdrawal = new TransactionType('W', 'Withdrawal', 'Withdrawal', false, false, false, false, true);
331
- const debit = new TransactionType('DR', 'Debit', 'Debit', false, false, false, false, true);
332
- const credit = new TransactionType('CR', 'Credit', 'Credit', false, false, false, true, false);
329
+ const deposit = new TransactionType('D', 'Deposit', 'Deposit', false, false, false, false, false);
330
+ const withdrawal = new TransactionType('W', 'Withdrawal', 'Withdrawal', false, false, false, false, false);
331
+ const debit = new TransactionType('DR', 'Debit', 'Debit', false, false, false, false, false);
332
+ const credit = new TransactionType('CR', 'Credit', 'Credit', false, false, false, false, false);
333
333
 
334
334
  const valuation = new TransactionType('V', 'Valuation', 'Valuation', false, false, false, false, false);
335
335
  const income = new TransactionType('I', 'Income', 'Income', false, false, true, false, false);
@@ -248,7 +248,7 @@ module.exports = (() => {
248
248
  addSummaryPrevious(this._summariesPrevious, summary, this._previousSummaryFrame, this._previousSummaryRanges);
249
249
  });
250
250
 
251
- const item = createPositionItem(position);
251
+ const item = createPositionItem.call(this, position);
252
252
 
253
253
  addBarchartSymbol(this._symbols, item);
254
254
  addDisplaySymbol(this._symbolsDisplay, item);
@@ -486,7 +486,7 @@ module.exports = (() => {
486
486
  getPositions(portfolio) {
487
487
  assert.argumentIsRequired(portfolio, 'portfolio', String);
488
488
 
489
- return getPositionItemsForPortfolio(this._items, portfolio).map(item => item.position);
489
+ return getPositionItemsForPortfolio(this._items, portfolio);
490
490
  }
491
491
 
492
492
  /**
@@ -178,7 +178,8 @@ module.exports = (() => {
178
178
  const quoteChangeNegative = quote.lastPriceDirection === 'down';
179
179
 
180
180
  setTimeout(() => this._dataFormat.quoteChangeDirection = { up: quoteChangePositive, down: quoteChangeNegative }, 0);
181
- this._dataFormat.quoteChangeNegative = quoteChangeNegative;
181
+
182
+ this._dataFormat.quoteChangeNegative = is.number(this._dataActual.quoteChange) && this._dataActual.quoteChange < 0;
182
183
  } else {
183
184
  this._dataActual.currentPrice = null;
184
185
  this._dataFormat.currentPrice = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.183",
3
+ "version": "1.0.187",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -702,10 +702,10 @@ module.exports = (() => {
702
702
  const distributionCash = new TransactionType('DC', 'Distribution (Cash)', 'Cash Distribution', false, false, true, false, false);
703
703
  const distributionFund = new TransactionType('DF', 'Distribution (Units)', 'Unit Distribution', false, false, false, true, false);
704
704
 
705
- const deposit = new TransactionType('D', 'Deposit', 'Deposit', false, false, false, true, false);
706
- const withdrawal = new TransactionType('W', 'Withdrawal', 'Withdrawal', false, false, false, false, true);
707
- const debit = new TransactionType('DR', 'Debit', 'Debit', false, false, false, false, true);
708
- const credit = new TransactionType('CR', 'Credit', 'Credit', false, false, false, true, false);
705
+ const deposit = new TransactionType('D', 'Deposit', 'Deposit', false, false, false, false, false);
706
+ const withdrawal = new TransactionType('W', 'Withdrawal', 'Withdrawal', false, false, false, false, false);
707
+ const debit = new TransactionType('DR', 'Debit', 'Debit', false, false, false, false, false);
708
+ const credit = new TransactionType('CR', 'Credit', 'Credit', false, false, false, false, false);
709
709
 
710
710
  const valuation = new TransactionType('V', 'Valuation', 'Valuation', false, false, false, false, false);
711
711
  const income = new TransactionType('I', 'Income', 'Income', false, false, true, false, false);
@@ -964,7 +964,7 @@ module.exports = (() => {
964
964
  addSummaryPrevious(this._summariesPrevious, summary, this._previousSummaryFrame, this._previousSummaryRanges);
965
965
  });
966
966
 
967
- const item = createPositionItem(position);
967
+ const item = createPositionItem.call(this, position);
968
968
 
969
969
  addBarchartSymbol(this._symbols, item);
970
970
  addDisplaySymbol(this._symbolsDisplay, item);
@@ -1202,7 +1202,7 @@ module.exports = (() => {
1202
1202
  getPositions(portfolio) {
1203
1203
  assert.argumentIsRequired(portfolio, 'portfolio', String);
1204
1204
 
1205
- return getPositionItemsForPortfolio(this._items, portfolio).map(item => item.position);
1205
+ return getPositionItemsForPortfolio(this._items, portfolio);
1206
1206
  }
1207
1207
 
1208
1208
  /**
@@ -1706,7 +1706,8 @@ module.exports = (() => {
1706
1706
  const quoteChangeNegative = quote.lastPriceDirection === 'down';
1707
1707
 
1708
1708
  setTimeout(() => this._dataFormat.quoteChangeDirection = { up: quoteChangePositive, down: quoteChangeNegative }, 0);
1709
- this._dataFormat.quoteChangeNegative = quoteChangeNegative;
1709
+
1710
+ this._dataFormat.quoteChangeNegative = is.number(this._dataActual.quoteChange) && this._dataActual.quoteChange < 0;
1710
1711
  } else {
1711
1712
  this._dataActual.currentPrice = null;
1712
1713
  this._dataFormat.currentPrice = null;