@ricado/api-client 2.0.2 → 2.2.0

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 (155) hide show
  1. package/README.md +5 -7
  2. package/dist/ricado.api.client.js +1 -1
  3. package/lib/Controllers/Packhouse/Site/BinTipBinController.js +622 -0
  4. package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
  5. package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
  6. package/lib/Controllers/Packhouse/Site/CompacSizerController.js +7 -7
  7. package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
  8. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
  9. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
  10. package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
  11. package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
  12. package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
  13. package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +657 -0
  14. package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
  15. package/lib/Controllers/Packhouse/Site/PackTypeController.js +4 -4
  16. package/lib/Controllers/Packhouse/Site/PackingLineController.js +29 -5
  17. package/lib/Controllers/Packhouse/Site/PackrunController.js +46 -4
  18. package/lib/Controllers/Packhouse/Site/RejectBinController.js +4 -4
  19. package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +28 -6
  20. package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
  21. package/lib/Controllers/Packhouse/Site/ShiftController.js +4 -4
  22. package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
  23. package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +19 -4
  24. package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +661 -0
  25. package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +628 -0
  26. package/lib/Controllers/Packhouse/Site/SoftSortBeltController.js +453 -0
  27. package/lib/Controllers/Packhouse/Site/VarietyController.js +4 -4
  28. package/lib/Controllers/Packhouse/Site/index.js +15 -0
  29. package/lib/Controllers/Site/AlarmController.js +4 -4
  30. package/lib/Controllers/Site/AlarmGroupController.js +4 -4
  31. package/lib/Controllers/Site/DefinitionController.js +4 -4
  32. package/lib/Controllers/Site/PermanentObjectController.js +4 -4
  33. package/lib/Controllers/Site/PermanentObjectDataController.js +4 -4
  34. package/lib/Controllers/Site/PointController.js +4 -4
  35. package/lib/Controllers/Site/TemporaryObjectController.js +4 -4
  36. package/lib/Errors/BadRequestError.js +1 -1
  37. package/lib/Errors/ForbiddenError.js +1 -1
  38. package/lib/Errors/NetworkError.js +1 -1
  39. package/lib/Errors/NotAllowedError.js +1 -1
  40. package/lib/Errors/NotFoundError.js +1 -1
  41. package/lib/Errors/ServerError.js +1 -1
  42. package/lib/Errors/UnauthorizedError.js +1 -1
  43. package/lib/Models/AccountPolicyModel.js +1 -1
  44. package/lib/Models/ApiAccountModel.js +1 -1
  45. package/lib/Models/CompanyModel.js +1 -1
  46. package/lib/Models/FirebaseTokenModel.js +1 -1
  47. package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
  48. package/lib/Models/Packhouse/Site/BinTipWeightModel.js +14 -4
  49. package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +14 -4
  50. package/lib/Models/Packhouse/Site/CompacSizerModel.js +15 -5
  51. package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +14 -4
  52. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +14 -4
  53. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +14 -4
  54. package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +14 -4
  55. package/lib/Models/Packhouse/Site/DowntimeEventModel.js +14 -4
  56. package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +14 -4
  57. package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
  58. package/lib/Models/Packhouse/Site/GrowingMethodModel.js +14 -4
  59. package/lib/Models/Packhouse/Site/PackTypeModel.js +14 -4
  60. package/lib/Models/Packhouse/Site/PackingLineModel.js +538 -5
  61. package/lib/Models/Packhouse/Site/PackrunModel.js +80 -4
  62. package/lib/Models/Packhouse/Site/RejectBinModel.js +14 -4
  63. package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +274 -8
  64. package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +14 -4
  65. package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +14 -4
  66. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +181 -5
  67. package/lib/Models/Packhouse/Site/ShiftModel.js +14 -4
  68. package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
  69. package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
  70. package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +235 -0
  71. package/lib/Models/Packhouse/Site/VarietyModel.js +14 -4
  72. package/lib/Models/Packhouse/Site/index.js +15 -0
  73. package/lib/Models/RTUModel.js +1 -1
  74. package/lib/Models/RTUPluginModel.js +1 -1
  75. package/lib/Models/Site/AlarmGroupModel.js +14 -4
  76. package/lib/Models/Site/AlarmModel.js +14 -4
  77. package/lib/Models/Site/DefinitionModel.js +14 -4
  78. package/lib/Models/Site/PermanentObjectDataModel.js +14 -4
  79. package/lib/Models/Site/PermanentObjectModel.js +14 -4
  80. package/lib/Models/Site/PointModel.js +14 -4
  81. package/lib/Models/Site/TemporaryObjectModel.js +14 -4
  82. package/lib/Models/SiteModel.js +1 -1
  83. package/lib/Models/TokenModel.js +1 -1
  84. package/lib/Models/UserAccountActionTokenModel.js +1 -1
  85. package/lib/Models/UserAccountModel.js +1 -1
  86. package/lib/PackageVersion.js +1 -1
  87. package/lib/index.d.ts +4039 -1071
  88. package/package.json +1 -1
  89. package/src/Controllers/Packhouse/Site/BinTipBinController.js +665 -0
  90. package/src/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
  91. package/src/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
  92. package/src/Controllers/Packhouse/Site/CompacSizerController.js +7 -7
  93. package/src/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
  94. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
  95. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
  96. package/src/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
  97. package/src/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
  98. package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
  99. package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +700 -0
  100. package/src/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
  101. package/src/Controllers/Packhouse/Site/PackTypeController.js +4 -4
  102. package/src/Controllers/Packhouse/Site/PackingLineController.js +29 -5
  103. package/src/Controllers/Packhouse/Site/PackrunController.js +56 -4
  104. package/src/Controllers/Packhouse/Site/RejectBinController.js +4 -4
  105. package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +28 -6
  106. package/src/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
  107. package/src/Controllers/Packhouse/Site/ShiftController.js +4 -4
  108. package/src/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
  109. package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +19 -4
  110. package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +704 -0
  111. package/src/Controllers/Packhouse/Site/ShiftTaskController.js +671 -0
  112. package/src/Controllers/Packhouse/Site/SoftSortBeltController.js +474 -0
  113. package/src/Controllers/Packhouse/Site/VarietyController.js +4 -4
  114. package/src/Controllers/Packhouse/Site/index.js +10 -0
  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 +4 -4
  121. package/src/Controllers/Site/TemporaryObjectController.js +4 -4
  122. package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
  123. package/src/Models/Packhouse/Site/BinTipWeightModel.js +13 -3
  124. package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +13 -3
  125. package/src/Models/Packhouse/Site/CompacSizerModel.js +14 -4
  126. package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +13 -3
  127. package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +13 -3
  128. package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +13 -3
  129. package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +13 -3
  130. package/src/Models/Packhouse/Site/DowntimeEventModel.js +13 -3
  131. package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +13 -3
  132. package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
  133. package/src/Models/Packhouse/Site/GrowingMethodModel.js +13 -3
  134. package/src/Models/Packhouse/Site/PackTypeModel.js +13 -3
  135. package/src/Models/Packhouse/Site/PackingLineModel.js +718 -4
  136. package/src/Models/Packhouse/Site/PackrunModel.js +88 -3
  137. package/src/Models/Packhouse/Site/RejectBinModel.js +13 -3
  138. package/src/Models/Packhouse/Site/RejectBinScaleModel.js +310 -7
  139. package/src/Models/Packhouse/Site/RejectBinWeightModel.js +13 -3
  140. package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +13 -3
  141. package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +205 -4
  142. package/src/Models/Packhouse/Site/ShiftModel.js +13 -3
  143. package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
  144. package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
  145. package/src/Models/Packhouse/Site/SoftSortBeltModel.js +215 -0
  146. package/src/Models/Packhouse/Site/VarietyModel.js +13 -3
  147. package/src/Models/Packhouse/Site/index.js +10 -0
  148. package/src/Models/Site/AlarmGroupModel.js +13 -3
  149. package/src/Models/Site/AlarmModel.js +13 -3
  150. package/src/Models/Site/DefinitionModel.js +13 -3
  151. package/src/Models/Site/PermanentObjectDataModel.js +13 -3
  152. package/src/Models/Site/PermanentObjectModel.js +13 -3
  153. package/src/Models/Site/PointModel.js +13 -3
  154. package/src/Models/Site/TemporaryObjectModel.js +13 -3
  155. package/src/PackageVersion.js +1 -1
