@barchart/portfolio-api-common 1.0.245 → 1.0.249

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.
@@ -13,7 +13,18 @@ module.exports = (() => {
13
13
  }
14
14
 
15
15
  /**
16
- * The portfolio referenced does not exist.
16
+ * The portfolio does not exist.
17
+ *
18
+ * @public
19
+ * @static
20
+ * @returns {FailureType}
21
+ */
22
+ static get PORTFOLIO_UPDATE_FAILED_NO_PORTFOLIO() {
23
+ return portfolioUpdateFailedNoPortfolio;
24
+ }
25
+
26
+ /**
27
+ * The portfolio does not exist.
17
28
  *
18
29
  * @public
19
30
  * @static
@@ -24,7 +35,18 @@ module.exports = (() => {
24
35
  }
25
36
 
26
37
  /**
27
- * The referenced position does not exist.
38
+ * The portfolio does not exist.
39
+ *
40
+ * @public
41
+ * @static
42
+ * @returns {FailureType}
43
+ */
44
+ static get POSITION_UPDATE_FAILED_NO_POSITION() {
45
+ return positionUpdateFailedNoPosition;
46
+ }
47
+
48
+ /**
49
+ * The position does not exist.
28
50
  *
29
51
  * @public
30
52
  * @static
@@ -103,7 +125,10 @@ module.exports = (() => {
103
125
  }
104
126
  }
105
127
 
106
- const positionCreateFailedNoPortfolio = new FailureType('POSITION_CREATE_FAILED_NO_PORTFOLIO', 'Unable to create transaction. The referenced portfolio does not exist. Has it been deleted?');
128
+ const portfolioUpdateFailedNoPortfolio = new FailureType('PORTFOLIO_UPDATED_FAILED_NO_PORTFOLIO', 'Unable to update portfolio. The portfolio does not exist, has it been deleted?');
129
+
130
+ const positionCreateFailedNoPortfolio = new FailureType('POSITION_CREATE_FAILED_NO_PORTFOLIO', 'Unable to create transaction. The portfolio does not exist, has it been deleted?');
131
+ const positionUpdateFailedNoPosition = new FailureType('POSITION_UPDATE_FAILED_NO_POSITION', 'Unable to update preferences for position. The position does not exist, has it been deleted?');
107
132
 
108
133
  const transactionCreateFailedNoPosition = new FailureType('TRANSACTION_CREATE_FAILED_NO_POSITION', 'Unable to create transaction. The referenced position does not exist. Has it been deleted?');
109
134
  const transactionCreateFailedOutOfSequence = new FailureType('TRANSACTION_CREATE_FAILED_OUT_OF_SEQUENCE', 'Unable to process 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).');
@@ -58,6 +58,17 @@ module.exports = (() => {
58
58
  return client;
59
59
  }
60
60
 
61
+ /**
62
+ * Data required to update a position.
63
+ *
64
+ * @static
65
+ * @public
66
+ * @returns {PositionSchema}
67
+ */
68
+ static get UPDATE() {
69
+ return update;
70
+ }
71
+
61
72
  toString() {
62
73
  return '[PositionSchema]';
63
74
  }
@@ -123,5 +134,12 @@ module.exports = (() => {
123
134
  .schema
124
135
  );
125
136
 
137
+ const update = new PositionSchema(SchemaBuilder.withName('update')
138
+ .withField('portfolio', DataType.STRING)
139
+ .withField('position', DataType.STRING)
140
+ .withField('reinvest', DataType.BOOLEAN, true)
141
+ .schema
142
+ );
143
+
126
144
  return PositionSchema;
127
145
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.245",
3
+ "version": "1.0.249",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",