@barchart/portfolio-api-common 1.2.36 → 1.2.40
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.
|
@@ -198,7 +198,6 @@ module.exports = (() => {
|
|
|
198
198
|
|
|
199
199
|
associateTypes(InstrumentType.CASH, TransactionType.DEPOSIT, true);
|
|
200
200
|
associateTypes(InstrumentType.CASH, TransactionType.WITHDRAWAL, true);
|
|
201
|
-
associateTypes(InstrumentType.CASH, TransactionType.FEE, true);
|
|
202
201
|
associateTypes(InstrumentType.CASH, TransactionType.DEBIT, false);
|
|
203
202
|
associateTypes(InstrumentType.CASH, TransactionType.CREDIT, false);
|
|
204
203
|
|
|
@@ -267,13 +267,13 @@ module.exports = (() => {
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
const comparator = ComparatorBuilder.startWith((a, b) => {
|
|
270
|
-
return Day.compareDays(
|
|
270
|
+
return Day.compareDays(a.date, b.date);
|
|
271
271
|
}).thenBy((a, b) => {
|
|
272
272
|
return comparators.compareNumbers(getInstrumentTypePriority(a.instrument.type), getInstrumentTypePriority(b.instrument.type));
|
|
273
273
|
}).thenBy((a, b) => {
|
|
274
274
|
return comparators.compareStrings(a.instrument.id, b.instrument.id);
|
|
275
275
|
}).thenBy((a, b) => {
|
|
276
|
-
return comparators.compareNumbers(
|
|
276
|
+
return comparators.compareNumbers(a.sequence, b.sequence);
|
|
277
277
|
}).toComparator();
|
|
278
278
|
|
|
279
279
|
return TransactionFormatter;
|
|
@@ -216,7 +216,7 @@ module.exports = (() => {
|
|
|
216
216
|
.withField('instrument.symbol.barchart', DataType.STRING, true)
|
|
217
217
|
.withField('instrument.symbol.display', DataType.STRING, true)
|
|
218
218
|
.withField('date', DataType.DAY)
|
|
219
|
-
.withField('price', DataType.DECIMAL)
|
|
219
|
+
.withField('price', DataType.DECIMAL, true)
|
|
220
220
|
.withField('quantity', DataType.DECIMAL)
|
|
221
221
|
.withField('fee', DataType.DECIMAL, true)
|
|
222
222
|
.withField('reinvest', DataType.BOOLEAN, true)
|
|
@@ -231,7 +231,7 @@ module.exports = (() => {
|
|
|
231
231
|
.withField('sequence', DataType.NUMBER, true)
|
|
232
232
|
.withField('type', DataType.forEnum(TransactionType, 'TransactionType'))
|
|
233
233
|
.withField('date', DataType.DAY)
|
|
234
|
-
.withField('price', DataType.DECIMAL)
|
|
234
|
+
.withField('price', DataType.DECIMAL, true)
|
|
235
235
|
.withField('quantity', DataType.DECIMAL)
|
|
236
236
|
.withField('fee', DataType.DECIMAL, true)
|
|
237
237
|
.withField('force', DataType.BOOLEAN, true)
|
|
@@ -291,9 +291,7 @@ module.exports = (() => {
|
|
|
291
291
|
.withField('instrument.currency', DataType.forEnum(Currency, 'Currency'), true)
|
|
292
292
|
.withField('date', DataType.DAY)
|
|
293
293
|
.withField('amount', DataType.DECIMAL)
|
|
294
|
-
.withField('fee', DataType.DECIMAL, true)
|
|
295
294
|
.withField('force', DataType.BOOLEAN, true)
|
|
296
|
-
.withField('cash', DataType.BOOLEAN, true)
|
|
297
295
|
.schema
|
|
298
296
|
);
|
|
299
297
|
|
|
@@ -306,7 +304,6 @@ module.exports = (() => {
|
|
|
306
304
|
.withField('instrument.currency', DataType.forEnum(Currency, 'Currency'), true)
|
|
307
305
|
.withField('date', DataType.DAY)
|
|
308
306
|
.withField('amount', DataType.DECIMAL)
|
|
309
|
-
.withField('fee', DataType.DECIMAL, true)
|
|
310
307
|
.withField('force', DataType.BOOLEAN, true)
|
|
311
308
|
.schema
|
|
312
309
|
);
|
package/package.json
CHANGED
package/test/SpecRunner.js
CHANGED
|
@@ -1226,7 +1226,6 @@ module.exports = (() => {
|
|
|
1226
1226
|
|
|
1227
1227
|
associateTypes(InstrumentType.CASH, TransactionType.DEPOSIT, true);
|
|
1228
1228
|
associateTypes(InstrumentType.CASH, TransactionType.WITHDRAWAL, true);
|
|
1229
|
-
associateTypes(InstrumentType.CASH, TransactionType.FEE, true);
|
|
1230
1229
|
associateTypes(InstrumentType.CASH, TransactionType.DEBIT, false);
|
|
1231
1230
|
associateTypes(InstrumentType.CASH, TransactionType.CREDIT, false);
|
|
1232
1231
|
|