@barchart/portfolio-api-common 1.0.41 → 1.0.46

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.
@@ -10,20 +10,20 @@ module.exports = (() => {
10
10
  * @public
11
11
  * @extends {Enum}
12
12
  * @param {String} description
13
- * @param {String} groupDescription
13
+ * @param {String} alternateDescription
14
14
  * @param {String} code
15
15
  * @param {Boolean} canReinvest
16
16
  */
17
17
  class InstrumentType extends Enum {
18
- constructor(code, description, groupDescription, canReinvest) {
18
+ constructor(code, description, alternateDescription, canReinvest) {
19
19
  super(code, description);
20
20
 
21
- this._groupDescription = groupDescription;
21
+ this._alternateDescription = alternateDescription;
22
22
  this._canReinvest = canReinvest;
23
23
  }
24
24
 
25
- get groupDescription() {
26
- return this._groupDescription;
25
+ get alternateDescription() {
26
+ return this._alternateDescription;
27
27
  }
28
28
 
29
29
  /**
@@ -19,6 +19,8 @@ module.exports = (() => {
19
19
  this._data.current = null;
20
20
  this._data.previous = position.previous || null;
21
21
 
22
+ const snapshot = this._position.snapshot;
23
+
22
24
  this._priceChangeEvent = new Event(this);
23
25
  }
24
26
 
@@ -6,7 +6,8 @@ const assert = require('@barchart/common-js/lang/assert'),
6
6
  Schema = require('@barchart/common-js/serialization/json/Schema'),
7
7
  SchemaBuilder = require('@barchart/common-js/serialization/json/builders/SchemaBuilder');
8
8
 
9
- const ValuationType = require('./../data/ValuationType');
9
+ const InstrumentType = require('./../data/InstrumentType'),
10
+ ValuationType = require('./../data/ValuationType');
10
11
 
11
12
  module.exports = (() => {
12
13
  'use strict';
@@ -67,7 +68,7 @@ module.exports = (() => {
67
68
  .withField('sequence', DataType.NUMBER)
68
69
  .withField('instrument.id', DataType.STRING)
69
70
  .withField('instrument.name', DataType.STRING)
70
- .withField('instrument.type', DataType.STRING)
71
+ .withField('instrument.type', DataType.forEnum(InstrumentType, 'InstrumentType'))
71
72
  .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
72
73
  .withField('instrument.delist', DataType.DAY, true)
73
74
  .withField('instrument.symbol.barchart', DataType.STRING, true)
@@ -99,7 +100,7 @@ module.exports = (() => {
99
100
  .withField('sequence', DataType.NUMBER)
100
101
  .withField('instrument.id', DataType.STRING)
101
102
  .withField('instrument.name', DataType.STRING)
102
- .withField('instrument.type', DataType.STRING)
103
+ .withField('instrument.type', DataType.forEnum(InstrumentType, 'InstrumentType'))
103
104
  .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
104
105
  .withField('instrument.delist', DataType.DAY, true)
105
106
  .withField('instrument.symbol.barchart', DataType.STRING, true)
@@ -117,6 +118,7 @@ module.exports = (() => {
117
118
  .withField('snapshot.basis', DataType.DECIMAL)
118
119
  .withField('snapshot.income', DataType.DECIMAL)
119
120
  .withField('snapshot.value', DataType.DECIMAL)
121
+ .withField('previous', DataType.NUMBER, true)
120
122
  .schema
121
123
  );
122
124
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.41",
3
+ "version": "1.0.46",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -815,6 +815,8 @@ module.exports = (() => {
815
815
  this._data.current = null;
816
816
  this._data.previous = position.previous || null;
817
817
 
818
+ const snapshot = this._position.snapshot;
819
+
818
820
  this._priceChangeEvent = new Event(this);
819
821
  }
820
822