@ricado/api-client 1.4.0 → 2.0.2

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.
Files changed (162) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/AccountPolicyController.js +1 -1
  3. package/lib/Controllers/ApiAccountController.js +2 -2
  4. package/lib/Controllers/CompanyController.js +1 -1
  5. package/lib/Controllers/FirebaseTokenController.js +1 -1
  6. package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +6 -6
  7. package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +6 -6
  8. package/lib/Controllers/Packhouse/Site/CompacSizerController.js +5 -5
  9. package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +6 -6
  10. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +6 -6
  11. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +5 -5
  12. package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +6 -6
  13. package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +6 -6
  14. package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +6 -6
  15. package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +5 -5
  16. package/lib/Controllers/Packhouse/Site/PackTypeController.js +5 -5
  17. package/lib/Controllers/Packhouse/Site/PackingLineController.js +5 -5
  18. package/lib/Controllers/Packhouse/Site/PackrunController.js +292 -6
  19. package/lib/Controllers/Packhouse/Site/RejectBinController.js +6 -6
  20. package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +5 -5
  21. package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +6 -6
  22. package/lib/Controllers/Packhouse/Site/ShiftController.js +6 -6
  23. package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +6 -6
  24. package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +6 -6
  25. package/lib/Controllers/Packhouse/Site/VarietyController.js +5 -5
  26. package/lib/Controllers/RTU/GlobalSettingsController.js +2 -2
  27. package/lib/Controllers/RTU/PluginSettingsController.js +2 -2
  28. package/lib/Controllers/RTUController.js +1 -1
  29. package/lib/Controllers/RTUPluginController.js +1 -1
  30. package/lib/Controllers/Site/AlarmController.js +6 -6
  31. package/lib/Controllers/Site/AlarmGroupController.js +5 -5
  32. package/lib/Controllers/Site/DefinitionController.js +5 -5
  33. package/lib/Controllers/Site/PermanentObjectController.js +5 -5
  34. package/lib/Controllers/Site/PermanentObjectDataController.js +6 -6
  35. package/lib/Controllers/Site/PointController.js +8 -6
  36. package/lib/Controllers/Site/TemporaryObjectController.js +5 -5
  37. package/lib/Controllers/SiteController.js +1 -1
  38. package/lib/Controllers/TokenController.js +2 -2
  39. package/lib/Controllers/ToolsController.js +1 -1
  40. package/lib/Controllers/UserAccountActionTokenController.js +2 -2
  41. package/lib/Controllers/UserAccountController.js +2 -2
  42. package/lib/DataItems/PointValueItem.js +2 -2
  43. package/lib/Errors/BadRequestError.js +7 -3
  44. package/lib/Errors/ForbiddenError.js +7 -3
  45. package/lib/Errors/NetworkError.js +7 -3
  46. package/lib/Errors/NotAllowedError.js +7 -3
  47. package/lib/Errors/NotFoundError.js +7 -3
  48. package/lib/Errors/ServerError.js +7 -3
  49. package/lib/Errors/UnauthorizedError.js +7 -3
  50. package/lib/Models/AccountPolicyModel.js +29 -133
  51. package/lib/Models/ApiAccountModel.js +29 -133
  52. package/lib/Models/BaseModel.js +6 -2
  53. package/lib/Models/CompanyModel.js +23 -101
  54. package/lib/Models/FirebaseTokenModel.js +32 -149
  55. package/lib/Models/Packhouse/Site/BinTipWeightModel.js +43 -195
  56. package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +40 -179
  57. package/lib/Models/Packhouse/Site/CompacSizerModel.js +58 -275
  58. package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +46 -211
  59. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +40 -179
  60. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +34 -147
  61. package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +52 -243
  62. package/lib/Models/Packhouse/Site/DowntimeEventModel.js +58 -275
  63. package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +40 -179
  64. package/lib/Models/Packhouse/Site/GrowingMethodModel.js +34 -147
  65. package/lib/Models/Packhouse/Site/PackTypeModel.js +40 -179
  66. package/lib/Models/Packhouse/Site/PackingLineModel.js +61 -291
  67. package/lib/Models/Packhouse/Site/PackrunModel.js +61 -291
  68. package/lib/Models/Packhouse/Site/RejectBinModel.js +43 -195
  69. package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +52 -243
  70. package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +46 -211
  71. package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +52 -243
  72. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +127 -643
  73. package/lib/Models/Packhouse/Site/ShiftModel.js +73 -355
  74. package/lib/Models/Packhouse/Site/VarietyModel.js +40 -179
  75. package/lib/Models/RTUModel.js +26 -117
  76. package/lib/Models/RTUPluginModel.js +23 -101
  77. package/lib/Models/Site/AlarmGroupModel.js +37 -163
  78. package/lib/Models/Site/AlarmModel.js +67 -323
  79. package/lib/Models/Site/DefinitionModel.js +34 -147
  80. package/lib/Models/Site/PermanentObjectDataModel.js +40 -179
  81. package/lib/Models/Site/PermanentObjectModel.js +37 -163
  82. package/lib/Models/Site/PointModel.js +49 -227
  83. package/lib/Models/Site/TemporaryObjectModel.js +34 -147
  84. package/lib/Models/Site/index.js +0 -3
  85. package/lib/Models/SiteModel.js +26 -117
  86. package/lib/Models/TokenModel.js +38 -181
  87. package/lib/Models/UserAccountActionTokenModel.js +41 -197
  88. package/lib/Models/UserAccountModel.js +38 -181
  89. package/lib/PackageVersion.js +1 -1
  90. package/lib/Points.js +1 -1
  91. package/lib/RequestHelper.js +2 -2
  92. package/lib/WebSocketHelper.js +1 -1
  93. package/lib/index.d.ts +931 -1589
  94. package/package.json +3 -3
  95. package/src/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
  96. package/src/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
  97. package/src/Controllers/Packhouse/Site/CompacSizerController.js +4 -4
  98. package/src/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
  99. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
  100. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
  101. package/src/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
  102. package/src/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
  103. package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
  104. package/src/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
  105. package/src/Controllers/Packhouse/Site/PackTypeController.js +4 -4
  106. package/src/Controllers/Packhouse/Site/PackingLineController.js +4 -4
  107. package/src/Controllers/Packhouse/Site/PackrunController.js +365 -4
  108. package/src/Controllers/Packhouse/Site/RejectBinController.js +4 -4
  109. package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +4 -4
  110. package/src/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
  111. package/src/Controllers/Packhouse/Site/ShiftController.js +4 -4
  112. package/src/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
  113. package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +4 -4
  114. package/src/Controllers/Packhouse/Site/VarietyController.js +4 -4
  115. package/src/Controllers/Site/AlarmController.js +4 -4
  116. package/src/Controllers/Site/AlarmGroupController.js +4 -4
  117. package/src/Controllers/Site/DefinitionController.js +4 -4
  118. package/src/Controllers/Site/PermanentObjectController.js +4 -4
  119. package/src/Controllers/Site/PermanentObjectDataController.js +4 -4
  120. package/src/Controllers/Site/PointController.js +6 -4
  121. package/src/Controllers/Site/TemporaryObjectController.js +4 -4
  122. package/src/Models/AccountPolicyModel.js +21 -117
  123. package/src/Models/ApiAccountModel.js +21 -117
  124. package/src/Models/CompanyModel.js +15 -87
  125. package/src/Models/FirebaseTokenModel.js +24 -132
  126. package/src/Models/Packhouse/Site/BinTipWeightModel.js +33 -174
  127. package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +30 -159
  128. package/src/Models/Packhouse/Site/CompacSizerModel.js +48 -249
  129. package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +36 -189
  130. package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +30 -159
  131. package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +24 -129
  132. package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +42 -219
  133. package/src/Models/Packhouse/Site/DowntimeEventModel.js +48 -249
  134. package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +30 -159
  135. package/src/Models/Packhouse/Site/GrowingMethodModel.js +24 -129
  136. package/src/Models/Packhouse/Site/PackTypeModel.js +30 -159
  137. package/src/Models/Packhouse/Site/PackingLineModel.js +51 -264
  138. package/src/Models/Packhouse/Site/PackrunModel.js +51 -264
  139. package/src/Models/Packhouse/Site/RejectBinModel.js +33 -174
  140. package/src/Models/Packhouse/Site/RejectBinScaleModel.js +42 -219
  141. package/src/Models/Packhouse/Site/RejectBinWeightModel.js +36 -189
  142. package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +42 -219
  143. package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +117 -594
  144. package/src/Models/Packhouse/Site/ShiftModel.js +63 -324
  145. package/src/Models/Packhouse/Site/VarietyModel.js +30 -159
  146. package/src/Models/RTUModel.js +18 -102
  147. package/src/Models/RTUPluginModel.js +15 -87
  148. package/src/Models/Site/AlarmGroupModel.js +27 -144
  149. package/src/Models/Site/AlarmModel.js +57 -294
  150. package/src/Models/Site/DefinitionModel.js +24 -129
  151. package/src/Models/Site/PermanentObjectDataModel.js +30 -159
  152. package/src/Models/Site/PermanentObjectModel.js +27 -144
  153. package/src/Models/Site/PointModel.js +39 -204
  154. package/src/Models/Site/TemporaryObjectModel.js +24 -129
  155. package/src/Models/Site/index.js +0 -2
  156. package/src/Models/SiteModel.js +18 -102
  157. package/src/Models/TokenModel.js +30 -162
  158. package/src/Models/UserAccountActionTokenModel.js +33 -177
  159. package/src/Models/UserAccountModel.js +30 -162
  160. package/src/PackageVersion.js +1 -1
  161. package/lib/Models/Site/BaseSiteModel.js +0 -58
  162. package/src/Models/Site/BaseSiteModel.js +0 -30
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
 
