@barchart/portfolio-api-common 1.0.28 → 1.0.29

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.
@@ -272,6 +272,11 @@ module.exports = (() => {
272
272
  .withField('portfolio', DataType.STRING)
273
273
  .withField('position', DataType.STRING)
274
274
  .withField('type', DataType.forEnum(TransactionType, 'TransactionType'))
275
+ .withField('instrument.name', DataType.STRING, true)
276
+ .withField('instrument.type', DataType.STRING, true)
277
+ .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'), true)
278
+ .withField('instrument.symbol.barchart', DataType.STRING, true)
279
+ .withField('instrument.symbol.display', DataType.STRING, true)
275
280
  .withField('date', DataType.DAY)
276
281
  .withField('price', DataType.DECIMAL)
277
282
  .withField('quantity', DataType.DECIMAL)
@@ -283,11 +288,6 @@ module.exports = (() => {
283
288
  .withField('portfolio', DataType.STRING)
284
289
  .withField('position', DataType.STRING)
285
290
  .withField('type', DataType.forEnum(TransactionType, 'TransactionType'))
286
- .withField('instrument.name', DataType.STRING, true)
287
- .withField('instrument.type', DataType.STRING, true)
288
- .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'), true)
289
- .withField('instrument.symbol.barchart', DataType.STRING, true)
290
- .withField('instrument.symbol.display', DataType.STRING, true)
291
291
  .withField('date', DataType.DAY)
292
292
  .withField('price', DataType.DECIMAL)
293
293
  .withField('quantity', DataType.DECIMAL)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",
@@ -631,6 +631,37 @@ module.exports = function () {
631
631
  return Day.compareDays(this, other) > 0;
632
632
  }
633
633
 
634
+ /**
635
+ * Indicates the current day falls between two other days, inclusive
636
+ * of the range boundaries.
637
+ *
638
+ * @public
639
+ * @param {Day=} first
640
+ * @param {Day=} last
641
+ * @param {boolean=} exclusive
642
+ * @returns {boolean}
643
+ */
644
+
645
+ }, {
646
+ key: 'getIsContained',
647
+ value: function getIsContained(first, last) {
648
+ assert.argumentIsOptional(first, 'first', Day, 'Day');
649
+ assert.argumentIsOptional(last, 'last', Day, 'Day');
650
+
651
+ var notAfter = void 0;
652
+ var notBefore = void 0;
653
+
654
+ if (first && last && first.getIsAfter(last)) {
655
+ notBefore = false;
656
+ notAfter = false;
657
+ } else {
658
+ notAfter = !(last instanceof Day) || !this.getIsAfter(last);
659
+ notBefore = !(first instanceof Day) || !this.getIsBefore(first);
660
+ }
661
+
662
+ return notAfter && notBefore;
663
+ }
664
+
634
665
  /**
635
666
  * Indicates if another {@link Day} occurs after the current instance.
636
667
  *