@barchart/portfolio-api-common 1.3.17 → 1.3.18
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.
- package/lib/serialization/PositionSummarySchema.js +22 -0
- package/package.json +1 -1
- package/test/SpecRunner.js +3785 -2826
|
@@ -54,6 +54,18 @@ module.exports = (() => {
|
|
|
54
54
|
return client;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Reduced schema that only includes frames and dates -- allowing consumer
|
|
59
|
+
* to detect existence (or non-existence) of summary.
|
|
60
|
+
*
|
|
61
|
+
* @static
|
|
62
|
+
* @public
|
|
63
|
+
* @returns {PositionSummarySchema}
|
|
64
|
+
*/
|
|
65
|
+
static get EXISTS() {
|
|
66
|
+
return exists;
|
|
67
|
+
}
|
|
68
|
+
|
|
57
69
|
toString() {
|
|
58
70
|
return '[PositionSummarySchema]';
|
|
59
71
|
}
|
|
@@ -111,5 +123,15 @@ module.exports = (() => {
|
|
|
111
123
|
.schema
|
|
112
124
|
);
|
|
113
125
|
|
|
126
|
+
const exists = new PositionSummarySchema(SchemaBuilder.withName('complete')
|
|
127
|
+
.withField('user', DataType.STRING)
|
|
128
|
+
.withField('portfolio', DataType.STRING)
|
|
129
|
+
.withField('position', DataType.STRING)
|
|
130
|
+
.withField('frame', DataType.forEnum(PositionSummaryFrame, 'PositionSummaryFrame'))
|
|
131
|
+
.withField('start.date', DataType.DAY)
|
|
132
|
+
.withField('end.date', DataType.DAY)
|
|
133
|
+
.schema
|
|
134
|
+
);
|
|
135
|
+
|
|
114
136
|
return PositionSummarySchema;
|
|
115
137
|
})();
|