@ricado/api-client 2.1.1 → 2.3.1

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 (118) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/Packhouse/Site/BinTipBinController.js +622 -0
  3. package/lib/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
  4. package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +657 -0
  5. package/lib/Controllers/Packhouse/Site/PackingLineController.js +29 -1
  6. package/lib/Controllers/Packhouse/Site/PackrunController.js +42 -0
  7. package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
  8. package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +661 -0
  9. package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +628 -0
  10. package/lib/Controllers/Packhouse/Site/index.js +12 -0
  11. package/lib/DataItems/PointValueItem.js +3 -3
  12. package/lib/Models/AccountPolicyModel.js +7 -7
  13. package/lib/Models/ApiAccountModel.js +7 -7
  14. package/lib/Models/CompanyModel.js +5 -5
  15. package/lib/Models/FirebaseTokenModel.js +8 -8
  16. package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
  17. package/lib/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
  18. package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
  19. package/lib/Models/Packhouse/Site/CompacSizerModel.js +15 -15
  20. package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
  21. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
  22. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
  23. package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
  24. package/lib/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
  25. package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
  26. package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
  27. package/lib/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
  28. package/lib/Models/Packhouse/Site/PackTypeModel.js +8 -8
  29. package/lib/Models/Packhouse/Site/PackingLineModel.js +583 -16
  30. package/lib/Models/Packhouse/Site/PackrunModel.js +81 -15
  31. package/lib/Models/Packhouse/Site/RejectBinModel.js +9 -9
  32. package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +23 -23
  33. package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
  34. package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
  35. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +204 -38
  36. package/lib/Models/Packhouse/Site/ShiftModel.js +26 -19
  37. package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
  38. package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
  39. package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +7 -7
  40. package/lib/Models/Packhouse/Site/VarietyModel.js +8 -8
  41. package/lib/Models/Packhouse/Site/index.js +12 -0
  42. package/lib/Models/RTUModel.js +6 -6
  43. package/lib/Models/RTUPluginModel.js +5 -5
  44. package/lib/Models/Site/AlarmGroupModel.js +7 -7
  45. package/lib/Models/Site/AlarmModel.js +17 -17
  46. package/lib/Models/Site/DefinitionModel.js +6 -6
  47. package/lib/Models/Site/PermanentObjectDataModel.js +8 -8
  48. package/lib/Models/Site/PermanentObjectModel.js +7 -7
  49. package/lib/Models/Site/PointModel.js +11 -11
  50. package/lib/Models/Site/TemporaryObjectModel.js +6 -6
  51. package/lib/Models/SiteModel.js +6 -6
  52. package/lib/Models/TokenModel.js +10 -10
  53. package/lib/Models/UserAccountActionTokenModel.js +11 -11
  54. package/lib/Models/UserAccountModel.js +10 -10
  55. package/lib/PackageVersion.js +1 -1
  56. package/lib/Points.js +22 -12
  57. package/lib/WebSocketHelper.js +29 -13
  58. package/lib/index.d.ts +2473 -348
  59. package/lib/index.js +3 -3
  60. package/package.json +1 -1
  61. package/src/Controllers/Packhouse/Site/BinTipBinController.js +665 -0
  62. package/src/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
  63. package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +700 -0
  64. package/src/Controllers/Packhouse/Site/PackingLineController.js +29 -1
  65. package/src/Controllers/Packhouse/Site/PackrunController.js +52 -0
  66. package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
  67. package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +704 -0
  68. package/src/Controllers/Packhouse/Site/ShiftTaskController.js +671 -0
  69. package/src/Controllers/Packhouse/Site/index.js +8 -0
  70. package/src/DataItems/PointValueItem.js +3 -3
  71. package/src/Models/AccountPolicyModel.js +7 -7
  72. package/src/Models/ApiAccountModel.js +7 -7
  73. package/src/Models/CompanyModel.js +5 -5
  74. package/src/Models/FirebaseTokenModel.js +8 -8
  75. package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
  76. package/src/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
  77. package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
  78. package/src/Models/Packhouse/Site/CompacSizerModel.js +15 -15
  79. package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
  80. package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
  81. package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
  82. package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
  83. package/src/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
  84. package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
  85. package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
  86. package/src/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
  87. package/src/Models/Packhouse/Site/PackTypeModel.js +8 -8
  88. package/src/Models/Packhouse/Site/PackingLineModel.js +770 -16
  89. package/src/Models/Packhouse/Site/PackrunModel.js +90 -15
  90. package/src/Models/Packhouse/Site/RejectBinModel.js +9 -9
  91. package/src/Models/Packhouse/Site/RejectBinScaleModel.js +23 -23
  92. package/src/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
  93. package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
  94. package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +229 -38
  95. package/src/Models/Packhouse/Site/ShiftModel.js +29 -19
  96. package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
  97. package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
  98. package/src/Models/Packhouse/Site/SoftSortBeltModel.js +7 -7
  99. package/src/Models/Packhouse/Site/VarietyModel.js +8 -8
  100. package/src/Models/Packhouse/Site/index.js +8 -0
  101. package/src/Models/RTUModel.js +6 -6
  102. package/src/Models/RTUPluginModel.js +5 -5
  103. package/src/Models/Site/AlarmGroupModel.js +7 -7
  104. package/src/Models/Site/AlarmModel.js +17 -17
  105. package/src/Models/Site/DefinitionModel.js +6 -6
  106. package/src/Models/Site/PermanentObjectDataModel.js +8 -8
  107. package/src/Models/Site/PermanentObjectModel.js +7 -7
  108. package/src/Models/Site/PointModel.js +11 -11
  109. package/src/Models/Site/TemporaryObjectModel.js +6 -6
  110. package/src/Models/SiteModel.js +6 -6
  111. package/src/Models/TokenModel.js +10 -10
  112. package/src/Models/UserAccountActionTokenModel.js +11 -11
  113. package/src/Models/UserAccountModel.js +10 -10
  114. package/src/PackageVersion.js +1 -1
  115. package/src/Points.js +24 -12
  116. package/src/WebSocketHelper.js +34 -13
  117. package/src/index.js +3 -3
  118. package/types/tslint.json +2 -1
