@divvydiary/divvydiary-json-schemas 0.8.1 → 0.9.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@divvydiary/divvydiary-json-schemas",
3
- "version": "0.8.1",
3
+ "version": "0.9.3",
4
4
  "description": "JSON Schemas for DivvyDiary.com",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -174,7 +174,8 @@
174
174
  "ZMK",
175
175
  "ZMW",
176
176
  "ZWL"
177
- ]
177
+ ],
178
+ "example": "EUR"
178
179
  },
179
180
  "exchange": {
180
181
  "type": "string",
@@ -248,13 +249,15 @@
248
249
  "XTSX",
249
250
  "XWAR",
250
251
  "XWBO"
251
- ]
252
+ ],
253
+ "example": "XNAS"
252
254
  },
253
255
  "isin": {
254
256
  "type": "string",
255
257
  "minLength": 12,
256
258
  "maxLength": 12,
257
- "pattern": "^[A-Z]{2}[A-Z0-9]{9}[0-9]{1}$"
259
+ "pattern": "^[A-Z]{2}[A-Z0-9]{9}[0-9]{1}$",
260
+ "example": "US88160R1014"
258
261
  },
259
262
  "password": {
260
263
  "type": "string",
@@ -270,7 +273,8 @@
270
273
  "type": "string",
271
274
  "minLength": 6,
272
275
  "maxLength": 6,
273
- "pattern": "^[A-Z0-9]{6}$"
276
+ "pattern": "^[A-Z0-9]{6}$",
277
+ "example": "A1CX3T"
274
278
  },
275
279
  "dividendFrequency": {
276
280
  "type": "string",
@@ -280,18 +284,44 @@
280
284
  "type": "number",
281
285
  "minimum": 0,
282
286
  "description": "Forward Annual Payout (FWD) *aristocrats only*",
283
- "nullable": true
287
+ "nullable": true,
288
+ "example": 0.054
284
289
  },
285
290
  "dividendYield": {
286
291
  "type": "number",
287
292
  "minimum": 0,
288
- "description": "Forward Dividend Yield (FWD) *aristocrats only*",
289
- "nullable": true
293
+ "description": "Forward Dividend Yield (FWD) on current price *aristocrats only*",
294
+ "nullable": true,
295
+ "example": 0.8
296
+ },
297
+ "dividendYieldOnBuyin": {
298
+ "type": "number",
299
+ "minimum": 0,
300
+ "description": "Forward Dividend Yield (FWD) on buyin price *aristocrats only*",
301
+ "nullable": true,
302
+ "example": 0.8
290
303
  },
291
304
  "taxRate": {
292
305
  "type": "number",
293
306
  "minimum": 0,
294
307
  "maximum": 1
308
+ },
309
+ "name": {
310
+ "type": "string",
311
+ "minLength": 1,
312
+ "maxLength": 255,
313
+ "example": "Tesla Inc"
314
+ },
315
+ "symbol": {
316
+ "type": "string",
317
+ "minLength": 1,
318
+ "maxLength": 8,
319
+ "example": "TSLA"
320
+ },
321
+ "exchangeRate": {
322
+ "type": "number",
323
+ "minimum": 0,
324
+ "example": 1.1604
295
325
  }
296
326
  }
297
327
  }
@@ -38,25 +38,53 @@
38
38
  "price": {
39
39
  "type": "number",
40
40
  "minimum": 0,
41
- "multipleOf": 0.0001
41
+ "multipleOf": 0.0001,
42
+ "nullable": true
42
43
  },
43
44
  "currency": {
44
- "$ref": "https://divvydiary.com/schemas/defs.json#/properties/currency"
45
+ "oneOf": [
46
+ {
47
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/currency"
48
+ },
49
+ { "type": "null" }
50
+ ]
51
+ },
52
+ "exchangeRate": {
53
+ "oneOf": [
54
+ {
55
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/exchangeRate"
56
+ },
57
+ { "type": "null" }
58
+ ]
45
59
  }
