@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.
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/BinTipBinController.js +622 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
- package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +657 -0
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +29 -1
- package/lib/Controllers/Packhouse/Site/PackrunController.js +42 -0
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +661 -0
- package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +628 -0
- package/lib/Controllers/Packhouse/Site/index.js +12 -0
- package/lib/DataItems/PointValueItem.js +3 -3
- package/lib/Models/AccountPolicyModel.js +7 -7
- package/lib/Models/ApiAccountModel.js +7 -7
- package/lib/Models/CompanyModel.js +5 -5
- package/lib/Models/FirebaseTokenModel.js +8 -8
- package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
- package/lib/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +15 -15
- package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/lib/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
- package/lib/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/lib/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/lib/Models/Packhouse/Site/PackingLineModel.js +583 -16
- package/lib/Models/Packhouse/Site/PackrunModel.js +81 -15
- package/lib/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +23 -23
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +204 -38
- package/lib/Models/Packhouse/Site/ShiftModel.js +26 -19
- package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
- package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
- package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +7 -7
- package/lib/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/lib/Models/Packhouse/Site/index.js +12 -0
- package/lib/Models/RTUModel.js +6 -6
- package/lib/Models/RTUPluginModel.js +5 -5
- package/lib/Models/Site/AlarmGroupModel.js +7 -7
- package/lib/Models/Site/AlarmModel.js +17 -17
- package/lib/Models/Site/DefinitionModel.js +6 -6
- package/lib/Models/Site/PermanentObjectDataModel.js +8 -8
- package/lib/Models/Site/PermanentObjectModel.js +7 -7
- package/lib/Models/Site/PointModel.js +11 -11
- package/lib/Models/Site/TemporaryObjectModel.js +6 -6
- package/lib/Models/SiteModel.js +6 -6
- package/lib/Models/TokenModel.js +10 -10
- package/lib/Models/UserAccountActionTokenModel.js +11 -11
- package/lib/Models/UserAccountModel.js +10 -10
- package/lib/PackageVersion.js +1 -1
- package/lib/Points.js +22 -12
- package/lib/WebSocketHelper.js +29 -13
- package/lib/index.d.ts +2473 -348
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/BinTipBinController.js +665 -0
- package/src/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
- package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +700 -0
- package/src/Controllers/Packhouse/Site/PackingLineController.js +29 -1
- package/src/Controllers/Packhouse/Site/PackrunController.js +52 -0
- package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +704 -0
- package/src/Controllers/Packhouse/Site/ShiftTaskController.js +671 -0
- package/src/Controllers/Packhouse/Site/index.js +8 -0
- package/src/DataItems/PointValueItem.js +3 -3
- package/src/Models/AccountPolicyModel.js +7 -7
- package/src/Models/ApiAccountModel.js +7 -7
- package/src/Models/CompanyModel.js +5 -5
- package/src/Models/FirebaseTokenModel.js +8 -8
- package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
- package/src/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerModel.js +15 -15
- package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/src/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
- package/src/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/src/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/src/Models/Packhouse/Site/PackingLineModel.js +770 -16
- package/src/Models/Packhouse/Site/PackrunModel.js +90 -15
- package/src/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +23 -23
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +229 -38
- package/src/Models/Packhouse/Site/ShiftModel.js +29 -19
- package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
- package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
- package/src/Models/Packhouse/Site/SoftSortBeltModel.js +7 -7
- package/src/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/src/Models/Packhouse/Site/index.js +8 -0
- package/src/Models/RTUModel.js +6 -6
- package/src/Models/RTUPluginModel.js +5 -5
- package/src/Models/Site/AlarmGroupModel.js +7 -7
- package/src/Models/Site/AlarmModel.js +17 -17
- package/src/Models/Site/DefinitionModel.js +6 -6
- package/src/Models/Site/PermanentObjectDataModel.js +8 -8
- package/src/Models/Site/PermanentObjectModel.js +7 -7
- package/src/Models/Site/PointModel.js +11 -11
- package/src/Models/Site/TemporaryObjectModel.js +6 -6
- package/src/Models/SiteModel.js +6 -6
- package/src/Models/TokenModel.js +10 -10
- package/src/Models/UserAccountActionTokenModel.js +11 -11
- package/src/Models/UserAccountModel.js +10 -10
- package/src/PackageVersion.js +1 -1
- package/src/Points.js +24 -12
- package/src/WebSocketHelper.js +34 -13
- package/src/index.js +3 -3
- package/types/tslint.json +2 -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 = "";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The Packing Line ID this Summary is associated with
|
|
38
|
+
*
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
this.packingLineId = "";
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The Packrun ID this Summary is associated with
|
|
46
|
+
*
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
this.packrunId = "";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* When this Summary was Created
|
|
54
|
+
*
|
|
55
|
+
* @type {Date}
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
this.createdTimestamp = new Date();
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The Time Batch this Summary is associated with
|
|
62
|
+
*
|
|
63
|
+
* @type {?string}
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
this.timeBatchId = null;
|
|
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 = [];
|
|
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 = [];
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The Total Number of Fruit Sampled in this Packrun Summary
|
|
86
|
+
*
|
|
87
|
+
* @type {number}
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
this.totalFruitSampled = 0;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Whether the FreshQuality Packrun Summary has been deleted
|
|
94
|
+
*
|
|
95
|
+
* @type {boolean}
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
this.deleted = false;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* When the FreshQuality Packrun Summary was last updated
|
|
102
|
+
*
|
|
103
|
+
* @type {Date}
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
this.updateTimestamp = new Date();
|
|
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;
|
|
@@ -31,7 +31,7 @@ class GrowingMethodModel extends BaseModel
|
|
|
31
31
|
* @type {string}
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.id =
|
|
34
|
+
this.id = "";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The Growing Method Code
|
|
@@ -39,7 +39,7 @@ class GrowingMethodModel extends BaseModel
|
|
|
39
39
|
* @type {string}
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.code =
|
|
42
|
+
this.code = "";
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Growing Method Name
|
|
@@ -47,7 +47,7 @@ class GrowingMethodModel extends BaseModel
|
|
|
47
47
|
* @type {string}
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.name =
|
|
50
|
+
this.name = "";
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* The Growing Method Description
|
|
@@ -55,7 +55,7 @@ class GrowingMethodModel extends BaseModel
|
|
|
55
55
|
* @type {string}
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.description =
|
|
58
|
+
this.description = "";
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Whether the Growing Method has been deleted
|
|
@@ -63,7 +63,7 @@ class GrowingMethodModel extends BaseModel
|
|
|
63
63
|
* @type {boolean}
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.deleted =
|
|
66
|
+
this.deleted = false;
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* When the Growing Method was last updated
|
|
@@ -71,7 +71,7 @@ class GrowingMethodModel extends BaseModel
|
|
|
71
71
|
* @type {Date}
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.updateTimestamp =
|
|
74
|
+
this.updateTimestamp = new Date();
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* The Site ID associated with this Growing Method
|
|
@@ -31,7 +31,7 @@ class PackTypeModel extends BaseModel
|
|
|
31
31
|
* @type {string}
|
|
32
32
|
* @public
|
|
33
33
|
*/
|
|
34
|
-
this.id =
|
|
34
|
+
this.id = "";
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* The Code for this Pack Type
|
|
@@ -39,7 +39,7 @@ class PackTypeModel extends BaseModel
|
|
|
39
39
|
* @type {string}
|
|
40
40
|
* @public
|
|
41
41
|
*/
|
|
42
|
-
this.code =
|
|
42
|
+
this.code = "";
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* The Name for this Pack Type
|
|
@@ -47,7 +47,7 @@ class PackTypeModel extends BaseModel
|
|
|
47
47
|
* @type {string}
|
|
48
48
|
* @public
|
|
49
49
|
*/
|
|
50
|
-
this.name =
|
|
50
|
+
this.name = "";
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
53
|
* An Optional Description for this Pack Type
|
|
@@ -55,7 +55,7 @@ class PackTypeModel extends BaseModel
|
|
|
55
55
|
* @type {string}
|
|
56
56
|
* @public
|
|
57
57
|
*/
|
|
58
|
-
this.description =
|
|
58
|
+
this.description = "";
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* The Physical Form of this Pack Type
|
|
@@ -63,7 +63,7 @@ class PackTypeModel extends BaseModel
|
|
|
63
63
|
* @type {string}
|
|
64
64
|
* @public
|
|
65
65
|
*/
|
|
66
|
-
this.form =
|
|
66
|
+
this.form = "";
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* An Array of Fruit Sizes Defined for this Pack Type
|
|
@@ -71,7 +71,7 @@ class PackTypeModel extends BaseModel
|
|
|
71
71
|
* @type {Array<{size: string, count: number}>}
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.fruitSizes =
|
|
74
|
+
this.fruitSizes = [];
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Whether the Pack Type has been deleted
|
|
@@ -79,7 +79,7 @@ class PackTypeModel extends BaseModel
|
|
|
79
79
|
* @type {boolean}
|
|
80
80
|
* @public
|
|
81
81
|
*/
|
|
82
|
-
this.deleted =
|
|
82
|
+
this.deleted = false;
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* When the Pack Type was last updated
|
|
@@ -87,7 +87,7 @@ class PackTypeModel extends BaseModel
|
|
|
87
87
|
* @type {Date}
|
|
88
88
|
* @public
|
|
89
89
|
*/
|
|
90
|
-
this.updateTimestamp =
|
|
90
|
+
this.updateTimestamp = new Date();
|
|
91
91
|
|
|
92
92
|
/**
|
|
93
93
|
* The Site ID associated with this Pack Type
|