@barchart/portfolio-api-common 1.0.198 → 1.0.199
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.
|
@@ -15,6 +15,7 @@ module.exports = (() => {
|
|
|
15
15
|
/**
|
|
16
16
|
* The transaction would occur before an existing transaction.
|
|
17
17
|
*
|
|
18
|
+
* @public
|
|
18
19
|
* @static
|
|
19
20
|
* @returns {FailureType}
|
|
20
21
|
*/
|
|
@@ -26,6 +27,7 @@ module.exports = (() => {
|
|
|
26
27
|
* The transaction would cause the position to change (from long to
|
|
27
28
|
* short, or vice versa).
|
|
28
29
|
*
|
|
30
|
+
* @public
|
|
29
31
|
* @static
|
|
30
32
|
* @returns {FailureType}
|
|
31
33
|
*/
|
|
@@ -33,6 +35,26 @@ module.exports = (() => {
|
|
|
33
35
|
return transactionCreateFailedDirectionSwitch;
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
static get TRANSACTION_CREATE_REWRITE_UNSUPPORTED() {
|
|
39
|
+
return transactionCreateRewriteUnsupported;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Deleting any transaction except for the most recent requires
|
|
44
|
+
* re-writing transaction history.
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
* @static
|
|
48
|
+
* @returns {FailureType}
|
|
49
|
+
*/
|
|
50
|
+
static get TRANSACTION_DELETE_FAILED_OUT_OF_SEQUENCE() {
|
|
51
|
+
return transactionDeleteFailedOutOfSequence;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static get TRANSACTION_DELETE_UNSUPPORTED() {
|
|
55
|
+
return transactionDeleteUnsupported;
|
|
56
|
+
}
|
|
57
|
+
|
|
36
58
|
toString() {
|
|
37
59
|
return '[PortfolioFailureType]';
|
|
38
60
|
}
|
|
@@ -40,6 +62,10 @@ module.exports = (() => {
|
|
|
40
62
|
|
|
41
63
|
const transactionCreateFailedOutOfSequence = new FailureType('TRANSACTION_CREATE_FAILED_OUT_OF_SEQUENCE', 'Unable to create transaction, because the transaction date is out-of-sequence. In other words, it would occur before an existing transaction. Please confirm your intent to re-write transaction history (which could take some time and alter the historical results for this position).');
|
|
42
64
|
const transactionCreateFailedDirectionSwitch = new FailureType('TRANSACTION_CREATE_FAILED_DIRECTION_SWITCH', 'Unable to create transaction, because the position direction would be switched (from long to short or vice versa). Please close the position (to a zero balance) first, then enter a second transaction.');
|
|
65
|
+
const transactionCreateRewriteUnsupported = new FailureType('TRANSACTION_CREATE_REWRITE_UNSUPPORTED', 'Unable to re-write transaction history. This operation is not currently supported (but will be implemented soon).');
|
|
66
|
+
|
|
67
|
+
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).');
|
|
68
|
+
const transactionDeleteUnsupported = new FailureType('TRANSACTION_DELETE_UNSUPPORTED', 'Unable to delete transaction. This operation is not currently supported (but will be implemented soon).');
|
|
43
69
|
|
|
44
70
|
return PortfolioFailureType;
|
|
45
71
|
})();
|