@barchart/portfolio-api-common 1.0.8 → 1.0.9

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.
@@ -28,12 +28,12 @@ module.exports = (() => {
28
28
  return this._schema;
29
29
  }
30
30
 
31
- static get COMPLETE() {
32
- return complete;
31
+ static get CREATE() {
32
+ return create;
33
33
  }
34
34
 
35
- static get SIMPLE() {
36
- return simple;
35
+ static get COMPLETE() {
36
+ return complete;
37
37
  }
38
38
 
39
39
  toString() {
@@ -60,14 +60,19 @@ module.exports = (() => {
60
60
  .schema
61
61
  );
62
62
 
63
- const simple = new PortfolioSchema(SchemaBuilder.withName('Simple')
63
+ const create = new PortfolioSchema(SchemaBuilder.withName('Create')
64
64
  .withField('user', DataType.STRING)
65
65
  .withField('portfolio', DataType.STRING)
66
66
  .withField('name', DataType.STRING)
67
67
  .withField('timezone', DataType.forEnum(Timezones, 'Timezone'))
68
+ .withField('dates.create', DataType.DAY)
69
+ .withField('dates.cash', DataType.DAY, true)
68
70
  .withField('defaults.currency', DataType.forEnum(Currency, 'Currency'))
69
- .withField('legacy.warnings', DataType.NUMBER, true)
70
- .withField('legacy.drops', DataType.NUMBER, true)
71
+ .withField('defaults.reinvest', DataType.BOOLEAN, true)
72
+ .withField('defaults.valuation', DataType.forEnum(ValuationType, 'ValuationType'))
73
+ .withField('legacy.system', DataType.STRING, true)
74
+ .withField('legacy.user', DataType.STRING, true)
75
+ .withField('system.version', DataType.NUMBER, true)
71
76
  .schema
72
77
  );
73
78
 
@@ -31,10 +31,6 @@ module.exports = (() => {
31
31
  return complete;
32
32
  }
33
33
 
34
- static get SIMPLE() {
35
- return simple;
36
- }
37
-
38
34
  toString() {
39
35
  return '[PositionSchema]';
40
36
  }
@@ -72,25 +68,5 @@ module.exports = (() => {
72
68
  .schema
73
69
  );
74
70
 
75
- const simple = new PositionSchema(SchemaBuilder.withName('Simple')
76
- .withField('position', DataType.STRING)
77
- .withField('instrument.id', DataType.STRING)
78
- .withField('instrument.name', DataType.STRING)
79
- .withField('instrument.type', DataType.STRING)
80
- .withField('instrument.currency', DataType.forEnum(Currency, 'Currency'))
81
- .withField('instrument.delist', DataType.DAY, true)
82
- .withField('instrument.symbol.barchart', DataType.STRING, true)
83
- .withField('instrument.symbol.display', DataType.STRING, true)
84
- .withField('snapshot.date', DataType.DAY)
85
- .withField('snapshot.open', DataType.DECIMAL)
86
- .withField('snapshot.buys', DataType.DECIMAL)
87
- .withField('snapshot.sells', DataType.DECIMAL)
88
- .withField('snapshot.gain', DataType.DECIMAL)
89
- .withField('snapshot.basis', DataType.DECIMAL)
90
- .withField('snapshot.income', DataType.DECIMAL)
91
- .withField('snapshot.value', DataType.DECIMAL)
92
- .schema
93
- );
94
-
95
71
  return PositionSchema;
96
72
  })();
@@ -30,22 +30,6 @@ module.exports = (() => {
30
30
  return complete;
31
31
  }
32
32
 
33
- static get SIMPLE() {
34
- return simple;
35
- }
36
-
37
- static get DISPLAY() {
38
- return display;
39
- }
40
-
41
- static get DOWNLOAD() {
42
- return download;
43
- }
44
-
45
- static get SNAPSHOT() {
46
- return snapshot;
47
- }
48
-
49
33
  toString() {
50
34
  return '[TransactionSchema]';
51
35
  }
@@ -91,58 +75,5 @@ module.exports = (() => {
91
75
  .schema
92
76
  );
93
77
 
94
- const simple = new TransactionSchema(SchemaBuilder.withName('Simple')
95
- .withField('sequence', DataType.NUMBER)
96
- .withField('date', DataType.DAY)
97
- .withField('description', DataType.STRING)
98
- .withField('amount', DataType.DECIMAL)
99
- .schema
100
- );
101
-
102
- const display = new TransactionSchema(SchemaBuilder.withName('Display')
103
- .withField('sequence', DataType.NUMBER)
104
- .withField('type', DataType.forEnum(TransactionType, 'TransactionType'))
105
- .withField('date', DataType.DAY)
106
- .withField('amount', DataType.DECIMAL)
107
- .withField('quantity', DataType.DECIMAL)
108
- .withField('fee', DataType.DECIMAL)
109
- .withField('snapshot.open', DataType.DECIMAL)
110
- .withField('trade.price', DataType.DECIMAL, true)
111
- .withField('dividend.rate', DataType.DECIMAL, true)
112
- .withField('dividend.amount', DataType.DECIMAL, true)
113
- .withField('charge.amount', DataType.DECIMAL, true)
114
- .withField('income.amount', DataType.DECIMAL, true)
115
- .withField('valuation.value', DataType.DECIMAL, true)
116
- .schema
117
- );
118
-
119
- const download = new TransactionSchema(SchemaBuilder.withName('Download')
120
- .withField('sequence', DataType.NUMBER)
121
- .withField('type', DataType.forEnum(TransactionType, 'TransactionType'))
122
- .withField('date', DataType.DAY)
123
- .withField('amount', DataType.DECIMAL)
124
- .withField('quantity', DataType.DECIMAL)
125
- .withField('fee', DataType.DECIMAL)
126
- .withField('snapshot.open', DataType.DECIMAL)
127
- .withField('trade.price', DataType.DECIMAL, true)
128
- .withField('dividend.rate', DataType.DECIMAL, true)
129
- .withField('dividend.amount', DataType.DECIMAL, true)
130
- .withField('charge.amount', DataType.DECIMAL, true)
131
- .withField('income.amount', DataType.DECIMAL, true)
132
- .withField('valuation.value', DataType.DECIMAL, true)
133
- .schema);
134
-
135
- const snapshot = new TransactionSchema(SchemaBuilder.withName('Snapshot')
136
- .withField('position', DataType.STRING)
137
- .withField('sequence', DataType.NUMBER)
138
- .withField('date', DataType.DAY)
139
- .withField('snapshot.open', DataType.DECIMAL)
140
- .withField('snapshot.gain', DataType.DECIMAL)
141
- .withField('snapshot.basis', DataType.DECIMAL)
142
- .withField('snapshot.income', DataType.DECIMAL)
143
- .withField('snapshot.value', DataType.DECIMAL)
144
- .schema
145
- );
146
-
147
78
  return TransactionSchema;
148
79
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",