46
- },
47
- "nullable": true
60
+ }
48
61
  },
49
62
  "dividendYield": {
50
63
  "$ref": "https://divvydiary.com/schemas/defs.json#/properties/dividendYield"
51
64
  },
65
+ "dividendYieldOnBuyin": {
66
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/dividendYieldOnBuyin"
67
+ },
52
68
  "dividendRate": {
53
69
  "$ref": "https://divvydiary.com/schemas/defs.json#/properties/dividendRate"
54
70
  },
55
71
  "currency": {
56
72
  "$ref": "https://divvydiary.com/schemas/defs.json#/properties/currency"
57
73
  },
58
- "name": { "type": "string", "minLength": 1, "maxLength": 255 },
59
- "symbol": { "type": "string", "minLength": 1, "maxLength": 255 },
74
+ "name": {
75
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/name"
76
+ },
77
+ "nickname": {
78
+ "oneOf": [
79
+ {
80
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/name"
81
+ },
82
+ { "type": "null" }
83
+ ]
84
+ },
85
+ "symbol": {
86
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/symbol"
87
+ },
60
88
  "taxRate": {
61
89
  "$ref": "https://divvydiary.com/schemas/defs.json#/properties/taxRate"
62
90
  }
@@ -35,12 +35,17 @@
35
35
  "multipleOf": 0.000001
36
36
  },
37
37
  "exchangeRate": {
38
- "type": "number",
39
- "minimum": 0
38
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/exchangeRate"
40
39
  },
41
40
  "taxRate": {
42
41
  "$ref": "https://divvydiary.com/schemas/defs.json#/properties/taxRate"
43
42
  },
43
+ "nickname": {
44
+ "oneOf": [
45
+ { "$ref": "https://divvydiary.com/schemas/defs.json#/properties/name" },
46
+ { "type": "null" }
47
+ ]
48
+ },
44
49
  "isin": {
45
50
  "$ref": "https://divvydiary.com/schemas/defs.json#/properties/isin"
46
51
  },
@@ -4,13 +4,10 @@
4
4
  "title": "Symbol",
5
5
  "properties": {
6
6
  "name": {
7
- "type": "string",
8
- "maxLength": 255
7
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/name"
9
8
  },
10
9
  "symbol": {
11
- "type": "string",
12
- "minLength": 1,
13
- "maxLength": 6
10
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/symbol"
14
11
  },
15
12
  "isin": {
16
13
  "$ref": "https://divvydiary.com/schemas/defs.json#/properties/isin"
@@ -51,6 +48,20 @@
51
48
  "9Y": { "type": "number", "nullable": true },
52
49
  "10Y": { "type": "number", "nullable": true }
53
50
  }
51
+ },
52
+ "price": {
53
+ "type": "number",
54
+ "minimum": 0,
55
+ "multipleOf": 0.0001,
56
+ "nullable": true
57
+ },
58
+ "currency": {
59
+ "oneOf": [
60
+ {
61
+ "$ref": "https://divvydiary.com/schemas/defs.json#/properties/currency"
62
+ },
63
+ { "type": "null" }
64
+ ]
54
65
  }
55
66
  }
56
67
  }
@@ -13,7 +13,7 @@
13
13
  "format": "email",
14
14
  "maxLength": 255
15
15
  },
16
- "forename": { "type": "string", "maxLength": 255 },
16
+ "forename": { "type": "string", "maxLength": 50 },
17
17
  "newsletter": { "type": "boolean" },
18
18
  "emailConfirmed": { "type": "boolean" },
19
19
  "currency": {
package/test.js CHANGED
@@ -9,6 +9,9 @@ var ajv = new Ajv({
9
9
  useDefaults: true,
10
10
  coerceTypes: true,
11
11
  });
12
+
13
+ ajv.addKeyword("example");
14
+
12
15
  addFormats(ajv);
13
16
 
14
17
  glob.sync(`${__dirname}/src/schemas/*.json`).forEach((file) => {