8
- var _BaseSiteModel2 = _interopRequireDefault(require("../../../Models/Site/BaseSiteModel"));
8
+ var _BaseModel2 = _interopRequireDefault(require("../../../Models/BaseModel"));
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
11
 
12
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
12
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
13
13
 
14
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
15
 
16
16
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
17
17
 
18
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
18
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
19
 
20
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
20
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } Object.defineProperty(subClass, "prototype", { value: Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }), writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
21
 
22
22
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
23
 
@@ -36,10 +36,10 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
36
36
  *
37
37
  * @class
38
38
  * @hideconstructor
39
- * @extends BaseSiteModel
39
+ * @extends BaseModel
40
40
  */
41
- var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
42
- _inherits(PackrunModel, _BaseSiteModel);
41
+ var PackrunModel = /*#__PURE__*/function (_BaseModel) {
42
+ _inherits(PackrunModel, _BaseModel);
43
43
 
44
44
  var _super = _createSuper(PackrunModel);
45
45
 
@@ -47,9 +47,8 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
47
47
  * PackrunModel Constructor
48
48
  *
49
49
  * @protected
50
- * @param {number} siteId The Site ID associated with this Packrun
51
50
  */
52
- function PackrunModel(siteId) {
51
+ function PackrunModel() {
53
52
  var _this;
54
53
 
55
54
  _classCallCheck(this, PackrunModel);
@@ -59,367 +58,138 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
59
58
  * The Packrun ID
60
59
  *
61
60
  * @type {string}
62
- * @private
61
+ * @public
63
62
  */
64
63
 
65
- _this._id = undefined;
64
+ _this.id = undefined;
66
65
  /**
67
66
  * The Packing Line ID this Packrun is associated with
68
67
  *
69
68
  * @type {string}
70
- * @private
69
+ * @public
71
70
  */
72
71
 
73
- _this._packingLineId = undefined;
72
+ _this.packingLineId = undefined;
74
73
  /**
75
74
  * The Packrun Name
76
75
  *
77
76
  * @type {string}
78
- * @private
77
+ * @public
79
78
  */
80
79
 
81
- _this._name = undefined;
80
+ _this.name = undefined;
82
81
  /**
83
82
  * When this Packrun was Created
84
83
  *
85
84
  * @type {Date}
86
- * @private
85
+ * @public
87
86
  */
88
87
 
89
- _this._createdTimestamp = undefined;
88
+ _this.createdTimestamp = undefined;
90
89
  /**
91
90
  * The Grower Name for this Packrun
92
91
  *
93
92
  * @type {string}
94
- * @private
93
+ * @public
95
94
  */
96
95
 
97
- _this._growerName = undefined;
96
+ _this.growerName = undefined;
98
97
  /**
99
98
  * The Grower Code for this Packrun
100
99
  *
101
100
  * @type {string}
102
- * @private
101
+ * @public
103
102
  */
104
103
 
105
- _this._growerCode = undefined;
104
+ _this.growerCode = undefined;
106
105
  /**
107
106
  * The Maturity Area for this Packrun
108
107
  *
109
108
  * @type {string}
110
- * @private
109
+ * @public
111
110
  */
112
111
 
113
- _this._maturityArea = undefined;
112
+ _this.maturityArea = undefined;
114
113
  /**
115
114
  * When this Packrun was Started
116
115
  *
117
116
  * @type {?Date}
118
- * @private
117
+ * @public
119
118
  */
120
119
 
121
- _this._startTimestamp = undefined;
120
+ _this.startTimestamp = undefined;
122
121
  /**
123
122
  * When this Packrun was Finished
124
123
  *
125
124
  * @type {?Date}
126
- * @private
125
+ * @public
127
126
  */
128
127
 
129
- _this._finishTimestamp = undefined;
128
+ _this.finishTimestamp = undefined;
130
129
  /**
131
130
  * The Variety for this Packrun
132
131
  *
133
132
  * @type {string}
134
- * @private
133
+ * @public
135
134
  */
136
135
 
137
- _this._varietyId = undefined;
136
+ _this.varietyId = undefined;
138
137
  /**
139
138
  * The Growing Method for this Packrun
140
139
  *
141
140
  * @type {?string}
142
- * @private
141
+ * @public
143
142
  */
144
143
 
145
- _this._growingMethodId = undefined;
144
+ _this.growingMethodId = undefined;
146
145
  /**
147
146
  * The Number of Allocated Bins for this Packrun
148
147
  *
149
148
  * @type {number}
150
- * @private
149
+ * @public
151
150
  */
152
151
 
153
- _this._allocatedBins = undefined;
152
+ _this.allocatedBins = undefined;
154
153
  /**
155
154
  * The Time Batches for this Packrun
156
155
  *
157
156
  * @type {Object[]}
158
- * @private
157
+ * @public
159
158
  */
160
159
 
161
- _this._timeBatches = undefined;
160
+ _this.timeBatches = undefined;
162
161
  /**
163
162
  * Whether the Packrun has been deleted
164
163
  *
165
164
  * @type {boolean}
166
- * @private
165
+ * @public
167
166
  */
168
167
 
169
- _this._deleted = undefined;
168
+ _this.deleted = undefined;
170
169
  /**
171
170
  * When the Packrun was last updated
172
171
  *
173
172
  * @type {Date}
174
- * @private
175
- */
176
-
177
- _this._updateTimestamp = undefined;
178
- /**
179
- * The Site ID associated with this Packrun
180
- *
181
- * @type {number}
182
- * @private
173
+ * @public
183
174
  */
184
175
 
185
- _this._siteId = siteId;
176
+ _this.updateTimestamp = undefined;
186
177
  return _this;
187
178
  }
188
179
  /**
189
- * The Packrun ID
180
+ * Create a new **PackrunModel** from a JSON Object or JSON String
190
181
  *
182
+ * @static
191
183
  * @public
192
- * @type {string}
184
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
185
+ * @return {PackrunModel}
193
186
  */
194
187
 
195
188
 
196
- _createClass(PackrunModel, [{
197
- key: "id",
198
- get: function get() {
199
- return this._id;
200
- }
201
- /**
202
- * The Packing Line ID this Packrun is associated with
203
- *
204
- * @public
205
- * @type {string}
206
- */
207
-
208
- }, {
209
- key: "packingLineId",
210
- get: function get() {
211
- return this._packingLineId;
212
- }
213
- /**
214
- * The Packrun Name
215
- *
216
- * @public
217
- * @type {string}
218
- */
219
-
220
- }, {
221
- key: "name",
222
- get: function get() {
223
- return this._name;
224
- }
225
- /**
226
- * When this Packrun was Created
227
- *
228
- * @public
229
- * @type {Date}
230
- */
231
-
232
- }, {
233
- key: "createdTimestamp",
234
- get: function get() {
235
- return this._createdTimestamp;
236
- }
237
- /**
238
- * The Grower Name for this Packrun
239
- *
240
- * @public
241
- * @type {string}
242
- */
243
-
244
- }, {
245
- key: "growerName",
246
- get: function get() {
247
- return this._growerName;
248
- }
249
- /**
250
- * The Grower Code for this Packrun
251
- *
252
- * @public
253
- * @type {string}
254
- */
255
-
256
- }, {
257
- key: "growerCode",
258
- get: function get() {
259
- return this._growerCode;
260
- }
261
- /**
262
- * The Maturity Area for this Packrun
263
- *
264
- * @public
265
- * @type {string}
266
- */
267
-
268
- }, {
269
- key: "maturityArea",
270
- get: function get() {
271
- return this._maturityArea;
272
- }
273
- /**
274
- * When this Packrun was Started
275
- *
276
- * @public
277
- * @type {?Date}
278
- */
279
-
280
- }, {
281
- key: "startTimestamp",
282
- get: function get() {
283
- return this._startTimestamp;
284
- }
285
- /**
286
- * When this Packrun was Finished
287
- *
288
- * @public
289
- * @type {?Date}
290
- */
291
-
292
- }, {
293
- key: "finishTimestamp",
294
- get: function get() {
295
- return this._finishTimestamp;
296
- }
297
- /**
298
- * The Variety for this Packrun
299
- *
300
- * @public
301
- * @type {string}
302
- */
303
-
304
- }, {
305
- key: "varietyId",
306
- get: function get() {
307
- return this._varietyId;
308
- }
309
- /**
310
- * The Growing Method for this Packrun
311
- *
312
- * @public
313
- * @type {?string}
314
- */
315
-
316
- }, {
317
- key: "growingMethodId",
318
- get: function get() {
319
- return this._growingMethodId;
320
- }
321
- /**
322
- * The Number of Allocated Bins for this Packrun
323
- *
324
- * @public
325
- * @type {number}
326
- */
327
-
328
- }, {
329
- key: "allocatedBins",
330
- get: function get() {
331
- return this._allocatedBins;
332
- }
333
- /**
334
- * The Time Batches for this Packrun
335
- *
336
- * @public
337
- * @type {Object[]}
338
- */
339
-
340
- }, {
341
- key: "timeBatches",
342
- get: function get() {
343
- return this._timeBatches;
344
- }
345
- /**
346
- * Whether the Packrun has been deleted
347
- *
348
- * @public
349
- * @type {boolean}
350
- */
351
-
352
- }, {
353
- key: "deleted",
354
- get: function get() {
355
- return this._deleted;
356
- }
357
- /**
358
- * When the Packrun was last updated
359
- *
360
- * @public
361
- * @type {Date}
362
- */
363
-
364
- }, {
365
- key: "updateTimestamp",
366
- get: function get() {
367
- return this._updateTimestamp;
368
- }
369
- /**
370
- * The Site ID associated with this Packrun
371
- *
372
- * @public
373
- * @type {number}
374
- */
375
-
376
- }, {
377
- key: "siteId",
378
- get: function get() {
379
- return this._siteId;
380
- }
381
- /**
382
- * Convert this **PackrunModel** to a JSON Object
383
- *
384
- * @public
385
- * @return {Object<string, any>}
386
- */
387
-
388
- }, {
389
- key: "toJSON",
390
- value: function toJSON() {
391
- return {
392
- id: this._id,
393
- packingLineId: this._packingLineId,
394
- name: this._name,
395
- createdTimestamp: this._createdTimestamp,
396
- growerName: this._growerName,
397
- growerCode: this._growerCode,
398
- maturityArea: this._maturityArea,
399
- startTimestamp: this._startTimestamp,
400
- finishTimestamp: this._finishTimestamp,
401
- varietyId: this._varietyId,
402
- growingMethodId: this._growingMethodId,
403
- allocatedBins: this._allocatedBins,
404
- timeBatches: this._timeBatches,
405
- deleted: this._deleted,
406
- updateTimestamp: this._updateTimestamp
407
- };
408
- }
409
- /**
410
- * Create a new **PackrunModel** from a JSON Object or JSON String
411
- *
412
- * @static
413
- * @public
414
- * @param {Object<string, any>|string} json A JSON Object or JSON String
415
- * @param {number} siteId The Site ID associated with this Packrun
416
- * @return {PackrunModel}
417
- */
418
-
419
- }], [{
189
+ _createClass(PackrunModel, null, [{
420
190
  key: "fromJSON",
421
- value: function fromJSON(json, siteId) {
422
- var model = new PackrunModel(siteId);
191
+ value: function fromJSON(json) {
192
+ var model = new PackrunModel();
423
193
  /**
424
194
  * The JSON Object
425
195
  *
@@ -435,7 +205,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
435
205
  }
436
206
 
437
207
  if ('id' in jsonObject) {
438
- model._id = function () {
208
+ model.id = function () {
439
209
  if (typeof jsonObject['id'] !== 'string') {
440
210
  return String(jsonObject['id']);
441
211
  }
@@ -445,7 +215,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
445
215
  }
446
216
 
447
217
  if ('packingLineId' in jsonObject) {
448
- model._packingLineId = function () {
218
+ model.packingLineId = function () {
449
219
  if (typeof jsonObject['packingLineId'] !== 'string') {
450
220
  return String(jsonObject['packingLineId']);
451
221
  }
@@ -455,7 +225,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
455
225
  }
456
226
 
457
227
  if ('name' in jsonObject) {
458
- model._name = function () {
228
+ model.name = function () {
459
229
  if (typeof jsonObject['name'] !== 'string') {
460
230
  return String(jsonObject['name']);
461
231
  }
@@ -465,7 +235,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
465
235
  }
466
236
 
467
237
  if ('createdTimestamp' in jsonObject) {
468
- model._createdTimestamp = function () {
238
+ model.createdTimestamp = function () {
469
239
  if (typeof jsonObject['createdTimestamp'] !== 'string') {
470
240
  return new Date(String(jsonObject['createdTimestamp']));
471
241
  }
@@ -475,7 +245,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
475
245
  }
476
246
 
477
247
  if ('growerName' in jsonObject) {
478
- model._growerName = function () {
248
+ model.growerName = function () {
479
249
  if (typeof jsonObject['growerName'] !== 'string') {
480
250
  return String(jsonObject['growerName']);
481
251
  }
@@ -485,7 +255,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
485
255
  }
486
256
 
487
257
  if ('growerCode' in jsonObject) {
488
- model._growerCode = function () {
258
+ model.growerCode = function () {
489
259
  if (typeof jsonObject['growerCode'] !== 'string') {
490
260
  return String(jsonObject['growerCode']);
491
261
  }
@@ -495,7 +265,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
495
265
  }
496
266
 
497
267
  if ('maturityArea' in jsonObject) {
498
- model._maturityArea = function () {
268
+ model.maturityArea = function () {
499
269
  if (typeof jsonObject['maturityArea'] !== 'string') {
500
270
  return String(jsonObject['maturityArea']);
501
271
  }
@@ -505,7 +275,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
505
275
  }
506
276
 
507
277
  if ('startTimestamp' in jsonObject) {
508
- model._startTimestamp = function () {
278
+ model.startTimestamp = function () {
509
279
  if (jsonObject['startTimestamp'] === null) {
510
280
  return null;
511
281
  }
@@ -519,7 +289,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
519
289
  }
520
290
 
521
291
  if ('finishTimestamp' in jsonObject) {
522
- model._finishTimestamp = function () {
292
+ model.finishTimestamp = function () {
523
293
  if (jsonObject['finishTimestamp'] === null) {
524
294
  return null;
525
295
  }
@@ -533,7 +303,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
533
303
  }
534
304
 
535
305
  if ('varietyId' in jsonObject) {
536
- model._varietyId = function () {
306
+ model.varietyId = function () {
537
307
  if (typeof jsonObject['varietyId'] !== 'string') {
538
308
  return String(jsonObject['varietyId']);
539
309
  }
@@ -543,7 +313,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
543
313
  }
544
314
 
545
315
  if ('growingMethodId' in jsonObject) {
546
- model._growingMethodId = function () {
316
+ model.growingMethodId = function () {
547
317
  if (jsonObject['growingMethodId'] === null) {
548
318
  return null;
549
319
  }
@@ -557,7 +327,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
557
327
  }
558
328
 
559
329
  if ('allocatedBins' in jsonObject) {
560
- model._allocatedBins = function () {
330
+ model.allocatedBins = function () {
561
331
  if (typeof jsonObject['allocatedBins'] !== 'number') {
562
332
  return Number.isInteger(Number(jsonObject['allocatedBins'])) ? Number(jsonObject['allocatedBins']) : Math.floor(Number(jsonObject['allocatedBins']));
563
333
  }
@@ -567,7 +337,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
567
337
  }
568
338
 
569
339
  if ('timeBatches' in jsonObject) {
570
- model._timeBatches = function () {
340
+ model.timeBatches = function () {
571
341
  if (Array.isArray(jsonObject['timeBatches']) !== true) {
572
342
  return [];
573
343
  }
@@ -585,7 +355,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
585
355
  }
586
356
 
587
357
  if ('deleted' in jsonObject) {
588
- model._deleted = function () {
358
+ model.deleted = function () {
589
359
  if (typeof jsonObject['deleted'] !== 'boolean') {
590
360
  return Boolean(jsonObject['deleted']);
591
361
  }
@@ -595,7 +365,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
595
365
  }
596
366
 
597
367
  if ('updateTimestamp' in jsonObject) {
598
- model._updateTimestamp = function () {
368
+ model.updateTimestamp = function () {
599
369
  if (typeof jsonObject['updateTimestamp'] !== 'string') {
600
370
  return new Date(String(jsonObject['updateTimestamp']));
601
371
  }
@@ -609,7 +379,7 @@ var PackrunModel = /*#__PURE__*/function (_BaseSiteModel) {
609
379
  }]);
610
380
 
611
381
  return PackrunModel;
612
- }(_BaseSiteModel2.default);
382
+ }(_BaseModel2.default);
613
383
 
614
384
  var _default = PackrunModel;
615
385
  exports.default = _default;