@@ -0,0 +1,481 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _BaseModel2 = _interopRequireDefault(require("../../../Models/BaseModel"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
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
+
14
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
+
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
+
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
+
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 } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
+
22
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
+
24
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25
+
26
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
27
+
28
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
+
30
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
+
32
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
33
+
34
+ /**
35
+ * Model Class for a FreshQuality Packrun Summary
36
+ *
37
+ * @class
38
+ * @hideconstructor
39
+ * @extends BaseModel
40
+ */
41
+ var FreshQualityPackrunSummaryModel = /*#__PURE__*/function (_BaseModel) {
42
+ _inherits(FreshQualityPackrunSummaryModel, _BaseModel);
43
+
44
+ var _super = _createSuper(FreshQualityPackrunSummaryModel);
45
+
46
+ /**
47
+ * FreshQualityPackrunSummaryModel Constructor
48
+ *
49
+ * @protected
50
+ * @param {number} siteId The Site ID associated with this FreshQuality Packrun Summary
51
+ */
52
+ function FreshQualityPackrunSummaryModel(siteId) {
53
+ var _this;
54
+
55
+ _classCallCheck(this, FreshQualityPackrunSummaryModel);
56
+
57
+ _this = _super.call(this);
58
+ /**
59
+ * The FreshQuality Packrun Summary ID
60
+ *
61
+ * @type {string}
62
+ * @public
63
+ */
64
+
65
+ _this.id = "";
66
+ /**
67
+ * The Packing Line ID this Summary is associated with
68
+ *
69
+ * @type {string}
70
+ * @public
71
+ */
72
+
73
+ _this.packingLineId = "";
74
+ /**
75
+ * The Packrun ID this Summary is associated with
76
+ *
77
+ * @type {string}
78
+ * @public
79
+ */
80
+
81
+ _this.packrunId = "";
82
+ /**
83
+ * When this Summary was Created
84
+ *
85
+ * @type {Date}
86
+ * @public
87
+ */
88
+
89
+ _this.createdTimestamp = new Date();
90
+ /**
91
+ * The Time Batch this Summary is associated with
92
+ *
93
+ * @type {?string}
94
+ * @public
95
+ */
96
+
97
+ _this.timeBatchId = null;
98
+ /**
99
+ * An Array of Class 1 R600 Samples
100
+ *
101
+ * @type {Array<{fruitSize: string, packType: string, timestamp: Date, fruitCount: number, defects: Array<{name: string, group: string, fruitCount: number}>}>}
102
+ * @public
103
+ */
104
+
105
+ _this.class1R600Samples = [];
106
+ /**
107
+ * An Array of Defect Category Summaries (e.g. Minor Packing Defects, Softs)
108
+ *
109
+ * @type {Array<{name: string, percentage: number, defects: Array<{name: string, fruitCount: number, percentage: number}>}>}
110
+ * @public
111
+ */
112
+
113
+ _this.categorySummaries = [];
114
+ /**
115
+ * The Total Number of Fruit Sampled in this Packrun Summary
116
+ *
117
+ * @type {number}
118
+ * @public
119
+ */
120
+
121
+ _this.totalFruitSampled = 0;
122
+ /**
123
+ * Whether the FreshQuality Packrun Summary has been deleted
124
+ *
125
+ * @type {boolean}
126
+ * @public
127
+ */
128
+
129
+ _this.deleted = false;
130
+ /**
131
+ * When the FreshQuality Packrun Summary was last updated
132
+ *
133
+ * @type {Date}
134
+ * @public
135
+ */
136
+
137
+ _this.updateTimestamp = new Date();
138
+ /**
139
+ * The Site ID associated with this FreshQuality Packrun Summary
140
+ *
141
+ * @type {number}
142
+ * @public
143
+ */
144
+
145
+ _this.siteId = siteId;
146
+ return _this;
147
+ }
148
+ /**
149
+ * Create a new **FreshQualityPackrunSummaryModel** from a JSON Object or JSON String
150
+ *
151
+ * @static
152
+ * @public
153
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
154
+ * @param {number} siteId The Site ID associated with this FreshQuality Packrun Summary
155
+ * @return {FreshQualityPackrunSummaryModel}
156
+ */
157
+
158
+
159
+ _createClass(FreshQualityPackrunSummaryModel, null, [{
160
+ key: "fromJSON",
161
+ value: function fromJSON(json, siteId) {
162
+ var model = new FreshQualityPackrunSummaryModel(siteId);
163
+ /**
164
+ * The JSON Object
165
+ *
166
+ * @type {Object<string, any>}
167
+ */
168
+
169
+ var jsonObject = {};
170
+
171
+ if (typeof json === 'string') {
172
+ jsonObject = JSON.parse(json);
173
+ } else if (_typeof(json) === 'object') {
174
+ jsonObject = json;
175
+ }
176
+
177
+ if ('id' in jsonObject) {
178
+ model.id = function () {
179
+ if (typeof jsonObject['id'] !== 'string') {
180
+ return String(jsonObject['id']);
181
+ }
182
+
183
+ return jsonObject['id'];
184
+ }();
185
+ }
186
+
187
+ if ('packingLineId' in jsonObject) {
188
+ model.packingLineId = function () {
189
+ if (typeof jsonObject['packingLineId'] !== 'string') {
190
+ return String(jsonObject['packingLineId']);
191
+ }
192
+
193
+ return jsonObject['packingLineId'];
194
+ }();
195
+ }
196
+
197
+ if ('packrunId' in jsonObject) {
198
+ model.packrunId = function () {
199
+ if (typeof jsonObject['packrunId'] !== 'string') {
200
+ return String(jsonObject['packrunId']);
201
+ }
202
+
203
+ return jsonObject['packrunId'];
204
+ }();
205
+ }
206
+
207
+ if ('createdTimestamp' in jsonObject) {
208
+ model.createdTimestamp = function () {
209
+ if (typeof jsonObject['createdTimestamp'] !== 'string') {
210
+ return new Date(String(jsonObject['createdTimestamp']));
211
+ }
212
+
213
+ return new Date(jsonObject['createdTimestamp']);
214
+ }();
215
+ }
216
+
217
+ if ('timeBatchId' in jsonObject) {
218
+ model.timeBatchId = function () {
219
+ if (jsonObject['timeBatchId'] === null) {
220
+ return null;
221
+ }
222
+
223
+ if (typeof jsonObject['timeBatchId'] !== 'string') {
224
+ return String(jsonObject['timeBatchId']);
225
+ }
226
+
227
+ return jsonObject['timeBatchId'];
228
+ }();
229
+ }
230
+
231
+ if ('class1R600Samples' in jsonObject) {
232
+ model.class1R600Samples = function () {
233
+ if (Array.isArray(jsonObject['class1R600Samples']) !== true) {
234
+ return [];
235
+ }
236
+
237
+ return jsonObject['class1R600Samples'].map(function (class1R600SamplesItem) {
238
+ return function () {
239
+ var class1R600SamplesItemObject = {};
240
+
241
+ if (_typeof(class1R600SamplesItem) === 'object' && 'fruitSize' in class1R600SamplesItem) {
242
+ class1R600SamplesItemObject.fruitSize = function () {
243
+ if (typeof class1R600SamplesItem.fruitSize !== 'string') {
244
+ return String(class1R600SamplesItem.fruitSize);
245
+ }
246
+
247
+ return class1R600SamplesItem.fruitSize;
248
+ }();
249
+ } else {
250
+ class1R600SamplesItemObject.fruitSize = "";
251
+ }
252
+
253
+ if (_typeof(class1R600SamplesItem) === 'object' && 'packType' in class1R600SamplesItem) {
254
+ class1R600SamplesItemObject.packType = function () {
255
+ if (typeof class1R600SamplesItem.packType !== 'string') {
256
+ return String(class1R600SamplesItem.packType);
257
+ }
258
+
259
+ return class1R600SamplesItem.packType;
260
+ }();
261
+ } else {
262
+ class1R600SamplesItemObject.packType = "";
263
+ }
264
+
265
+ if (_typeof(class1R600SamplesItem) === 'object' && 'timestamp' in class1R600SamplesItem) {
266
+ class1R600SamplesItemObject.timestamp = function () {
267
+ if (typeof class1R600SamplesItem.timestamp !== 'string') {
268
+ return new Date(String(class1R600SamplesItem.timestamp));
269
+ }
270
+
271
+ return new Date(class1R600SamplesItem.timestamp);
272
+ }();
273
+ } else {
274
+ class1R600SamplesItemObject.timestamp = new Date();
275
+ }
276
+
277
+ if (_typeof(class1R600SamplesItem) === 'object' && 'fruitCount' in class1R600SamplesItem) {
278
+ class1R600SamplesItemObject.fruitCount = function () {
279
+ if (typeof class1R600SamplesItem.fruitCount !== 'number') {
280
+ return Number.isInteger(Number(class1R600SamplesItem.fruitCount)) ? Number(class1R600SamplesItem.fruitCount) : Math.floor(Number(class1R600SamplesItem.fruitCount));
281
+ }
282
+
283
+ return Number.isInteger(class1R600SamplesItem.fruitCount) ? class1R600SamplesItem.fruitCount : Math.floor(class1R600SamplesItem.fruitCount);
284
+ }();
285
+ } else {
286
+ class1R600SamplesItemObject.fruitCount = 0;
287
+ }
288
+
289
+ if (_typeof(class1R600SamplesItem) === 'object' && 'defects' in class1R600SamplesItem) {
290
+ class1R600SamplesItemObject.defects = function () {
291
+ if (Array.isArray(class1R600SamplesItem.defects) !== true) {
292
+ return [];
293
+ }
294
+
295
+ return class1R600SamplesItem.defects.map(function (defectsItem) {
296
+ return function () {
297
+ var defectsItemObject = {};
298
+
299
+ if (_typeof(defectsItem) === 'object' && 'name' in defectsItem) {
300
+ defectsItemObject.name = function () {
301
+ if (typeof defectsItem.name !== 'string') {
302
+ return String(defectsItem.name);
303
+ }
304
+
305
+ return defectsItem.name;
306
+ }();
307
+ } else {
308
+ defectsItemObject.name = "";
309
+ }
310
+
311
+ if (_typeof(defectsItem) === 'object' && 'group' in defectsItem) {
312
+ defectsItemObject.group = function () {
313
+ if (typeof defectsItem.group !== 'string') {
314
+ return String(defectsItem.group);
315
+ }
316
+
317
+ return defectsItem.group;
318
+ }();
319
+ } else {
320
+ defectsItemObject.group = "";
321
+ }
322
+
323
+ if (_typeof(defectsItem) === 'object' && 'fruitCount' in defectsItem) {
324
+ defectsItemObject.fruitCount = function () {
325
+ if (typeof defectsItem.fruitCount !== 'number') {
326
+ return Number.isInteger(Number(defectsItem.fruitCount)) ? Number(defectsItem.fruitCount) : Math.floor(Number(defectsItem.fruitCount));
327
+ }
328
+
329
+ return Number.isInteger(defectsItem.fruitCount) ? defectsItem.fruitCount : Math.floor(defectsItem.fruitCount);
330
+ }();
331
+ } else {
332
+ defectsItemObject.fruitCount = 0;
333
+ }
334
+
335
+ return defectsItemObject;
336
+ }();
337
+ });
338
+ }();
339
+ } else {
340
+ class1R600SamplesItemObject.defects = [];
341
+ }
342
+
343
+ return class1R600SamplesItemObject;
344
+ }();
345
+ });
346
+ }();
347
+ }
348
+
349
+ if ('categorySummaries' in jsonObject) {
350
+ model.categorySummaries = function () {
351
+ if (Array.isArray(jsonObject['categorySummaries']) !== true) {
352
+ return [];
353
+ }
354
+
355
+ return jsonObject['categorySummaries'].map(function (categorySummariesItem) {
356
+ return function () {
357
+ var categorySummariesItemObject = {};
358
+
359
+ if (_typeof(categorySummariesItem) === 'object' && 'name' in categorySummariesItem) {
360
+ categorySummariesItemObject.name = function () {
361
+ if (typeof categorySummariesItem.name !== 'string') {
362
+ return String(categorySummariesItem.name);
363
+ }
364
+
365
+ return categorySummariesItem.name;
366
+ }();
367
+ } else {
368
+ categorySummariesItemObject.name = "";
369
+ }
370
+
371
+ if (_typeof(categorySummariesItem) === 'object' && 'percentage' in categorySummariesItem) {
372
+ categorySummariesItemObject.percentage = function () {
373
+ if (typeof categorySummariesItem.percentage !== 'number') {
374
+ return Number(categorySummariesItem.percentage);
375
+ }
376
+
377
+ return categorySummariesItem.percentage;
378
+ }();
379
+ } else {
380
+ categorySummariesItemObject.percentage = 0;
381
+ }
382
+
383
+ if (_typeof(categorySummariesItem) === 'object' && 'defects' in categorySummariesItem) {
384
+ categorySummariesItemObject.defects = function () {
385
+ if (Array.isArray(categorySummariesItem.defects) !== true) {
386
+ return [];
387
+ }
388
+
389
+ return categorySummariesItem.defects.map(function (defectsItem) {
390
+ return function () {
391
+ var defectsItemObject = {};
392
+
393
+ if (_typeof(defectsItem) === 'object' && 'name' in defectsItem) {
394
+ defectsItemObject.name = function () {
395
+ if (typeof defectsItem.name !== 'string') {
396
+ return String(defectsItem.name);
397
+ }
398
+
399
+ return defectsItem.name;
400
+ }();
401
+ } else {
402
+ defectsItemObject.name = "";
403
+ }
404
+
405
+ if (_typeof(defectsItem) === 'object' && 'fruitCount' in defectsItem) {
406
+ defectsItemObject.fruitCount = function () {
407
+ if (typeof defectsItem.fruitCount !== 'number') {
408
+ return Number.isInteger(Number(defectsItem.fruitCount)) ? Number(defectsItem.fruitCount) : Math.floor(Number(defectsItem.fruitCount));
409
+ }
410
+
411
+ return Number.isInteger(defectsItem.fruitCount) ? defectsItem.fruitCount : Math.floor(defectsItem.fruitCount);
412
+ }();
413
+ } else {
414
+ defectsItemObject.fruitCount = 0;
415
+ }
416
+
417
+ if (_typeof(defectsItem) === 'object' && 'percentage' in defectsItem) {
418
+ defectsItemObject.percentage = function () {
419
+ if (typeof defectsItem.percentage !== 'number') {
420
+ return Number(defectsItem.percentage);
421
+ }
422
+
423
+ return defectsItem.percentage;
424
+ }();
425
+ } else {
426
+ defectsItemObject.percentage = 0;
427
+ }
428
+
429
+ return defectsItemObject;
430
+ }();
431
+ });
432
+ }();
433
+ } else {
434
+ categorySummariesItemObject.defects = [];
435
+ }
436
+
437
+ return categorySummariesItemObject;
438
+ }();
439
+ });
440
+ }();
441
+ }
442
+
443
+ if ('totalFruitSampled' in jsonObject) {
444
+ model.totalFruitSampled = function () {
445
+ if (typeof jsonObject['totalFruitSampled'] !== 'number') {
446
+ return Number.isInteger(Number(jsonObject['totalFruitSampled'])) ? Number(jsonObject['totalFruitSampled']) : Math.floor(Number(jsonObject['totalFruitSampled']));
447
+ }
448
+
449
+ return Number.isInteger(jsonObject['totalFruitSampled']) ? jsonObject['totalFruitSampled'] : Math.floor(jsonObject['totalFruitSampled']);
450
+ }();
451
+ }
452
+
453
+ if ('deleted' in jsonObject) {
454
+ model.deleted = function () {
455
+ if (typeof jsonObject['deleted'] !== 'boolean') {
456
+ return Boolean(jsonObject['deleted']);
457
+ }
458
+
459
+ return jsonObject['deleted'];
460
+ }();
461
+ }
462
+
463
+ if ('updateTimestamp' in jsonObject) {
464
+ model.updateTimestamp = function () {
465
+ if (typeof jsonObject['updateTimestamp'] !== 'string') {
466
+ return new Date(String(jsonObject['updateTimestamp']));
467
+ }
468
+
469
+ return new Date(jsonObject['updateTimestamp']);
470
+ }();
471
+ }
472
+
473
+ return model;
474
+ }
475
+ }]);
476
+
477
+ return FreshQualityPackrunSummaryModel;
478
+ }(_BaseModel2.default);
479
+
480
+ var _default = FreshQualityPackrunSummaryModel;
481
+ exports.default = _default;
@@ -62,7 +62,7 @@ var GrowingMethodModel = /*#__PURE__*/function (_BaseModel) {
62
62
  * @public
63
63
  */
64
64
 
65
- _this.id = undefined;
65
+ _this.id = "";
66
66
  /**
67
67
  * The Growing Method Code
68
68
  *
@@ -70,7 +70,7 @@ var GrowingMethodModel = /*#__PURE__*/function (_BaseModel) {
70
70
  * @public
71
71
  */
72
72
 
73
- _this.code = undefined;
73
+ _this.code = "";
74
74
  /**
75
75
  * The Growing Method Name
76
76
  *
@@ -78,7 +78,7 @@ var GrowingMethodModel = /*#__PURE__*/function (_BaseModel) {
78
78
  * @public
79
79
  */
80
80
 
81
- _this.name = undefined;
81
+ _this.name = "";
82
82
  /**
83
83
  * The Growing Method Description
84
84
  *
@@ -86,7 +86,7 @@ var GrowingMethodModel = /*#__PURE__*/function (_BaseModel) {
86
86
  * @public
87
87
  */
88
88
 
89
- _this.description = undefined;
89
+ _this.description = "";
90
90
  /**
91
91
  * Whether the Growing Method has been deleted
92
92
  *
@@ -94,7 +94,7 @@ var GrowingMethodModel = /*#__PURE__*/function (_BaseModel) {
94
94
  * @public
95
95
  */
96
96
 
97
- _this.deleted = undefined;
97
+ _this.deleted = false;
98
98
  /**
99
99
  * When the Growing Method was last updated
100
100
  *
@@ -102,7 +102,7 @@ var GrowingMethodModel = /*#__PURE__*/function (_BaseModel) {
102
102
  * @public
103
103
  */
104
104
 
105
- _this.updateTimestamp = undefined;
105
+ _this.updateTimestamp = new Date();
106
106
  /**
107
107
  * The Site ID associated with this Growing Method
108
108
  *
@@ -62,7 +62,7 @@ var PackTypeModel = /*#__PURE__*/function (_BaseModel) {
62
62
  * @public
63
63
  */
64
64
 
65
- _this.id = undefined;
65
+ _this.id = "";
66
66
  /**
67
67
  * The Code for this Pack Type
68
68
  *
@@ -70,7 +70,7 @@ var PackTypeModel = /*#__PURE__*/function (_BaseModel) {
70
70
  * @public
71
71
  */
72
72
 
73
- _this.code = undefined;
73
+ _this.code = "";
74
74
  /**
75
75
  * The Name for this Pack Type
76
76
  *
@@ -78,7 +78,7 @@ var PackTypeModel = /*#__PURE__*/function (_BaseModel) {
78
78
  * @public
79
79
  */
80
80
 
81
- _this.name = undefined;
81
+ _this.name = "";
82
82
  /**
83
83
  * An Optional Description for this Pack Type
84
84
  *
@@ -86,7 +86,7 @@ var PackTypeModel = /*#__PURE__*/function (_BaseModel) {
86
86
  * @public
87
87
  */
88
88
 
89
- _this.description = undefined;
89
+ _this.description = "";
90
90
  /**
91
91
  * The Physical Form of this Pack Type
92
92
  *
@@ -94,7 +94,7 @@ var PackTypeModel = /*#__PURE__*/function (_BaseModel) {
94
94
  * @public
95
95
  */
96
96
 
97
- _this.form = undefined;
97
+ _this.form = "";
98
98
  /**
99
99
  * An Array of Fruit Sizes Defined for this Pack Type
100
100
  *
@@ -102,7 +102,7 @@ var PackTypeModel = /*#__PURE__*/function (_BaseModel) {
102
102
  * @public
103
103
  */
104
104
 
105
- _this.fruitSizes = undefined;
105
+ _this.fruitSizes = [];
106
106
  /**
107
107
  * Whether the Pack Type has been deleted
108
108
  *
@@ -110,7 +110,7 @@ var PackTypeModel = /*#__PURE__*/function (_BaseModel) {
110
110
  * @public
111
111
  */
112
112
 
113
- _this.deleted = undefined;
113
+ _this.deleted = false;
114
114
  /**
115
115
  * When the Pack Type was last updated
116
116
  *
@@ -118,7 +118,7 @@ var PackTypeModel = /*#__PURE__*/function (_BaseModel) {
118
118
  * @public
119
119
  */
120
120
 
121
- _this.updateTimestamp = undefined;
121
+ _this.updateTimestamp = new Date();
122
122
  /**
123
123
  * The Site ID associated with this Pack Type
124
124
  *