@barchart/portfolio-api-common 1.0.255 → 1.0.256
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.
|
@@ -120,6 +120,17 @@ module.exports = (() => {
|
|
|
120
120
|
return transactionDeleteFailedNoTransaction;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
+
/**
|
|
124
|
+
* Unable to delete, the position's direction would switch.
|
|
125
|
+
*
|
|
126
|
+
* @public
|
|
127
|
+
* @static
|
|
128
|
+
* @returns {FailureType}
|
|
129
|
+
*/
|
|
130
|
+
static get TRANSACTION_DELETE_FAILED_DIRECTION_SWITCH_ON_REWRITE() {
|
|
131
|
+
return transactionDeleteFailedDirectionSwitchOnRewrite;
|
|
132
|
+
}
|
|
133
|
+
|
|
123
134
|
toString() {
|
|
124
135
|
return '[PortfolioFailureType]';
|
|
125
136
|
}
|
|
@@ -138,6 +149,7 @@ module.exports = (() => {
|
|
|
138
149
|
|
|
139
150
|
const transactionDeleteFailedOutOfSequence = new FailureType('TRANSACTION_DELETE_FAILED_OUT_OF_SEQUENCE', 'Deleting any transaction, except for the most recent, will cause transaction history to be re-written. Please confirm your intent to re-write transaction history (which could take some time and alter the historical results for this position).');
|
|
140
151
|
const transactionDeleteFailedNoTransaction = new FailureType('TRANSACTION_DELETE_FAILED_NO_TRANSACTION', 'Unable to delete transaction. The referenced transaction does not exist.');
|
|
152
|
+
const transactionDeleteFailedDirectionSwitchOnRewrite = new FailureType('TRANSACTION_DELETE_FAILED_DIRECTION_SWITCH_ON_REWRITE', 'Deleting this transaction would cause your history to be re-written and the position to switch from long to short (i.e. positive to negative) or vice versa.');
|
|
141
153
|
|
|
142
154
|
return PortfolioFailureType;
|
|
143
155
|
})();
|