@barchart/portfolio-api-common 1.2.40 → 1.2.41
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.
|
@@ -4,6 +4,15 @@ const Enum = require('@barchart/common-js/lang/Enum'),
|
|
|
4
4
|
module.exports = (() => {
|
|
5
5
|
'use strict';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Types of corporate actions.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @extends {Enum}
|
|
12
|
+
* @param {String} code
|
|
13
|
+
* @param {String} description
|
|
14
|
+
* @param {Boolean} internal
|
|
15
|
+
*/
|
|
7
16
|
class CorporateActionType extends Enum {
|
|
8
17
|
constructor(code, description, internal) {
|
|
9
18
|
super(code, description);
|
|
@@ -11,23 +20,75 @@ module.exports = (() => {
|
|
|
11
20
|
this._internal = is.boolean(internal) && internal;
|
|
12
21
|
}
|
|
13
22
|
|
|
23
|
+
/**
|
|
24
|
+
* If true, the corporate action is fictitious -- used only for internal
|
|
25
|
+
* system purposes.
|
|
26
|
+
*
|
|
27
|
+
* @public
|
|
28
|
+
* @returns {Boolean}
|
|
29
|
+
*/
|
|
14
30
|
get internal() {
|
|
15
31
|
return this._internal;
|
|
16
32
|
}
|
|
17
33
|
|
|
34
|
+
/**
|
|
35
|
+
* A symbol change.
|
|
36
|
+
*
|
|
37
|
+
* @public
|
|
38
|
+
* @static
|
|
39
|
+
* @returns {CorporateActionType}
|
|
40
|
+
*/
|
|
41
|
+
static get SYMBOL_CHANGE() {
|
|
42
|
+
return symbolChange;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* A name change.
|
|
47
|
+
*
|
|
48
|
+
* @public
|
|
49
|
+
* @static
|
|
50
|
+
* @returns {CorporateActionType}
|
|
51
|
+
*/
|
|
52
|
+
static get NAME_CHANGE() {
|
|
53
|
+
return nameChange;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A dividend.
|
|
58
|
+
*
|
|
59
|
+
* @public
|
|
60
|
+
* @static
|
|
61
|
+
* @returns {CorporateActionType}
|
|
62
|
+
*/
|
|
18
63
|
static get DIVIDEND() {
|
|
19
64
|
return dividend;
|
|
20
65
|
}
|
|
21
66
|
|
|
67
|
+
/**
|
|
68
|
+
* A split.
|
|
69
|
+
*
|
|
70
|
+
* @public
|
|
71
|
+
* @static
|
|
72
|
+
* @returns {CorporateActionType}
|
|
73
|
+
*/
|
|
22
74
|
static get SPLIT() {
|
|
23
75
|
return split;
|
|
24
76
|
}
|
|
25
77
|
|
|
78
|
+
/**
|
|
79
|
+
* A fictitious event, used for internal system purposes.
|
|
80
|
+
*
|
|
81
|
+
* @public
|
|
82
|
+
* @static
|
|
83
|
+
* @returns {CorporateActionType}
|
|
84
|
+
*/
|
|
26
85
|
static get JOB() {
|
|
27
86
|
return job;
|
|
28
87
|
}
|
|
29
88
|
}
|
|
30
89
|
|
|
90
|
+
const symbolChange = new CorporateActionType('SYMBOL_CHANGE', 'Symbol Change', false);
|
|
91
|
+
const nameChange = new CorporateActionType('NAME_CHANGE', 'Name Change', false);
|
|
31
92
|
const dividend = new CorporateActionType('DIVIDEND', 'Dividend', false);
|
|
32
93
|
const split = new CorporateActionType('SPLIT', 'Split', false);
|
|
33
94
|
const job = new CorporateActionType('JOB', 'Job', true);
|