@barchart/portfolio-api-common 1.0.20 → 1.0.24

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.
@@ -42,6 +42,15 @@ module.exports = (() => {
42
42
  return create;
43
43
  }
44
44
 
45
+ /**
46
+ * @static
47
+ * @public
48
+ * @returns {PortfolioSchema}
49
+ */
50
+ static get CLIENT() {
51
+ return client;
52
+ }
53
+
45
54
  /**
46
55
  * @static
47
56
  * @public
@@ -65,7 +74,7 @@ module.exports = (() => {
65
74
  }
66
75
  }
67
76
 
68
- const complete = new PortfolioSchema(SchemaBuilder.withName('Complete')
77
+ const complete = new PortfolioSchema(SchemaBuilder.withName('complete')
69
78
  .withField('user', DataType.STRING)
70
79
  .withField('portfolio', DataType.STRING)
71
80
  .withField('name', DataType.STRING)
@@ -80,12 +89,16 @@ module.exports = (() => {
80
89
  .withField('legacy.portfolio', DataType.STRING, true)
81
90
  .withField('legacy.warnings', DataType.NUMBER, true)
82
91
  .withField('legacy.drops', DataType.NUMBER, true)
83
- .withField('system.version', DataType.NUMBER, true)
84
- .withField('data', DataType.OBJECT, true)
92
+ .withField('miscellany', DataType.AD_HOC, true)
93
+ .withField('system.sequence', DataType.NUMBER)
94
+ .withField('system.version', DataType.STRING)
95
+ .withField('system.timestamp', DataType.TIMESTAMP)
85
96
  .schema
86
97
  );
87
98
 
88
- const create = new PortfolioSchema(SchemaBuilder.withName('Create')
99
+ const client = new PortfolioSchema(SchemaBuilder.withName('client')
100
+ .withField('user', DataType.STRING)
101
+ .withField('portfolio', DataType.STRING)
89
102
  .withField('name', DataType.STRING)
90
103
  .withField('timezone', DataType.forEnum(Timezones, 'Timezone'))
91
104
  .withField('dates.create', DataType.DAY)
@@ -93,18 +106,34 @@ module.exports = (() => {
93
106
  .withField('defaults.currency', DataType.forEnum(Currency, 'Currency'))
94
107
  .withField('defaults.reinvest', DataType.BOOLEAN, true)
95
108
  .withField('defaults.valuation', DataType.forEnum(ValuationType, 'ValuationType'))
96
- .withField('data', DataType.OBJECT, true)
109
+ .withField('legacy.system', DataType.STRING, true)
110
+ .withField('legacy.user', DataType.STRING, true)
111
+ .withField('legacy.portfolio', DataType.STRING, true)
112
+ .withField('legacy.warnings', DataType.NUMBER, true)
113
+ .withField('legacy.drops', DataType.NUMBER, true)
114
+ .withField('miscellany', DataType.AD_HOC, true)
115
+ .schema
116
+ );
117
+
118
+ const create = new PortfolioSchema(SchemaBuilder.withName('create')
119
+ .withField('name', DataType.STRING)
120
+ .withField('timezone', DataType.forEnum(Timezones, 'Timezone'))
121
+ .withField('dates.cash', DataType.DAY, true)
122
+ .withField('defaults.currency', DataType.forEnum(Currency, 'Currency'))
123
+ .withField('defaults.reinvest', DataType.BOOLEAN, true)
124
+ .withField('defaults.valuation', DataType.forEnum(ValuationType, 'ValuationType'))
125
+ .withField('miscellany', DataType.AD_HOC, true)
97
126
  .schema
98
127
  );
99
128
 
100
- const update = new PortfolioSchema(SchemaBuilder.withName('Update')
129
+ const update = new PortfolioSchema(SchemaBuilder.withName('update')
101
130
  .withField('name', DataType.STRING)
102
131
  .withField('timezone', DataType.forEnum(Timezones, 'Timezone'))
103
132
  .withField('dates.cash', DataType.DAY, true)
104
133
  .withField('defaults.currency', DataType.forEnum(Currency, 'Currency'))
105
134
  .withField('defaults.reinvest', DataType.BOOLEAN, true)
106
135
  .withField('defaults.valuation', DataType.forEnum(ValuationType, 'ValuationType'))
107
- .withField('data', DataType.OBJECT, true)
136
+ .withField('miscellany', DataType.AD_HOC, true)
108
137
  .schema
109
138
  );
110
139
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@barchart/portfolio-api-common",
3
- "version": "1.0.20",
3
+ "version": "1.0.24",
4
4
  "description": "Common classes used by the Portfolio system",
5
5
  "author": {
6
6
  "name": "Bryan Ingle",