@@ -0,0 +1,523 @@
1
+ /**
2
+ * File Auto-Generated by the RICADO Gen 4 PHP API Project
3
+ *
4
+ * Do Not Edit this File Manually!
5
+ */
6
+
7
+ import BaseModel from '../../../Models/BaseModel';
8
+
9
+ /**
10
+ * Model Class for a FreshQuality Packrun Summary
11
+ *
12
+ * @class
13
+ * @hideconstructor
14
+ * @extends BaseModel
15
+ */
16
+ class FreshQualityPackrunSummaryModel extends BaseModel
17
+ {
18
+ /**
19
+ * FreshQualityPackrunSummaryModel Constructor
20
+ *
21
+ * @protected
22
+ * @param {number} siteId The Site ID associated with this FreshQuality Packrun Summary
23
+ */
24
+ constructor(siteId)
25
+ {
26
+ super();
27
+
28
+ /**
29
+ * The FreshQuality Packrun Summary ID
30
+ *
31
+ * @type {string}
32
+ * @public
33
+ */
34
+ this.id = undefined;
35
+
36
+ /**
37
+ * The Packing Line ID this Summary is associated with
38
+ *
39
+ * @type {string}
40
+ * @public
41
+ */
42
+ this.packingLineId = undefined;
43
+
44
+ /**
45
+ * The Packrun ID this Summary is associated with
46
+ *
47
+ * @type {string}
48
+ * @public
49
+ */
50
+ this.packrunId = undefined;
51
+
52
+ /**
53
+ * When this Summary was Created
54
+ *
55
+ * @type {Date}
56
+ * @public
57
+ */
58
+ this.createdTimestamp = undefined;
59
+
60
+ /**
61
+ * The Time Batch this Summary is associated with
62
+ *
63
+ * @type {?string}
64
+ * @public
65
+ */
66
+ this.timeBatchId = undefined;
67
+
68
+ /**
69
+ * An Array of Class 1 R600 Samples
70
+ *
71
+ * @type {Array<{fruitSize: string, packType: string, timestamp: Date, fruitCount: number, defects: Array<{name: string, group: string, fruitCount: number}>}>}
72
+ * @public
73
+ */
74
+ this.class1R600Samples = undefined;
75
+
76
+ /**
77
+ * An Array of Defect Category Summaries (e.g. Minor Packing Defects, Softs)
78
+ *
79
+ * @type {Array<{name: string, percentage: number, defects: Array<{name: string, fruitCount: number, percentage: number}>}>}
80
+ * @public
81
+ */
82
+ this.categorySummaries = undefined;
83
+
84
+ /**
85
+ * The Total Number of Fruit Sampled in this Packrun Summary
86
+ *
87
+ * @type {number}
88
+ * @public
89
+ */
90
+ this.totalFruitSampled = undefined;
91
+
92
+ /**
93
+ * Whether the FreshQuality Packrun Summary has been deleted
94
+ *
95
+ * @type {boolean}
96
+ * @public
97
+ */
98
+ this.deleted = undefined;
99
+
100
+ /**
101
+ * When the FreshQuality Packrun Summary was last updated
102
+ *
103
+ * @type {Date}
104
+ * @public
105
+ */
106
+ this.updateTimestamp = undefined;
107
+
108
+ /**
109
+ * The Site ID associated with this FreshQuality Packrun Summary
110
+ *
111
+ * @type {number}
112
+ * @public
113
+ */
114
+ this.siteId = siteId;
115
+ }
116
+
117
+ /**
118
+ * Create a new **FreshQualityPackrunSummaryModel** from a JSON Object or JSON String
119
+ *
120
+ * @static
121
+ * @public
122
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
123
+ * @param {number} siteId The Site ID associated with this FreshQuality Packrun Summary
124
+ * @return {FreshQualityPackrunSummaryModel}
125
+ */
126
+ static fromJSON(json, siteId)
127
+ {
128
+ let model = new FreshQualityPackrunSummaryModel(siteId);
129
+
130
+ /**
131
+ * The JSON Object
132
+ *
133
+ * @type {Object<string, any>}
134
+ */
135
+ let jsonObject = {};
136
+
137
+ if(typeof json === 'string')
138
+ {
139
+ jsonObject = JSON.parse(json);
140
+ }
141
+ else if(typeof json === 'object')
142
+ {
143
+ jsonObject = json;
144
+ }
145
+
146
+ if('id' in jsonObject)
147
+ {
148
+ model.id = (function(){
149
+ if(typeof jsonObject['id'] !== 'string')
150
+ {
151
+ return String(jsonObject['id']);
152
+ }
153
+
154
+ return jsonObject['id'];
155
+ }());
156
+ }
157
+
158
+ if('packingLineId' in jsonObject)
159
+ {
160
+ model.packingLineId = (function(){
161
+ if(typeof jsonObject['packingLineId'] !== 'string')
162
+ {
163
+ return String(jsonObject['packingLineId']);
164
+ }
165
+
166
+ return jsonObject['packingLineId'];
167
+ }());
168
+ }
169
+
170
+ if('packrunId' in jsonObject)
171
+ {
172
+ model.packrunId = (function(){
173
+ if(typeof jsonObject['packrunId'] !== 'string')
174
+ {
175
+ return String(jsonObject['packrunId']);
176
+ }
177
+
178
+ return jsonObject['packrunId'];
179
+ }());
180
+ }
181
+
182
+ if('createdTimestamp' in jsonObject)
183
+ {
184
+ model.createdTimestamp = (function(){
185
+ if(typeof jsonObject['createdTimestamp'] !== 'string')
186
+ {
187
+ return new Date(String(jsonObject['createdTimestamp']));
188
+ }
189
+
190
+ return new Date(jsonObject['createdTimestamp']);
191
+ }());
192
+ }
193
+
194
+ if('timeBatchId' in jsonObject)
195
+ {
196
+ model.timeBatchId = (function(){
197
+ if(jsonObject['timeBatchId'] === null)
198
+ {
199
+ return null;
200
+ }
201
+
202
+ if(typeof jsonObject['timeBatchId'] !== 'string')
203
+ {
204
+ return String(jsonObject['timeBatchId']);
205
+ }
206
+
207
+ return jsonObject['timeBatchId'];
208
+ }());
209
+ }
210
+
211
+ if('class1R600Samples' in jsonObject)
212
+ {
213
+ model.class1R600Samples = (function(){
214
+ if(Array.isArray(jsonObject['class1R600Samples']) !== true)
215
+ {
216
+ return [];
217
+ }
218
+
219
+ return jsonObject['class1R600Samples'].map((class1R600SamplesItem) => {
220
+ return (function(){
221
+ let class1R600SamplesItemObject = {};
222
+
223
+ if(typeof class1R600SamplesItem === 'object' && 'fruitSize' in class1R600SamplesItem)
224
+ {
225
+ class1R600SamplesItemObject.fruitSize = (function(){
226
+ if(typeof class1R600SamplesItem.fruitSize !== 'string')
227
+ {
228
+ return String(class1R600SamplesItem.fruitSize);
229
+ }
230
+
231
+ return class1R600SamplesItem.fruitSize;
232
+ }());
233
+ }
234
+ else
235
+ {
236
+ class1R600SamplesItemObject.fruitSize = "";
237
+ }
238
+
239
+ if(typeof class1R600SamplesItem === 'object' && 'packType' in class1R600SamplesItem)
240
+ {
241
+ class1R600SamplesItemObject.packType = (function(){
242
+ if(typeof class1R600SamplesItem.packType !== 'string')
243
+ {
244
+ return String(class1R600SamplesItem.packType);
245
+ }
246
+
247
+ return class1R600SamplesItem.packType;
248
+ }());
249
+ }
250
+ else
251
+ {
252
+ class1R600SamplesItemObject.packType = "";
253
+ }
254
+
255
+ if(typeof class1R600SamplesItem === 'object' && 'timestamp' in class1R600SamplesItem)
256
+ {
257
+ class1R600SamplesItemObject.timestamp = (function(){
258
+ if(typeof class1R600SamplesItem.timestamp !== 'string')
259
+ {
260
+ return new Date(String(class1R600SamplesItem.timestamp));
261
+ }
262
+
263
+ return new Date(class1R600SamplesItem.timestamp);
264
+ }());
265
+ }
266
+ else
267
+ {
268
+ class1R600SamplesItemObject.timestamp = new Date();
269
+ }
270
+
271
+ if(typeof class1R600SamplesItem === 'object' && 'fruitCount' in class1R600SamplesItem)
272
+ {
273
+ class1R600SamplesItemObject.fruitCount = (function(){
274
+ if(typeof class1R600SamplesItem.fruitCount !== 'number')
275
+ {
276
+ return Number.isInteger(Number(class1R600SamplesItem.fruitCount)) ? Number(class1R600SamplesItem.fruitCount) : Math.floor(Number(class1R600SamplesItem.fruitCount));
277
+ }
278
+
279
+ return Number.isInteger(class1R600SamplesItem.fruitCount) ? class1R600SamplesItem.fruitCount : Math.floor(class1R600SamplesItem.fruitCount);
280
+ }());
281
+ }
282
+ else
283
+ {
284
+ class1R600SamplesItemObject.fruitCount = 0;
285
+ }
286
+
287
+ if(typeof class1R600SamplesItem === 'object' && 'defects' in class1R600SamplesItem)
288
+ {
289
+ class1R600SamplesItemObject.defects = (function(){
290
+ if(Array.isArray(class1R600SamplesItem.defects) !== true)
291
+ {
292
+ return [];
293
+ }
294
+
295
+ return class1R600SamplesItem.defects.map((defectsItem) => {
296
+ return (function(){
297
+ let defectsItemObject = {};
298
+
299
+ if(typeof defectsItem === 'object' && 'name' in defectsItem)
300
+ {
301
+ defectsItemObject.name = (function(){
302
+ if(typeof defectsItem.name !== 'string')
303
+ {
304
+ return String(defectsItem.name);
305
+ }
306
+
307
+ return defectsItem.name;
308
+ }());
309
+ }
310
+ else
311
+ {
312
+ defectsItemObject.name = "";
313
+ }
314
+
315
+ if(typeof defectsItem === 'object' && 'group' in defectsItem)
316
+ {
317
+ defectsItemObject.group = (function(){
318
+ if(typeof defectsItem.group !== 'string')
319
+ {
320
+ return String(defectsItem.group);
321
+ }
322
+
323
+ return defectsItem.group;
324
+ }());
325
+ }
326
+ else
327
+ {
328
+ defectsItemObject.group = "";
329
+ }
330
+
331
+ if(typeof defectsItem === 'object' && 'fruitCount' in defectsItem)
332
+ {
333
+ defectsItemObject.fruitCount = (function(){
334
+ if(typeof defectsItem.fruitCount !== 'number')
335
+ {
336
+ return Number.isInteger(Number(defectsItem.fruitCount)) ? Number(defectsItem.fruitCount) : Math.floor(Number(defectsItem.fruitCount));
337
+ }
338
+
339
+ return Number.isInteger(defectsItem.fruitCount) ? defectsItem.fruitCount : Math.floor(defectsItem.fruitCount);
340
+ }());
341
+ }
342
+ else
343
+ {
344
+ defectsItemObject.fruitCount = 0;
345
+ }
346
+
347
+ return defectsItemObject;
348
+ }());
349
+ });
350
+ }());
351
+ }
352
+ else
353
+ {
354
+ class1R600SamplesItemObject.defects = [];
355
+ }
356
+
357
+ return class1R600SamplesItemObject;
358
+ }());
359
+ });
360
+ }());
361
+ }
362
+
363
+ if('categorySummaries' in jsonObject)
364
+ {
365
+ model.categorySummaries = (function(){
366
+ if(Array.isArray(jsonObject['categorySummaries']) !== true)
367
+ {
368
+ return [];
369
+ }
370
+
371
+ return jsonObject['categorySummaries'].map((categorySummariesItem) => {
372
+ return (function(){
373
+ let categorySummariesItemObject = {};
374
+
375
+ if(typeof categorySummariesItem === 'object' && 'name' in categorySummariesItem)
376
+ {
377
+ categorySummariesItemObject.name = (function(){
378
+ if(typeof categorySummariesItem.name !== 'string')
379
+ {
380
+ return String(categorySummariesItem.name);
381
+ }
382
+
383
+ return categorySummariesItem.name;
384
+ }());
385
+ }
386
+ else
387
+ {
388
+ categorySummariesItemObject.name = "";
389
+ }
390
+
391
+ if(typeof categorySummariesItem === 'object' && 'percentage' in categorySummariesItem)
392
+ {
393
+ categorySummariesItemObject.percentage = (function(){
394
+ if(typeof categorySummariesItem.percentage !== 'number')
395
+ {
396
+ return Number(categorySummariesItem.percentage);
397
+ }
398
+
399
+ return categorySummariesItem.percentage;
400
+ }());
401
+ }
402
+ else
403
+ {
404
+ categorySummariesItemObject.percentage = 0;
405
+ }
406
+
407
+ if(typeof categorySummariesItem === 'object' && 'defects' in categorySummariesItem)
408
+ {
409
+ categorySummariesItemObject.defects = (function(){
410
+ if(Array.isArray(categorySummariesItem.defects) !== true)
411
+ {
412
+ return [];
413
+ }
414
+
415
+ return categorySummariesItem.defects.map((defectsItem) => {
416
+ return (function(){
417
+ let defectsItemObject = {};
418
+
419
+ if(typeof defectsItem === 'object' && 'name' in defectsItem)
420
+ {
421
+ defectsItemObject.name = (function(){
422
+ if(typeof defectsItem.name !== 'string')
423
+ {
424
+ return String(defectsItem.name);
425
+ }
426
+
427
+ return defectsItem.name;
428
+ }());
429
+ }
430
+ else
431
+ {
432
+ defectsItemObject.name = "";
433
+ }
434
+
435
+ if(typeof defectsItem === 'object' && 'fruitCount' in defectsItem)
436
+ {
437
+ defectsItemObject.fruitCount = (function(){
438
+ if(typeof defectsItem.fruitCount !== 'number')
439
+ {
440
+ return Number.isInteger(Number(defectsItem.fruitCount)) ? Number(defectsItem.fruitCount) : Math.floor(Number(defectsItem.fruitCount));
441
+ }
442
+
443
+ return Number.isInteger(defectsItem.fruitCount) ? defectsItem.fruitCount : Math.floor(defectsItem.fruitCount);
444
+ }());
445
+ }
446
+ else
447
+ {
448
+ defectsItemObject.fruitCount = 0;
449
+ }
450
+
451
+ if(typeof defectsItem === 'object' && 'percentage' in defectsItem)
452
+ {
453
+ defectsItemObject.percentage = (function(){
454
+ if(typeof defectsItem.percentage !== 'number')
455
+ {
456
+ return Number(defectsItem.percentage);
457
+ }
458
+
459
+ return defectsItem.percentage;
460
+ }());
461
+ }
462
+ else
463
+ {
464
+ defectsItemObject.percentage = 0;
465
+ }
466
+
467
+ return defectsItemObject;
468
+ }());
469
+ });
470
+ }());
471
+ }
472
+ else
473
+ {
474
+ categorySummariesItemObject.defects = [];
475
+ }
476
+
477
+ return categorySummariesItemObject;
478
+ }());
479
+ });
480
+ }());
481
+ }
482
+
483
+ if('totalFruitSampled' in jsonObject)
484
+ {
485
+ model.totalFruitSampled = (function(){
486
+ if(typeof jsonObject['totalFruitSampled'] !== 'number')
487
+ {
488
+ return Number.isInteger(Number(jsonObject['totalFruitSampled'])) ? Number(jsonObject['totalFruitSampled']) : Math.floor(Number(jsonObject['totalFruitSampled']));
489
+ }
490
+
491
+ return Number.isInteger(jsonObject['totalFruitSampled']) ? jsonObject['totalFruitSampled'] : Math.floor(jsonObject['totalFruitSampled']);
492
+ }());
493
+ }
494
+
495
+ if('deleted' in jsonObject)
496
+ {
497
+ model.deleted = (function(){
498
+ if(typeof jsonObject['deleted'] !== 'boolean')
499
+ {
500
+ return Boolean(jsonObject['deleted']);
501
+ }
502
+
503
+ return jsonObject['deleted'];
504
+ }());
505
+ }
506
+
507
+ if('updateTimestamp' in jsonObject)
508
+ {
509
+ model.updateTimestamp = (function(){
510
+ if(typeof jsonObject['updateTimestamp'] !== 'string')
511
+ {
512
+ return new Date(String(jsonObject['updateTimestamp']));
513
+ }
514
+
515
+ return new Date(jsonObject['updateTimestamp']);
516
+ }());
517
+ }
518
+
519
+ return model;
520
+ }
521
+ }
522
+
523
+ export default FreshQualityPackrunSummaryModel;
@@ -19,8 +19,9 @@ class GrowingMethodModel extends BaseModel
19
19
  * GrowingMethodModel Constructor
