|
| 1 | +export class EmployeesFlatDataItem { |
| 2 | + public constructor(init: Partial<EmployeesFlatDataItem>) { |
| 3 | + Object.assign(this, init); |
| 4 | + } |
| 5 | + |
| 6 | + public Age: number; |
| 7 | + public HireDate: string; |
| 8 | + public ID: number; |
| 9 | + public Name: string; |
| 10 | + public Phone: string; |
| 11 | + public OnPTO: boolean; |
| 12 | + public ParentID: number; |
| 13 | + public Title: string; |
| 14 | + |
| 15 | +} |
| 16 | +export class EmployeesFlatData extends Array<EmployeesFlatDataItem> { |
| 17 | + public constructor(items: Array<EmployeesFlatDataItem> | number = -1) { |
| 18 | + if (Array.isArray(items)) { |
| 19 | + super(...items); |
| 20 | + } else { |
| 21 | + const newItems = [ |
| 22 | + new EmployeesFlatDataItem( |
| 23 | + { |
| 24 | + Age: 55, |
| 25 | + HireDate: `2008-03-20`, |
| 26 | + ID: 1, |
| 27 | + Name: `Johnathan Winchester`, |
| 28 | + Phone: `0251-031259`, |
| 29 | + OnPTO: false, |
| 30 | + ParentID: -1, |
| 31 | + Title: `Development Manager` |
| 32 | + }), |
| 33 | + new EmployeesFlatDataItem( |
| 34 | + { |
| 35 | + Age: 42, |
| 36 | + HireDate: `2014-01-22`, |
| 37 | + ID: 4, |
| 38 | + Name: `Ana Sanders`, |
| 39 | + Phone: `(21) 555-0091`, |
| 40 | + OnPTO: true, |
| 41 | + ParentID: -1, |
| 42 | + Title: `CEO` |
| 43 | + }), |
| 44 | + new EmployeesFlatDataItem( |
| 45 | + { |
| 46 | + Age: 49, |
| 47 | + HireDate: `2014-01-22`, |
| 48 | + ID: 18, |
| 49 | + Name: `Victoria Lincoln`, |
| 50 | + Phone: `(071) 23 67 22 20`, |
| 51 | + OnPTO: true, |
| 52 | + ParentID: -1, |
| 53 | + Title: `Accounting Manager` |
| 54 | + }), |
| 55 | + new EmployeesFlatDataItem( |
| 56 | + { |
| 57 | + Age: 61, |
| 58 | + HireDate: `2010-01-01`, |
| 59 | + ID: 10, |
| 60 | + Name: `Yang Wang`, |
| 61 | + Phone: `(21) 555-0091`, |
| 62 | + OnPTO: false, |
| 63 | + ParentID: -1, |
| 64 | + Title: `Localization Manager` |
| 65 | + }), |
| 66 | + new EmployeesFlatDataItem( |
| 67 | + { |
| 68 | + Age: 43, |
| 69 | + HireDate: `2011-06-03`, |
| 70 | + ID: 3, |
| 71 | + Name: `Michael Burke`, |
| 72 | + Phone: `0452-076545`, |
| 73 | + OnPTO: true, |
| 74 | + ParentID: 1, |
| 75 | + Title: `Senior Software Developer` |
| 76 | + }), |
| 77 | + new EmployeesFlatDataItem( |
| 78 | + { |
| 79 | + Age: 29, |
| 80 | + HireDate: `2009-06-19`, |
| 81 | + ID: 2, |
| 82 | + Name: `Thomas Anderson`, |
| 83 | + Phone: `(14) 555-8122`, |
| 84 | + OnPTO: false, |
| 85 | + ParentID: 1, |
| 86 | + Title: `Senior Software Developer` |
| 87 | + }), |
| 88 | + new EmployeesFlatDataItem( |
| 89 | + { |
| 90 | + Age: 31, |
| 91 | + HireDate: `2014-08-18`, |
| 92 | + ID: 11, |
| 93 | + Name: `Monica Reyes`, |
| 94 | + Phone: `7675-3425`, |
| 95 | + OnPTO: false, |
| 96 | + ParentID: 1, |
| 97 | + Title: `Software Development Team Lead` |
| 98 | + }), |
| 99 | + new EmployeesFlatDataItem( |
| 100 | + { |
| 101 | + Age: 35, |
| 102 | + HireDate: `2015-09-17`, |
| 103 | + ID: 6, |
| 104 | + Name: `Roland Mendel`, |
| 105 | + Phone: `(505) 555-5939`, |
| 106 | + OnPTO: false, |
| 107 | + ParentID: 11, |
| 108 | + Title: `Senior Software Developer` |
| 109 | + }), |
| 110 | + new EmployeesFlatDataItem( |
| 111 | + { |
| 112 | + Age: 44, |
| 113 | + HireDate: `2009-10-11`, |
| 114 | + ID: 12, |
| 115 | + Name: `Sven Cooper`, |
| 116 | + Phone: `0695-34 67 21`, |
| 117 | + OnPTO: true, |
| 118 | + ParentID: 11, |
| 119 | + Title: `Senior Software Developer` |
| 120 | + }), |
| 121 | + new EmployeesFlatDataItem( |
| 122 | + { |
| 123 | + Age: 44, |
| 124 | + HireDate: `2014-04-04`, |
| 125 | + ID: 14, |
| 126 | + Name: `Laurence Johnson`, |
| 127 | + Phone: `981-443655`, |
| 128 | + OnPTO: false, |
| 129 | + ParentID: 4, |
| 130 | + Title: `Director` |
| 131 | + }), |
| 132 | + new EmployeesFlatDataItem( |
| 133 | + { |
| 134 | + Age: 25, |
| 135 | + HireDate: `2017-11-09`, |
| 136 | + ID: 5, |
| 137 | + Name: `Elizabeth Richards`, |
| 138 | + Phone: `(2) 283-2951`, |
| 139 | + OnPTO: true, |
| 140 | + ParentID: 4, |
| 141 | + Title: `Vice President` |
| 142 | + }), |
| 143 | + new EmployeesFlatDataItem( |
| 144 | + { |
| 145 | + Age: 39, |
| 146 | + HireDate: `2010-03-22`, |
| 147 | + ID: 13, |
| 148 | + Name: `Trevor Ashworth`, |
| 149 | + Phone: `981-443655`, |
| 150 | + OnPTO: true, |
| 151 | + ParentID: 5, |
| 152 | + Title: `Director` |
| 153 | + }), |
| 154 | + new EmployeesFlatDataItem( |
| 155 | + { |
| 156 | + Age: 44, |
| 157 | + HireDate: `2014-04-04`, |
| 158 | + ID: 17, |
| 159 | + Name: `Antonio Moreno`, |
| 160 | + Phone: `(505) 555-5939`, |
| 161 | + OnPTO: false, |
| 162 | + ParentID: 18, |
| 163 | + Title: `Senior Accountant` |
| 164 | + }), |
| 165 | + new EmployeesFlatDataItem( |
| 166 | + { |
| 167 | + Age: 50, |
| 168 | + HireDate: `2007-11-18`, |
| 169 | + ID: 7, |
| 170 | + Name: `Pedro Rodriguez`, |
| 171 | + Phone: `035-640230`, |
| 172 | + OnPTO: false, |
| 173 | + ParentID: 10, |
| 174 | + Title: `Senior Localization Developer` |
| 175 | + }), |
| 176 | + new EmployeesFlatDataItem( |
| 177 | + { |
| 178 | + Age: 27, |
| 179 | + HireDate: `2016-02-19`, |
| 180 | + ID: 8, |
| 181 | + Name: `Casey Harper`, |
| 182 | + Phone: `0342-023176`, |
| 183 | + OnPTO: true, |
| 184 | + ParentID: 10, |
| 185 | + Title: `Senior Localization` |
| 186 | + }), |
| 187 | + new EmployeesFlatDataItem( |
| 188 | + { |
| 189 | + Age: 25, |
| 190 | + HireDate: `2017-11-09`, |
| 191 | + ID: 15, |
| 192 | + Name: `Patricia Simpson`, |
| 193 | + Phone: `069-0245984`, |
| 194 | + OnPTO: false, |
| 195 | + ParentID: 7, |
| 196 | + Title: `Localization Intern` |
| 197 | + }), |
| 198 | + new EmployeesFlatDataItem( |
| 199 | + { |
| 200 | + Age: 39, |
| 201 | + HireDate: `2010-03-22`, |
| 202 | + ID: 9, |
| 203 | + Name: `Francisco Chang`, |
| 204 | + Phone: `(91) 745 6200`, |
| 205 | + OnPTO: false, |
| 206 | + ParentID: 7, |
| 207 | + Title: `Localization Intern` |
| 208 | + }), |
| 209 | + new EmployeesFlatDataItem( |
| 210 | + { |
| 211 | + Age: 25, |
| 212 | + HireDate: `2018-03-18`, |
| 213 | + ID: 16, |
| 214 | + Name: `Peter Lewis`, |
| 215 | + Phone: `069-0245984`, |
| 216 | + OnPTO: true, |
| 217 | + ParentID: 7, |
| 218 | + Title: `Localization Intern` |
| 219 | + }), |
| 220 | + ]; |
| 221 | + super(...(newItems.slice(0, items))); |
| 222 | + } |
| 223 | + } |
| 224 | +} |
0 commit comments