@barchart/portfolio-api-common 1.6.0 → 1.7.0

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,3 +1,3 @@
1
1
  **New Features**
2
2
 
3
- * Added a new `FailureItem` for attempting tp edit a transaction's type.
3
+ * Added a new `PortfolioFailureType` for attempting to edit a transaction's type.
@@ -0,0 +1,3 @@
1
+ **New Features**
2
+
3
+ * Added a new `PortfolioFailureType` for attempting to reinvest a dividend when the position is short.
@@ -212,6 +212,18 @@ module.exports = (() => {
212
212
  return transactionCreateFailedReinvestPriceUnavailable;
213
213
  }
214
214
 
215
+ /**
216
+ * The transaction failed because a dividends cannot be re-invested
217
+ * for short positions.
218
+ *
219
+ * @public
220
+ * @static
221
+ * @returns {FailureType}
222
+ */
223
+ static get TRANSACTION_CREATE_FAILED_REINVEST_INVALID() {
224
+ return transactionCreateFailedReinvestInvalid;
225
+ }
226
+
215
227
  /**
216
228
  * The transaction failed because a related position is locked.
217
229
  *
@@ -364,6 +376,7 @@ module.exports = (() => {
364
376
 
365
377
  const transactionCreateFailedTypeReserved = new FailureType('TRANSACTION_CREATE_FAILED_TYPE_RESERVED', 'Unable to create {U|type.description} transaction, this type of transaction is managed by the system.');
366
378
  const transactionCreateFailedReinvestPriceUnavailable = new FailureType('TRANSACTION_CREATE_FAILED_REINVEST_PRICE_UNAVAILABLE', 'Unable to create transaction, a dividend was paid on {L|day}; however no historical price is available for this day. To successfully create this transaction, please turn off dividend reinvestment for this position.');
379
+ const transactionCreateFailedReinvestInvalid = new FailureType('TRANSACTION_CREATE_FAILED_REINVEST_INVALID', 'Unable to create transaction, short positions do not allow dividends to be reinvested.');
367
380
  const transactionCreateFailedPositionLocked = new FailureType('TRANSACTION_CREATE_FAILED_POSITION_LOCKED', 'Unable to create transaction, your {L|description} history is being recalculated. Please re-enter this transaction in a minute or two.');
368
381
  const transactionCreateFailedInstrumentCorrupt = new FailureType('TRANSACTION_CREATE_FAILED_INSTRUMENT_CORRUPT', 'Unable to create transaction, corporate action history for {U|symbol} cannot be located. The issue should be corrected within 24 to 48 hours.');
369
382
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Common code used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",