@barchart/portfolio-api-common 1.2.31 → 1.2.35

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.
@@ -1,6 +1,7 @@
1
1
  const assert = require('@barchart/common-js/lang/assert'),
2
2
  ComparatorBuilder = require('@barchart/common-js/collections/sorting/ComparatorBuilder'),
3
3
  comparators = require('@barchart/common-js/collections/sorting/comparators'),
4
+ Day = require('@barchart/common-js/lang/Day'),
4
5
  Decimal = require('@barchart/common-js/lang/Decimal'),
5
6
  is = require('@barchart/common-js/lang/is'),
6
7
  formatter = require('@barchart/common-js/lang/formatter');
@@ -272,7 +273,7 @@ module.exports = (() => {
272
273
  }).thenBy((a, b) => {
273
274
  return comparators.compareStrings(a.instrument.id, b.instrument.id);
274
275
  }).thenBy((a, b) => {
275
- return comparators.compareStrings(a.sequence, b.sequence);
276
+ return comparators.compareNumbers(b.sequence, a.sequence);
276
277
  }).toComparator();
277
278
 
278
279
  return TransactionFormatter;
@@ -122,7 +122,7 @@ module.exports = (() => {
122
122
  }
123
123
 
124
124
  /**
125
- * The year-to-date position summary of the encapsulated position.
125
+ * The year-to-date summary of the encapsulated position.
126
126
  *
127
127
  * @public
128
128
  * @returns {Object}
@@ -101,7 +101,7 @@ module.exports = (() => {
101
101
  .withField('name', DataType.STRING)
102
102
  .withField('timezone', DataType.forEnum(Timezones, 'Timezone'))
103
103
  .withField('dates.create', DataType.DAY)
104
- .withField('dates.cash', DataType.DAY, true)
104
+ .withField('defaults.cash', DataType.BOOLEAN, true)
105
105
  .withField('defaults.currency', DataType.forEnum(Currency, 'Currency'))
106
106
  .withField('defaults.reinvest', DataType.BOOLEAN, true)
107
107
  .withField('defaults.valuation', DataType.forEnum(ValuationType, 'ValuationType'))
@@ -123,7 +123,7 @@ module.exports = (() => {
123
123
  .withField('name', DataType.STRING)
124
124
  .withField('timezone', DataType.forEnum(Timezones, 'Timezone'))
125
125
  .withField('dates.create', DataType.DAY)
126
- .withField('dates.cash', DataType.DAY, true)
126
+ .withField('defaults.cash', DataType.BOOLEAN, true)
127
127
  .withField('defaults.currency', DataType.forEnum(Currency, 'Currency'))
128
128
  .withField('defaults.reinvest', DataType.BOOLEAN, true)
129
129
  .withField('defaults.valuation', DataType.forEnum(ValuationType, 'ValuationType'))
@@ -146,7 +146,7 @@ module.exports = (() => {
146
146
  const create = new PortfolioSchema(SchemaBuilder.withName('create')
147
147
  .withField('name', DataType.STRING)
148
148
  .withField('timezone', DataType.forEnum(Timezones, 'Timezone'))
149
- .withField('dates.cash', DataType.DAY, true)
149
+ .withField('defaults.cash', DataType.BOOLEAN, true)
150
150
  .withField('defaults.currency', DataType.forEnum(Currency, 'Currency'), true)
151
151
  .withField('defaults.reinvest', DataType.BOOLEAN, true)
152
152
  .withField('defaults.valuation', DataType.forEnum(ValuationType, 'ValuationType'), true)
@@ -158,6 +158,7 @@ module.exports = (() => {
158
158
  .withField('portfolio', DataType.STRING)
159
159
  .withField('name', DataType.STRING)
160
160
  .withField('timezone', DataType.forEnum(Timezones, 'Timezone'), true)
161
+ .withField('defaults.cash', DataType.BOOLEAN, true)
161
162
  .withField('defaults.currency', DataType.forEnum(Currency, 'Currency'), true)
162
163
  .withField('defaults.reinvest', DataType.BOOLEAN, true)
163
164
  .withField('miscellany', DataType.AD_HOC, true)
@@ -87,8 +87,9 @@ module.exports = (() => {
87
87
  .withField('position', DataType.STRING)
88
88
  .withField('open', DataType.BOOLEAN, true)
89
89
  .withField('transaction', DataType.NUMBER)
90
- .withField('valuation', DataType.forEnum(ValuationType, 'ValuationType'))
90
+ .withField('cash', DataType.BOOLEAN, true)
91
91
  .withField('reinvest', DataType.BOOLEAN, true)
92
+ .withField('valuation', DataType.forEnum(ValuationType, 'ValuationType'))
92
93
  .withField('snapshot.date', DataType.DAY)
93
94
  .withField('snapshot.open', DataType.DECIMAL)
94
95
  .withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
@@ -120,8 +121,9 @@ module.exports = (() => {
120
121
  .withField('position', DataType.STRING)
121
122
  .withField('open', DataType.BOOLEAN, true)
122
123
  .withField('transaction', DataType.NUMBER)
123
- .withField('valuation', DataType.forEnum(ValuationType, 'ValuationType'))
124
+ .withField('cash', DataType.BOOLEAN, true)
124
125
  .withField('reinvest', DataType.BOOLEAN, true)
126
+ .withField('valuation', DataType.forEnum(ValuationType, 'ValuationType'))
125
127
  .withField('snapshot.date', DataType.DAY)
126
128
  .withField('snapshot.open', DataType.DECIMAL)
127
129
  .withField('snapshot.direction', DataType.forEnum(PositionDirection, 'PositionDirection'))
@@ -143,6 +145,7 @@ module.exports = (() => {
143
145
  .withField('mapping.currency', DataType.forEnum(Currency, 'Currency'), true)
144
146
  .withField('mapping.symbol.barchart', DataType.STRING, true)
145
147
  .withField('mapping.symbol.display', DataType.STRING, true)
148
+ .withField('cash', DataType.BOOLEAN, true)
146
149
  .withField('reinvest', DataType.BOOLEAN, true)
147
150
  .schema
148
151
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.2.31",
3
+ "version": "1.2.35",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -3187,7 +3187,7 @@ module.exports = (() => {
3187
3187
  }
3188
3188
 
3189
3189
  /**
3190
- * The year-to-date position summary of the encapsulated position.
3190
+ * The year-to-date summary of the encapsulated position.
3191
3191
  *
3192
3192
  * @public
3193
3193
  * @returns {Object}