@ricado/api-client 2.1.0 → 2.3.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.
- package/README.md +5 -7
- 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 +25 -1
- package/lib/Controllers/Packhouse/Site/PackrunController.js +42 -0
- package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +24 -2
- 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/SoftSortBeltController.js +453 -0
- package/lib/Controllers/Packhouse/Site/index.js +15 -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 +539 -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 +271 -15
- 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 +235 -0
- package/lib/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/lib/Models/Packhouse/Site/index.js +15 -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 +3853 -1290
- 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 +25 -1
- package/src/Controllers/Packhouse/Site/PackrunController.js +52 -0
- package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +24 -2
- 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/SoftSortBeltController.js +474 -0
- package/src/Controllers/Packhouse/Site/index.js +10 -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 +720 -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 +308 -15
- 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 +215 -0
- package/src/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/src/Models/Packhouse/Site/index.js +10 -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,664 @@
|
|
|
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 Shift Quality Summary
|
|
11
|
+
*
|
|
12
|
+
* @class
|
|
13
|
+
* @hideconstructor
|
|
14
|
+
* @extends BaseModel
|
|
15
|
+
*/
|
|
16
|
+
class ShiftQualitySummaryModel extends BaseModel
|
|
17
|
+
{
|
|
18
|
+
/**
|
|
19
|
+
* ShiftQualitySummaryModel Constructor
|
|
20
|
+
*
|
|
21
|
+
* @protected
|
|
22
|
+
* @param {number} siteId The Site ID associated with this Shift Quality Summary
|
|
23
|
+
*/
|
|
24
|
+
constructor(siteId)
|
|
25
|
+
{
|
|
26
|
+
super();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The Shift Quality Summary ID
|
|
30
|
+
*
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
this.id = "";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The Packing Line ID this Quality Summary is associated with
|
|
38
|
+
*
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
this.packingLineId = "";
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The Shift ID this Quality Summary is asssociated with
|
|
46
|
+
*
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
this.shiftId = "";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* When this Quality Summary was Created
|
|
54
|
+
*
|
|
55
|
+
* @type {Date}
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
this.createdTimestamp = new Date();
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* When this Quality Summary was Published
|
|
62
|
+
*
|
|
63
|
+
* @type {?Date}
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
this.publishTimestamp = null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The User ID of the Quality Manager for this Summary
|
|
70
|
+
*
|
|
71
|
+
* @type {?string}
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
this.qualityManagerUserId = null;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The Name of the Quality Manager for this Summary
|
|
78
|
+
*
|
|
79
|
+
* @type {string}
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
this.qualityManagerName = "";
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* An Array of Accuracy Results for this Summary
|
|
86
|
+
*
|
|
87
|
+
* @type {Array<{type: string, value: number}>}
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
this.accuracyResults = [];
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* An Array of Audit Results for this Summary
|
|
94
|
+
*
|
|
95
|
+
* @type {Array<{type: string, value: number}>}
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
this.auditResults = [];
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* An Array of Packrun Results for this Summary
|
|
102
|
+
*
|
|
103
|
+
* @type {Array<{packrunId: string, packrunName: string, minorPackingDefects: number, majorPackingDefects: number, softs: number, cuts: number, rots: number, softsLineAverageSampleSize: ?number, softsLineAverageValue: ?number, exportFruitInClass2: ?number, exportFruitInLocalMarket: ?number, exportFruitInWaste: ?number}>}
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
this.packrunResults = [];
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* An Optional Rating between 1 and 10 on how Satisfied the Quality Manager was with this Shift
|
|
110
|
+
*
|
|
111
|
+
* @type {?number}
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
this.satisfactionRating = null;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The Status of this Quality Summary
|
|
118
|
+
*
|
|
119
|
+
* @type {string}
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
122
|
+
this.status = "";
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Whether the Shift Quality Summary has been deleted
|
|
126
|
+
*
|
|
127
|
+
* @type {boolean}
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
this.deleted = false;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* When the Shift Quality Summary was last updated
|
|
134
|
+
*
|
|
135
|
+
* @type {Date}
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
this.updateTimestamp = new Date();
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* The Site ID associated with this Shift Quality Summary
|
|
142
|
+
*
|
|
143
|
+
* @type {number}
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
this.siteId = siteId;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Create a new **ShiftQualitySummaryModel** from a JSON Object or JSON String
|
|
151
|
+
*
|
|
152
|
+
* @static
|
|
153
|
+
* @public
|
|
154
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
155
|
+
* @param {number} siteId The Site ID associated with this Shift Quality Summary
|
|
156
|
+
* @return {ShiftQualitySummaryModel}
|
|
157
|
+
*/
|
|
158
|
+
static fromJSON(json, siteId)
|
|
159
|
+
{
|
|
160
|
+
let model = new ShiftQualitySummaryModel(siteId);
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The JSON Object
|
|
164
|
+
*
|
|
165
|
+
* @type {Object<string, any>}
|
|
166
|
+
*/
|
|
167
|
+
let jsonObject = {};
|
|
168
|
+
|
|
169
|
+
if(typeof json === 'string')
|
|
170
|
+
{
|
|
171
|
+
jsonObject = JSON.parse(json);
|
|
172
|
+
}
|
|
173
|
+
else if(typeof json === 'object')
|
|
174
|
+
{
|
|
175
|
+
jsonObject = json;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if('id' in jsonObject)
|
|
179
|
+
{
|
|
180
|
+
model.id = (function(){
|
|
181
|
+
if(typeof jsonObject['id'] !== 'string')
|
|
182
|
+
{
|
|
183
|
+
return String(jsonObject['id']);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return jsonObject['id'];
|
|
187
|
+
}());
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
if('packingLineId' in jsonObject)
|
|
191
|
+
{
|
|
192
|
+
model.packingLineId = (function(){
|
|
193
|
+
if(typeof jsonObject['packingLineId'] !== 'string')
|
|
194
|
+
{
|
|
195
|
+
return String(jsonObject['packingLineId']);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
return jsonObject['packingLineId'];
|
|
199
|
+
}());
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
if('shiftId' in jsonObject)
|
|
203
|
+
{
|
|
204
|
+
model.shiftId = (function(){
|
|
205
|
+
if(typeof jsonObject['shiftId'] !== 'string')
|
|
206
|
+
{
|
|
207
|
+
return String(jsonObject['shiftId']);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
return jsonObject['shiftId'];
|
|
211
|
+
}());
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if('createdTimestamp' in jsonObject)
|
|
215
|
+
{
|
|
216
|
+
model.createdTimestamp = (function(){
|
|
217
|
+
if(typeof jsonObject['createdTimestamp'] !== 'string')
|
|
218
|
+
{
|
|
219
|
+
return new Date(String(jsonObject['createdTimestamp']));
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return new Date(jsonObject['createdTimestamp']);
|
|
223
|
+
}());
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if('publishTimestamp' in jsonObject)
|
|
227
|
+
{
|
|
228
|
+
model.publishTimestamp = (function(){
|
|
229
|
+
if(jsonObject['publishTimestamp'] === null)
|
|
230
|
+
{
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
if(typeof jsonObject['publishTimestamp'] !== 'string')
|
|
235
|
+
{
|
|
236
|
+
return new Date(String(jsonObject['publishTimestamp']));
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return new Date(jsonObject['publishTimestamp']);
|
|
240
|
+
}());
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if('qualityManagerUserId' in jsonObject)
|
|
244
|
+
{
|
|
245
|
+
model.qualityManagerUserId = (function(){
|
|
246
|
+
if(jsonObject['qualityManagerUserId'] === null)
|
|
247
|
+
{
|
|
248
|
+
return null;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if(typeof jsonObject['qualityManagerUserId'] !== 'string')
|
|
252
|
+
{
|
|
253
|
+
return String(jsonObject['qualityManagerUserId']);
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
return jsonObject['qualityManagerUserId'];
|
|
257
|
+
}());
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if('qualityManagerName' in jsonObject)
|
|
261
|
+
{
|
|
262
|
+
model.qualityManagerName = (function(){
|
|
263
|
+
if(typeof jsonObject['qualityManagerName'] !== 'string')
|
|
264
|
+
{
|
|
265
|
+
return String(jsonObject['qualityManagerName']);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
return jsonObject['qualityManagerName'];
|
|
269
|
+
}());
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
if('accuracyResults' in jsonObject)
|
|
273
|
+
{
|
|
274
|
+
model.accuracyResults = (function(){
|
|
275
|
+
if(Array.isArray(jsonObject['accuracyResults']) !== true)
|
|
276
|
+
{
|
|
277
|
+
return [];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return jsonObject['accuracyResults'].map((accuracyResultsItem) => {
|
|
281
|
+
return (function(){
|
|
282
|
+
let accuracyResultsItemObject = {};
|
|
283
|
+
|
|
284
|
+
if(typeof accuracyResultsItem === 'object' && 'type' in accuracyResultsItem)
|
|
285
|
+
{
|
|
286
|
+
accuracyResultsItemObject.type = (function(){
|
|
287
|
+
if(typeof accuracyResultsItem.type !== 'string')
|
|
288
|
+
{
|
|
289
|
+
return String(accuracyResultsItem.type);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
return accuracyResultsItem.type;
|
|
293
|
+
}());
|
|
294
|
+
}
|
|
295
|
+
else
|
|
296
|
+
{
|
|
297
|
+
accuracyResultsItemObject.type = "";
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if(typeof accuracyResultsItem === 'object' && 'value' in accuracyResultsItem)
|
|
301
|
+
{
|
|
302
|
+
accuracyResultsItemObject.value = (function(){
|
|
303
|
+
if(typeof accuracyResultsItem.value !== 'number')
|
|
304
|
+
{
|
|
305
|
+
return Number(accuracyResultsItem.value);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
return accuracyResultsItem.value;
|
|
309
|
+
}());
|
|
310
|
+
}
|
|
311
|
+
else
|
|
312
|
+
{
|
|
313
|
+
accuracyResultsItemObject.value = 0;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
return accuracyResultsItemObject;
|
|
317
|
+
}());
|
|
318
|
+
});
|
|
319
|
+
}());
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
if('auditResults' in jsonObject)
|
|
323
|
+
{
|
|
324
|
+
model.auditResults = (function(){
|
|
325
|
+
if(Array.isArray(jsonObject['auditResults']) !== true)
|
|
326
|
+
{
|
|
327
|
+
return [];
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
return jsonObject['auditResults'].map((auditResultsItem) => {
|
|
331
|
+
return (function(){
|
|
332
|
+
let auditResultsItemObject = {};
|
|
333
|
+
|
|
334
|
+
if(typeof auditResultsItem === 'object' && 'type' in auditResultsItem)
|
|
335
|
+
{
|
|
336
|
+
auditResultsItemObject.type = (function(){
|
|
337
|
+
if(typeof auditResultsItem.type !== 'string')
|
|
338
|
+
{
|
|
339
|
+
return String(auditResultsItem.type);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return auditResultsItem.type;
|
|
343
|
+
}());
|
|
344
|
+
}
|
|
345
|
+
else
|
|
346
|
+
{
|
|
347
|
+
auditResultsItemObject.type = "";
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
if(typeof auditResultsItem === 'object' && 'value' in auditResultsItem)
|
|
351
|
+
{
|
|
352
|
+
auditResultsItemObject.value = (function(){
|
|
353
|
+
if(typeof auditResultsItem.value !== 'number')
|
|
354
|
+
{
|
|
355
|
+
return Number(auditResultsItem.value);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
return auditResultsItem.value;
|
|
359
|
+
}());
|
|
360
|
+
}
|
|
361
|
+
else
|
|
362
|
+
{
|
|
363
|
+
auditResultsItemObject.value = 0;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return auditResultsItemObject;
|
|
367
|
+
}());
|
|
368
|
+
});
|
|
369
|
+
}());
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if('packrunResults' in jsonObject)
|
|
373
|
+
{
|
|
374
|
+
model.packrunResults = (function(){
|
|
375
|
+
if(Array.isArray(jsonObject['packrunResults']) !== true)
|
|
376
|
+
{
|
|
377
|
+
return [];
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
return jsonObject['packrunResults'].map((packrunResultsItem) => {
|
|
381
|
+
return (function(){
|
|
382
|
+
let packrunResultsItemObject = {};
|
|
383
|
+
|
|
384
|
+
if(typeof packrunResultsItem === 'object' && 'packrunId' in packrunResultsItem)
|
|
385
|
+
{
|
|
386
|
+
packrunResultsItemObject.packrunId = (function(){
|
|
387
|
+
if(typeof packrunResultsItem.packrunId !== 'string')
|
|
388
|
+
{
|
|
389
|
+
return String(packrunResultsItem.packrunId);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
return packrunResultsItem.packrunId;
|
|
393
|
+
}());
|
|
394
|
+
}
|
|
395
|
+
else
|
|
396
|
+
{
|
|
397
|
+
packrunResultsItemObject.packrunId = "";
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
if(typeof packrunResultsItem === 'object' && 'packrunName' in packrunResultsItem)
|
|
401
|
+
{
|
|
402
|
+
packrunResultsItemObject.packrunName = (function(){
|
|
403
|
+
if(typeof packrunResultsItem.packrunName !== 'string')
|
|
404
|
+
{
|
|
405
|
+
return String(packrunResultsItem.packrunName);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
return packrunResultsItem.packrunName;
|
|
409
|
+
}());
|
|
410
|
+
}
|
|
411
|
+
else
|
|
412
|
+
{
|
|
413
|
+
packrunResultsItemObject.packrunName = "";
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
if(typeof packrunResultsItem === 'object' && 'minorPackingDefects' in packrunResultsItem)
|
|
417
|
+
{
|
|
418
|
+
packrunResultsItemObject.minorPackingDefects = (function(){
|
|
419
|
+
if(typeof packrunResultsItem.minorPackingDefects !== 'number')
|
|
420
|
+
{
|
|
421
|
+
return Number(packrunResultsItem.minorPackingDefects);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
return packrunResultsItem.minorPackingDefects;
|
|
425
|
+
}());
|
|
426
|
+
}
|
|
427
|
+
else
|
|
428
|
+
{
|
|
429
|
+
packrunResultsItemObject.minorPackingDefects = 0;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
if(typeof packrunResultsItem === 'object' && 'majorPackingDefects' in packrunResultsItem)
|
|
433
|
+
{
|
|
434
|
+
packrunResultsItemObject.majorPackingDefects = (function(){
|
|
435
|
+
if(typeof packrunResultsItem.majorPackingDefects !== 'number')
|
|
436
|
+
{
|
|
437
|
+
return Number(packrunResultsItem.majorPackingDefects);
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
return packrunResultsItem.majorPackingDefects;
|
|
441
|
+
}());
|
|
442
|
+
}
|
|
443
|
+
else
|
|
444
|
+
{
|
|
445
|
+
packrunResultsItemObject.majorPackingDefects = 0;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
if(typeof packrunResultsItem === 'object' && 'softs' in packrunResultsItem)
|
|
449
|
+
{
|
|
450
|
+
packrunResultsItemObject.softs = (function(){
|
|
451
|
+
if(typeof packrunResultsItem.softs !== 'number')
|
|
452
|
+
{
|
|
453
|
+
return Number(packrunResultsItem.softs);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
return packrunResultsItem.softs;
|
|
457
|
+
}());
|
|
458
|
+
}
|
|
459
|
+
else
|
|
460
|
+
{
|
|
461
|
+
packrunResultsItemObject.softs = 0;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
if(typeof packrunResultsItem === 'object' && 'cuts' in packrunResultsItem)
|
|
465
|
+
{
|
|
466
|
+
packrunResultsItemObject.cuts = (function(){
|
|
467
|
+
if(typeof packrunResultsItem.cuts !== 'number')
|
|
468
|
+
{
|
|
469
|
+
return Number(packrunResultsItem.cuts);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
return packrunResultsItem.cuts;
|
|
473
|
+
}());
|
|
474
|
+
}
|
|
475
|
+
else
|
|
476
|
+
{
|
|
477
|
+
packrunResultsItemObject.cuts = 0;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
if(typeof packrunResultsItem === 'object' && 'rots' in packrunResultsItem)
|
|
481
|
+
{
|
|
482
|
+
packrunResultsItemObject.rots = (function(){
|
|
483
|
+
if(typeof packrunResultsItem.rots !== 'number')
|
|
484
|
+
{
|
|
485
|
+
return Number(packrunResultsItem.rots);
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
return packrunResultsItem.rots;
|
|
489
|
+
}());
|
|
490
|
+
}
|
|
491
|
+
else
|
|
492
|
+
{
|
|
493
|
+
packrunResultsItemObject.rots = 0;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
if(typeof packrunResultsItem === 'object' && 'softsLineAverageSampleSize' in packrunResultsItem)
|
|
497
|
+
{
|
|
498
|
+
packrunResultsItemObject.softsLineAverageSampleSize = (function(){
|
|
499
|
+
if(packrunResultsItem.softsLineAverageSampleSize === null)
|
|
500
|
+
{
|
|
501
|
+
return null;
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
if(typeof packrunResultsItem.softsLineAverageSampleSize !== 'number')
|
|
505
|
+
{
|
|
506
|
+
return Number.isInteger(Number(packrunResultsItem.softsLineAverageSampleSize)) ? Number(packrunResultsItem.softsLineAverageSampleSize) : Math.floor(Number(packrunResultsItem.softsLineAverageSampleSize));
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
return Number.isInteger(packrunResultsItem.softsLineAverageSampleSize) ? packrunResultsItem.softsLineAverageSampleSize : Math.floor(packrunResultsItem.softsLineAverageSampleSize);
|
|
510
|
+
}());
|
|
511
|
+
}
|
|
512
|
+
else
|
|
513
|
+
{
|
|
514
|
+
packrunResultsItemObject.softsLineAverageSampleSize = null;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if(typeof packrunResultsItem === 'object' && 'softsLineAverageValue' in packrunResultsItem)
|
|
518
|
+
{
|
|
519
|
+
packrunResultsItemObject.softsLineAverageValue = (function(){
|
|
520
|
+
if(packrunResultsItem.softsLineAverageValue === null)
|
|
521
|
+
{
|
|
522
|
+
return null;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
if(typeof packrunResultsItem.softsLineAverageValue !== 'number')
|
|
526
|
+
{
|
|
527
|
+
return Number(packrunResultsItem.softsLineAverageValue);
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
return packrunResultsItem.softsLineAverageValue;
|
|
531
|
+
}());
|
|
532
|
+
}
|
|
533
|
+
else
|
|
534
|
+
{
|
|
535
|
+
packrunResultsItemObject.softsLineAverageValue = null;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
if(typeof packrunResultsItem === 'object' && 'exportFruitInClass2' in packrunResultsItem)
|
|
539
|
+
{
|
|
540
|
+
packrunResultsItemObject.exportFruitInClass2 = (function(){
|
|
541
|
+
if(packrunResultsItem.exportFruitInClass2 === null)
|
|
542
|
+
{
|
|
543
|
+
return null;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
if(typeof packrunResultsItem.exportFruitInClass2 !== 'number')
|
|
547
|
+
{
|
|
548
|
+
return Number(packrunResultsItem.exportFruitInClass2);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
return packrunResultsItem.exportFruitInClass2;
|
|
552
|
+
}());
|
|
553
|
+
}
|
|
554
|
+
else
|
|
555
|
+
{
|
|
556
|
+
packrunResultsItemObject.exportFruitInClass2 = null;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
if(typeof packrunResultsItem === 'object' && 'exportFruitInLocalMarket' in packrunResultsItem)
|
|
560
|
+
{
|
|
561
|
+
packrunResultsItemObject.exportFruitInLocalMarket = (function(){
|
|
562
|
+
if(packrunResultsItem.exportFruitInLocalMarket === null)
|
|
563
|
+
{
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
if(typeof packrunResultsItem.exportFruitInLocalMarket !== 'number')
|
|
568
|
+
{
|
|
569
|
+
return Number(packrunResultsItem.exportFruitInLocalMarket);
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
return packrunResultsItem.exportFruitInLocalMarket;
|
|
573
|
+
}());
|
|
574
|
+
}
|
|
575
|
+
else
|
|
576
|
+
{
|
|
577
|
+
packrunResultsItemObject.exportFruitInLocalMarket = null;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
if(typeof packrunResultsItem === 'object' && 'exportFruitInWaste' in packrunResultsItem)
|
|
581
|
+
{
|
|
582
|
+
packrunResultsItemObject.exportFruitInWaste = (function(){
|
|
583
|
+
if(packrunResultsItem.exportFruitInWaste === null)
|
|
584
|
+
{
|
|
585
|
+
return null;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
if(typeof packrunResultsItem.exportFruitInWaste !== 'number')
|
|
589
|
+
{
|
|
590
|
+
return Number(packrunResultsItem.exportFruitInWaste);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
return packrunResultsItem.exportFruitInWaste;
|
|
594
|
+
}());
|
|
595
|
+
}
|
|
596
|
+
else
|
|
597
|
+
{
|
|
598
|
+
packrunResultsItemObject.exportFruitInWaste = null;
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
return packrunResultsItemObject;
|
|
602
|
+
}());
|
|
603
|
+
});
|
|
604
|
+
}());
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
if('satisfactionRating' in jsonObject)
|
|
608
|
+
{
|
|
609
|
+
model.satisfactionRating = (function(){
|
|
610
|
+
if(jsonObject['satisfactionRating'] === null)
|
|
611
|
+
{
|
|
612
|
+
return null;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
if(typeof jsonObject['satisfactionRating'] !== 'number')
|
|
616
|
+
{
|
|
617
|
+
return Number.isInteger(Number(jsonObject['satisfactionRating'])) ? Number(jsonObject['satisfactionRating']) : Math.floor(Number(jsonObject['satisfactionRating']));
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
return Number.isInteger(jsonObject['satisfactionRating']) ? jsonObject['satisfactionRating'] : Math.floor(jsonObject['satisfactionRating']);
|
|
621
|
+
}());
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
if('status' in jsonObject)
|
|
625
|
+
{
|
|
626
|
+
model.status = (function(){
|
|
627
|
+
if(typeof jsonObject['status'] !== 'string')
|
|
628
|
+
{
|
|
629
|
+
return String(jsonObject['status']);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
return jsonObject['status'];
|
|
633
|
+
}());
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
if('deleted' in jsonObject)
|
|
637
|
+
{
|
|
638
|
+
model.deleted = (function(){
|
|
639
|
+
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
640
|
+
{
|
|
641
|
+
return Boolean(jsonObject['deleted']);
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
return jsonObject['deleted'];
|
|
645
|
+
}());
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if('updateTimestamp' in jsonObject)
|
|
649
|
+
{
|
|
650
|
+
model.updateTimestamp = (function(){
|
|
651
|
+
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
652
|
+
{
|
|
653
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
657
|
+
}());
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
return model;
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
export default ShiftQualitySummaryModel;
|