@barchart/portfolio-api-common 1.0.42 → 1.0.47

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.
@@ -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';
@@ -64,10 +65,9 @@ module.exports = (() => {
64
65
  const complete = new PositionSchema(SchemaBuilder.withName('complete')
65
66
  .withField('user', DataType.STRING)
66
67
  .withField('portfolio', DataType.STRING)
67
- .withField('sequence', DataType.NUMBER)
68
68
  .withField('instrument.id', DataType.STRING)
69
69
  .withField('instrument.name', DataType.STRING)
70
- .withField('instrument.type', DataType.STRING)
70
+ .withField('instrument.type', DataType.forEnum(InstrumentType, 'InstrumentType'))
71
71
  .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
72
72
  .withField('instrument.delist', DataType.DAY, true)
73
73
  .withField('instrument.symbol.barchart', DataType.STRING, true)
@@ -96,10 +96,9 @@ module.exports = (() => {
96
96
  const client = new PositionSchema(SchemaBuilder.withName('client')
97
97
  .withField('user', DataType.STRING)
98
98
  .withField('portfolio', DataType.STRING)
99
- .withField('sequence', DataType.NUMBER)
100
99
  .withField('instrument.id', DataType.STRING)
101
100
  .withField('instrument.name', DataType.STRING)
102
- .withField('instrument.type', DataType.STRING)
101
+ .withField('instrument.type', DataType.forEnum(InstrumentType, 'InstrumentType'))
103
102
  .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
104
103
  .withField('instrument.delist', DataType.DAY, true)
105
104
  .withField('instrument.symbol.barchart', DataType.STRING, true)
@@ -117,6 +116,7 @@ module.exports = (() => {
117
116
  .withField('snapshot.basis', DataType.DECIMAL)
118
117
  .withField('snapshot.income', DataType.DECIMAL)
119
118
  .withField('snapshot.value', DataType.DECIMAL)
119
+ .withField('previous', DataType.NUMBER, true)
120
120
  .schema
121
121
  );
122
122
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.42",
3
+ "version": "1.0.47",
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