@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.
|
@@ -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
|
|
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.
|
|
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.
|
|
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
package/test/SpecRunner.js
CHANGED