20
20
  *
21
21
  * @protected
22
+ * @param {number} siteId The Site ID associated with this Growing Method
22
23
  */
23
- constructor()
24
+ constructor(siteId)
24
25
  {
25
26
  super();
26
27
 
@@ -71,6 +72,14 @@ class GrowingMethodModel extends BaseModel
71
72
  * @public
72
73
  */
73
74
  this.updateTimestamp = undefined;
75
+
76
+ /**
77
+ * The Site ID associated with this Growing Method
78
+ *
79
+ * @type {number}
80
+ * @public
81
+ */
82
+ this.siteId = siteId;
74
83
  }
75
84
 
76
85
  /**
@@ -79,11 +88,12 @@ class GrowingMethodModel extends BaseModel
79
88
  * @static
80
89
  * @public
81
90
  * @param {Object<string, any>|string} json A JSON Object or JSON String
91
+ * @param {number} siteId The Site ID associated with this Growing Method
82
92
  * @return {GrowingMethodModel}
83
93
  */
84
- static fromJSON(json)
94
+ static fromJSON(json, siteId)
85
95
  {
86
- let model = new GrowingMethodModel();
96
+ let model = new GrowingMethodModel(siteId);
87
97
 
88
98
  /**
89
99
  * The JSON Object
@@ -19,8 +19,9 @@ class PackTypeModel extends BaseModel
19
19
  * PackTypeModel Constructor
20
20
  *
21
21
  * @protected
22
+ * @param {number} siteId The Site ID associated with this Pack Type
22
23
  */
23
- constructor()
24
+ constructor(siteId)
24
25
  {
25
26
  super();
26
27
 
@@ -87,6 +88,14 @@ class PackTypeModel extends BaseModel
87
88
  * @public
88
89
  */
89
90
  this.updateTimestamp = undefined;
91
+
92
+ /**
93
+ * The Site ID associated with this Pack Type
94
+ *
95
+ * @type {number}
96
+ * @public
97
+ */
98
+ this.siteId = siteId;
90
99
  }
91
100
 
92
101
  /**
@@ -95,11 +104,12 @@ class PackTypeModel extends BaseModel
95
104
  * @static
96
105
  * @public
97
106
  * @param {Object<string, any>|string} json A JSON Object or JSON String
107
+ * @param {number} siteId The Site ID associated with this Pack Type
98
108
  * @return {PackTypeModel}
99
109
  */
100
- static fromJSON(json)
110
+ static fromJSON(json, siteId)
101
111
  {
102
- let model = new PackTypeModel();
112
+ let model = new PackTypeModel(siteId);
103
113
 
104
114
  /**
105
115
  * The JSON Object