@ricado/api-client 2.6.0 → 2.7.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/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +2 -1
- package/lib/Controllers/Packhouse/Site/ReemoonSizerBatchController.js +915 -0
- package/lib/Controllers/Packhouse/Site/ReemoonSizerController.js +300 -0
- package/lib/Controllers/Packhouse/Site/ReemoonSizerOutletProductChangeController.js +885 -0
- package/lib/Controllers/Packhouse/Site/ReemoonSizerPackrunSummaryController.js +914 -0
- package/lib/Controllers/Packhouse/Site/index.js +12 -0
- package/lib/Models/Packhouse/Site/PackingLineModel.js +38 -1
- package/lib/Models/Packhouse/Site/ReemoonSizerBatchModel.js +547 -0
- package/lib/Models/Packhouse/Site/ReemoonSizerModel.js +1272 -0
- package/lib/Models/Packhouse/Site/ReemoonSizerOutletProductChangeModel.js +293 -0
- package/lib/Models/Packhouse/Site/ReemoonSizerPackrunSummaryModel.js +461 -0
- package/lib/Models/Packhouse/Site/index.js +12 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +7128 -5158
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/PackingLineController.js +2 -1
- package/src/Controllers/Packhouse/Site/ReemoonSizerBatchController.js +1046 -0
- package/src/Controllers/Packhouse/Site/ReemoonSizerController.js +277 -0
- package/src/Controllers/Packhouse/Site/ReemoonSizerOutletProductChangeController.js +1016 -0
- package/src/Controllers/Packhouse/Site/ReemoonSizerPackrunSummaryController.js +1045 -0
- package/src/Controllers/Packhouse/Site/index.js +8 -0
- package/src/Models/Packhouse/Site/PackingLineModel.js +49 -1
- package/src/Models/Packhouse/Site/ReemoonSizerBatchModel.js +596 -0
- package/src/Models/Packhouse/Site/ReemoonSizerModel.js +1576 -0
- package/src/Models/Packhouse/Site/ReemoonSizerOutletProductChangeModel.js +280 -0
- package/src/Models/Packhouse/Site/ReemoonSizerPackrunSummaryModel.js +501 -0
- package/src/Models/Packhouse/Site/index.js +8 -0
- package/src/PackageVersion.js +1 -1
|
@@ -0,0 +1,1576 @@
|
|
|
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 Reemoon Sizer
|
|
11
|
+
*
|
|
12
|
+
* @class
|
|
13
|
+
* @hideconstructor
|
|
14
|
+
* @extends BaseModel
|
|
15
|
+
*/
|
|
16
|
+
class ReemoonSizerModel extends BaseModel
|
|
17
|
+
{
|
|
18
|
+
/**
|
|
19
|
+
* ReemoonSizerModel Constructor
|
|
20
|
+
*
|
|
21
|
+
* @protected
|
|
22
|
+
* @param {number} siteId The Site ID associated with this Reemoon Sizer
|
|
23
|
+
*/
|
|
24
|
+
constructor(siteId)
|
|
25
|
+
{
|
|
26
|
+
super();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The Reemoon Sizer ID
|
|
30
|
+
*
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
this.id = "";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The RTU this Reemoon Sizer belongs to
|
|
38
|
+
*
|
|
39
|
+
* @type {?number}
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
this.rtuId = null;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The Reemoon Sizer Name
|
|
46
|
+
*
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
this.name = "";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The Packing Line ID that manages this Reemoon Sizer
|
|
54
|
+
*
|
|
55
|
+
* @type {string}
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
this.packingLineId = "";
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The Sizer Type
|
|
62
|
+
*
|
|
63
|
+
* @type {string}
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
this.sizerType = "";
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The Auto Create Batch Delay in Seconds for this Reemoon Sizer
|
|
70
|
+
*
|
|
71
|
+
* @type {number}
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
this.autoCreateBatchDelay = 0;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The Points used by this Reemoon Sizer
|
|
78
|
+
*
|
|
79
|
+
* @type {{currentBatchId: number, currentBatchName: number, currentBatchVarietyCode: number, currentBatchStartTimestamp: number, currentBatchPackrunId: number, currentBatchPackrunName: number, machineAverageFruitWeight: number, machineAverageFruitSize: number, machineCupFill: number, machineIncomingFruitPerMinute: number, machineRecycledFruitPerMinute: number, machineTraysPerHour: number, machineTonnesPerHour: number, machineRodsPerMinute: number, machineIncomingFruitPerMinuteBySize: ?number, machineRecycledFruitPerMinuteBySize: ?number, machineLanesFruitPerMinuteBySize: ?number, createNewBatchRequest: number, createBatchOnPackrunChange: number, createBatchOnTimeBatchChange: number, outletGroupSummaries: number, products: number, packTypeOutletUtilizationTargets: number, class1TraysPerHour: ?number}}
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
this.points = (function(){
|
|
83
|
+
let pointsDefaultValue = {};
|
|
84
|
+
|
|
85
|
+
pointsDefaultValue.currentBatchId = 0;
|
|
86
|
+
|
|
87
|
+
pointsDefaultValue.currentBatchName = 0;
|
|
88
|
+
|
|
89
|
+
pointsDefaultValue.currentBatchVarietyCode = 0;
|
|
90
|
+
|
|
91
|
+
pointsDefaultValue.currentBatchStartTimestamp = 0;
|
|
92
|
+
|
|
93
|
+
pointsDefaultValue.currentBatchPackrunId = 0;
|
|
94
|
+
|
|
95
|
+
pointsDefaultValue.currentBatchPackrunName = 0;
|
|
96
|
+
|
|
97
|
+
pointsDefaultValue.machineAverageFruitWeight = 0;
|
|
98
|
+
|
|
99
|
+
pointsDefaultValue.machineAverageFruitSize = 0;
|
|
100
|
+
|
|
101
|
+
pointsDefaultValue.machineCupFill = 0;
|
|
102
|
+
|
|
103
|
+
pointsDefaultValue.machineIncomingFruitPerMinute = 0;
|
|
104
|
+
|
|
105
|
+
pointsDefaultValue.machineRecycledFruitPerMinute = 0;
|
|
106
|
+
|
|
107
|
+
pointsDefaultValue.machineTraysPerHour = 0;
|
|
108
|
+
|
|
109
|
+
pointsDefaultValue.machineTonnesPerHour = 0;
|
|
110
|
+
|
|
111
|
+
pointsDefaultValue.machineRodsPerMinute = 0;
|
|
112
|
+
|
|
113
|
+
pointsDefaultValue.machineIncomingFruitPerMinuteBySize = null;
|
|
114
|
+
|
|
115
|
+
pointsDefaultValue.machineRecycledFruitPerMinuteBySize = null;
|
|
116
|
+
|
|
117
|
+
pointsDefaultValue.machineLanesFruitPerMinuteBySize = null;
|
|
118
|
+
|
|
119
|
+
pointsDefaultValue.createNewBatchRequest = 0;
|
|
120
|
+
|
|
121
|
+
pointsDefaultValue.createBatchOnPackrunChange = 0;
|
|
122
|
+
|
|
123
|
+
pointsDefaultValue.createBatchOnTimeBatchChange = 0;
|
|
124
|
+
|
|
125
|
+
pointsDefaultValue.outletGroupSummaries = 0;
|
|
126
|
+
|
|
127
|
+
pointsDefaultValue.products = 0;
|
|
128
|
+
|
|
129
|
+
pointsDefaultValue.packTypeOutletUtilizationTargets = 0;
|
|
130
|
+
|
|
131
|
+
pointsDefaultValue.class1TraysPerHour = null;
|
|
132
|
+
|
|
133
|
+
return pointsDefaultValue;
|
|
134
|
+
}());
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* The Lanes defined for this Reemoon Sizer
|
|
138
|
+
*
|
|
139
|
+
* @type {Array<{id: string, number: number, points: {cupFill: number}}>}
|
|
140
|
+
* @public
|
|
141
|
+
*/
|
|
142
|
+
this.lanes = [];
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* The Outlets defined for this Reemoon Sizer
|
|
146
|
+
*
|
|
147
|
+
* @type {Array<{id: string, number: number, type: string, points: {name: number, fruitPerMinute: number, packsPerMinute: number, utilization: number, status: number, productId: number, productName: number}}>}
|
|
148
|
+
* @public
|
|
149
|
+
*/
|
|
150
|
+
this.outlets = [];
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The Fruit Sizes defined and handled by this Reemoon Sizer
|
|
154
|
+
*
|
|
155
|
+
* @type {Array<{fruitSize: string, points: {incomingFruitPerMinute: number, recycledFruitPerMinute: number, allocatedFruitPerMinute: number}}>}
|
|
156
|
+
* @public
|
|
157
|
+
*/
|
|
158
|
+
this.fruitSizes = [];
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* The FreshPack Integration Configuration for this Reemoon Sizer
|
|
162
|
+
*
|
|
163
|
+
* @type {?{points: Object, enabled: boolean, materialGroupId: number, binTypeId: number, bulkWeightClassTypes: string[]}}
|
|
164
|
+
* @public
|
|
165
|
+
*/
|
|
166
|
+
this.freshPackIntegration = null;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* The Reemoon Integration Configuration for this Reemoon Sizer
|
|
170
|
+
*
|
|
171
|
+
* @type {{points: {apiCommunicationStatus: number, machineId: number, machineName: number, machineLaneCount: number, machineOutletCount: number, machineOutletDetails: number}, enabled: boolean, username: string, password: string, apiBaseUrl: string}}
|
|
172
|
+
* @public
|
|
173
|
+
*/
|
|
174
|
+
this.reemoonIntegration = (function(){
|
|
175
|
+
let reemoonIntegrationDefaultValue = {};
|
|
176
|
+
|
|
177
|
+
reemoonIntegrationDefaultValue.points = (function(){
|
|
178
|
+
let pointsDefaultValue = {};
|
|
179
|
+
|
|
180
|
+
pointsDefaultValue.apiCommunicationStatus = 0;
|
|
181
|
+
|
|
182
|
+
pointsDefaultValue.machineId = 0;
|
|
183
|
+
|
|
184
|
+
pointsDefaultValue.machineName = 0;
|
|
185
|
+
|
|
186
|
+
pointsDefaultValue.machineLaneCount = 0;
|
|
187
|
+
|
|
188
|
+
pointsDefaultValue.machineOutletCount = 0;
|
|
189
|
+
|
|
190
|
+
pointsDefaultValue.machineOutletDetails = 0;
|
|
191
|
+
|
|
192
|
+
return pointsDefaultValue;
|
|
193
|
+
}());
|
|
194
|
+
|
|
195
|
+
reemoonIntegrationDefaultValue.enabled = false;
|
|
196
|
+
|
|
197
|
+
reemoonIntegrationDefaultValue.username = "";
|
|
198
|
+
|
|
199
|
+
reemoonIntegrationDefaultValue.password = "";
|
|
200
|
+
|
|
201
|
+
reemoonIntegrationDefaultValue.apiBaseUrl = "";
|
|
202
|
+
|
|
203
|
+
return reemoonIntegrationDefaultValue;
|
|
204
|
+
}());
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* An Array of Sources that deliver Fruit to this Reemoon Sizer
|
|
208
|
+
*
|
|
209
|
+
* @type {Array<{type: string, riserId: string}|{type: string, sizerId: string, outletNumbers: number[]}>}
|
|
210
|
+
* @public
|
|
211
|
+
*/
|
|
212
|
+
this.sources = [];
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* An Array of Product to Class Type Maps for this Reemoon Sizer
|
|
216
|
+
*
|
|
217
|
+
* @type {Array<{productName: string, classType: string, matchType: string}>}
|
|
218
|
+
* @public
|
|
219
|
+
*/
|
|
220
|
+
this.productClassTypes = [];
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Whether the Reemoon Sizer has been deleted
|
|
224
|
+
*
|
|
225
|
+
* @type {boolean}
|
|
226
|
+
* @public
|
|
227
|
+
*/
|
|
228
|
+
this.deleted = false;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* When the Reemoon Sizer was last updated
|
|
232
|
+
*
|
|
233
|
+
* @type {Date}
|
|
234
|
+
* @public
|
|
235
|
+
*/
|
|
236
|
+
this.updateTimestamp = new Date();
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* The Site ID associated with this Reemoon Sizer
|
|
240
|
+
*
|
|
241
|
+
* @type {number}
|
|
242
|
+
* @public
|
|
243
|
+
*/
|
|
244
|
+
this.siteId = siteId;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Create a new **ReemoonSizerModel** from a JSON Object or JSON String
|
|
249
|
+
*
|
|
250
|
+
* @static
|
|
251
|
+
* @public
|
|
252
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
253
|
+
* @param {number} siteId The Site ID associated with this Reemoon Sizer
|
|
254
|
+
* @return {ReemoonSizerModel}
|
|
255
|
+
*/
|
|
256
|
+
static fromJSON(json, siteId)
|
|
257
|
+
{
|
|
258
|
+
let model = new ReemoonSizerModel(siteId);
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* The JSON Object
|
|
262
|
+
*
|
|
263
|
+
* @type {Object<string, any>}
|
|
264
|
+
*/
|
|
265
|
+
let jsonObject = {};
|
|
266
|
+
|
|
267
|
+
if(typeof json === 'string')
|
|
268
|
+
{
|
|
269
|
+
jsonObject = JSON.parse(json);
|
|
270
|
+
}
|
|
271
|
+
else if(typeof json === 'object')
|
|
272
|
+
{
|
|
273
|
+
jsonObject = json;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
if('id' in jsonObject)
|
|
277
|
+
{
|
|
278
|
+
model.id = (function(){
|
|
279
|
+
if(typeof jsonObject['id'] !== 'string')
|
|
280
|
+
{
|
|
281
|
+
return String(jsonObject['id']);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return jsonObject['id'];
|
|
285
|
+
}());
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if('rtuId' in jsonObject)
|
|
289
|
+
{
|
|
290
|
+
model.rtuId = (function(){
|
|
291
|
+
if(jsonObject['rtuId'] === null)
|
|
292
|
+
{
|
|
293
|
+
return null;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if(typeof jsonObject['rtuId'] !== 'number')
|
|
297
|
+
{
|
|
298
|
+
return Number.isInteger(Number(jsonObject['rtuId'])) ? Number(jsonObject['rtuId']) : Math.floor(Number(jsonObject['rtuId']));
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
return Number.isInteger(jsonObject['rtuId']) ? jsonObject['rtuId'] : Math.floor(jsonObject['rtuId']);
|
|
302
|
+
}());
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if('name' in jsonObject)
|
|
306
|
+
{
|
|
307
|
+
model.name = (function(){
|
|
308
|
+
if(typeof jsonObject['name'] !== 'string')
|
|
309
|
+
{
|
|
310
|
+
return String(jsonObject['name']);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return jsonObject['name'];
|
|
314
|
+
}());
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if('packingLineId' in jsonObject)
|
|
318
|
+
{
|
|
319
|
+
model.packingLineId = (function(){
|
|
320
|
+
if(typeof jsonObject['packingLineId'] !== 'string')
|
|
321
|
+
{
|
|
322
|
+
return String(jsonObject['packingLineId']);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
return jsonObject['packingLineId'];
|
|
326
|
+
}());
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
if('sizerType' in jsonObject)
|
|
330
|
+
{
|
|
331
|
+
model.sizerType = (function(){
|
|
332
|
+
if(typeof jsonObject['sizerType'] !== 'string')
|
|
333
|
+
{
|
|
334
|
+
return String(jsonObject['sizerType']);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
return jsonObject['sizerType'];
|
|
338
|
+
}());
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
if('autoCreateBatchDelay' in jsonObject)
|
|
342
|
+
{
|
|
343
|
+
model.autoCreateBatchDelay = (function(){
|
|
344
|
+
if(typeof jsonObject['autoCreateBatchDelay'] !== 'number')
|
|
345
|
+
{
|
|
346
|
+
return Number.isInteger(Number(jsonObject['autoCreateBatchDelay'])) ? Number(jsonObject['autoCreateBatchDelay']) : Math.floor(Number(jsonObject['autoCreateBatchDelay']));
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return Number.isInteger(jsonObject['autoCreateBatchDelay']) ? jsonObject['autoCreateBatchDelay'] : Math.floor(jsonObject['autoCreateBatchDelay']);
|
|
350
|
+
}());
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
if('points' in jsonObject)
|
|
354
|
+
{
|
|
355
|
+
model.points = (function(){
|
|
356
|
+
let pointsObject = {};
|
|
357
|
+
|
|
358
|
+
if(typeof jsonObject['points'] === 'object' && 'currentBatchId' in jsonObject['points'])
|
|
359
|
+
{
|
|
360
|
+
pointsObject.currentBatchId = (function(){
|
|
361
|
+
if(typeof jsonObject['points'].currentBatchId !== 'number')
|
|
362
|
+
{
|
|
363
|
+
return Number.isInteger(Number(jsonObject['points'].currentBatchId)) ? Number(jsonObject['points'].currentBatchId) : Math.floor(Number(jsonObject['points'].currentBatchId));
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return Number.isInteger(jsonObject['points'].currentBatchId) ? jsonObject['points'].currentBatchId : Math.floor(jsonObject['points'].currentBatchId);
|
|
367
|
+
}());
|
|
368
|
+
}
|
|
369
|
+
else
|
|
370
|
+
{
|
|
371
|
+
pointsObject.currentBatchId = 0;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
if(typeof jsonObject['points'] === 'object' && 'currentBatchName' in jsonObject['points'])
|
|
375
|
+
{
|
|
376
|
+
pointsObject.currentBatchName = (function(){
|
|
377
|
+
if(typeof jsonObject['points'].currentBatchName !== 'number')
|
|
378
|
+
{
|
|
379
|
+
return Number.isInteger(Number(jsonObject['points'].currentBatchName)) ? Number(jsonObject['points'].currentBatchName) : Math.floor(Number(jsonObject['points'].currentBatchName));
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return Number.isInteger(jsonObject['points'].currentBatchName) ? jsonObject['points'].currentBatchName : Math.floor(jsonObject['points'].currentBatchName);
|
|
383
|
+
}());
|
|
384
|
+
}
|
|
385
|
+
else
|
|
386
|
+
{
|
|
387
|
+
pointsObject.currentBatchName = 0;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
if(typeof jsonObject['points'] === 'object' && 'currentBatchVarietyCode' in jsonObject['points'])
|
|
391
|
+
{
|
|
392
|
+
pointsObject.currentBatchVarietyCode = (function(){
|
|
393
|
+
if(typeof jsonObject['points'].currentBatchVarietyCode !== 'number')
|
|
394
|
+
{
|
|
395
|
+
return Number.isInteger(Number(jsonObject['points'].currentBatchVarietyCode)) ? Number(jsonObject['points'].currentBatchVarietyCode) : Math.floor(Number(jsonObject['points'].currentBatchVarietyCode));
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
return Number.isInteger(jsonObject['points'].currentBatchVarietyCode) ? jsonObject['points'].currentBatchVarietyCode : Math.floor(jsonObject['points'].currentBatchVarietyCode);
|
|
399
|
+
}());
|
|
400
|
+
}
|
|
401
|
+
else
|
|
402
|
+
{
|
|
403
|
+
pointsObject.currentBatchVarietyCode = 0;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
if(typeof jsonObject['points'] === 'object' && 'currentBatchStartTimestamp' in jsonObject['points'])
|
|
407
|
+
{
|
|
408
|
+
pointsObject.currentBatchStartTimestamp = (function(){
|
|
409
|
+
if(typeof jsonObject['points'].currentBatchStartTimestamp !== 'number')
|
|
410
|
+
{
|
|
411
|
+
return Number.isInteger(Number(jsonObject['points'].currentBatchStartTimestamp)) ? Number(jsonObject['points'].currentBatchStartTimestamp) : Math.floor(Number(jsonObject['points'].currentBatchStartTimestamp));
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
return Number.isInteger(jsonObject['points'].currentBatchStartTimestamp) ? jsonObject['points'].currentBatchStartTimestamp : Math.floor(jsonObject['points'].currentBatchStartTimestamp);
|
|
415
|
+
}());
|
|
416
|
+
}
|
|
417
|
+
else
|
|
418
|
+
{
|
|
419
|
+
pointsObject.currentBatchStartTimestamp = 0;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if(typeof jsonObject['points'] === 'object' && 'currentBatchPackrunId' in jsonObject['points'])
|
|
423
|
+
{
|
|
424
|
+
pointsObject.currentBatchPackrunId = (function(){
|
|
425
|
+
if(typeof jsonObject['points'].currentBatchPackrunId !== 'number')
|
|
426
|
+
{
|
|
427
|
+
return Number.isInteger(Number(jsonObject['points'].currentBatchPackrunId)) ? Number(jsonObject['points'].currentBatchPackrunId) : Math.floor(Number(jsonObject['points'].currentBatchPackrunId));
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return Number.isInteger(jsonObject['points'].currentBatchPackrunId) ? jsonObject['points'].currentBatchPackrunId : Math.floor(jsonObject['points'].currentBatchPackrunId);
|
|
431
|
+
}());
|
|
432
|
+
}
|
|
433
|
+
else
|
|
434
|
+
{
|
|
435
|
+
pointsObject.currentBatchPackrunId = 0;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
if(typeof jsonObject['points'] === 'object' && 'currentBatchPackrunName' in jsonObject['points'])
|
|
439
|
+
{
|
|
440
|
+
pointsObject.currentBatchPackrunName = (function(){
|
|
441
|
+
if(typeof jsonObject['points'].currentBatchPackrunName !== 'number')
|
|
442
|
+
{
|
|
443
|
+
return Number.isInteger(Number(jsonObject['points'].currentBatchPackrunName)) ? Number(jsonObject['points'].currentBatchPackrunName) : Math.floor(Number(jsonObject['points'].currentBatchPackrunName));
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
return Number.isInteger(jsonObject['points'].currentBatchPackrunName) ? jsonObject['points'].currentBatchPackrunName : Math.floor(jsonObject['points'].currentBatchPackrunName);
|
|
447
|
+
}());
|
|
448
|
+
}
|
|
449
|
+
else
|
|
450
|
+
{
|
|
451
|
+
pointsObject.currentBatchPackrunName = 0;
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
if(typeof jsonObject['points'] === 'object' && 'machineAverageFruitWeight' in jsonObject['points'])
|
|
455
|
+
{
|
|
456
|
+
pointsObject.machineAverageFruitWeight = (function(){
|
|
457
|
+
if(typeof jsonObject['points'].machineAverageFruitWeight !== 'number')
|
|
458
|
+
{
|
|
459
|
+
return Number.isInteger(Number(jsonObject['points'].machineAverageFruitWeight)) ? Number(jsonObject['points'].machineAverageFruitWeight) : Math.floor(Number(jsonObject['points'].machineAverageFruitWeight));
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return Number.isInteger(jsonObject['points'].machineAverageFruitWeight) ? jsonObject['points'].machineAverageFruitWeight : Math.floor(jsonObject['points'].machineAverageFruitWeight);
|
|
463
|
+
}());
|
|
464
|
+
}
|
|
465
|
+
else
|
|
466
|
+
{
|
|
467
|
+
pointsObject.machineAverageFruitWeight = 0;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
if(typeof jsonObject['points'] === 'object' && 'machineAverageFruitSize' in jsonObject['points'])
|
|
471
|
+
{
|
|
472
|
+
pointsObject.machineAverageFruitSize = (function(){
|
|
473
|
+
if(typeof jsonObject['points'].machineAverageFruitSize !== 'number')
|
|
474
|
+
{
|
|
475
|
+
return Number.isInteger(Number(jsonObject['points'].machineAverageFruitSize)) ? Number(jsonObject['points'].machineAverageFruitSize) : Math.floor(Number(jsonObject['points'].machineAverageFruitSize));
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
return Number.isInteger(jsonObject['points'].machineAverageFruitSize) ? jsonObject['points'].machineAverageFruitSize : Math.floor(jsonObject['points'].machineAverageFruitSize);
|
|
479
|
+
}());
|
|
480
|
+
}
|
|
481
|
+
else
|
|
482
|
+
{
|
|
483
|
+
pointsObject.machineAverageFruitSize = 0;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
if(typeof jsonObject['points'] === 'object' && 'machineCupFill' in jsonObject['points'])
|
|
487
|
+
{
|
|
488
|
+
pointsObject.machineCupFill = (function(){
|
|
489
|
+
if(typeof jsonObject['points'].machineCupFill !== 'number')
|
|
490
|
+
{
|
|
491
|
+
return Number.isInteger(Number(jsonObject['points'].machineCupFill)) ? Number(jsonObject['points'].machineCupFill) : Math.floor(Number(jsonObject['points'].machineCupFill));
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
return Number.isInteger(jsonObject['points'].machineCupFill) ? jsonObject['points'].machineCupFill : Math.floor(jsonObject['points'].machineCupFill);
|
|
495
|
+
}());
|
|
496
|
+
}
|
|
497
|
+
else
|
|
498
|
+
{
|
|
499
|
+
pointsObject.machineCupFill = 0;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
if(typeof jsonObject['points'] === 'object' && 'machineIncomingFruitPerMinute' in jsonObject['points'])
|
|
503
|
+
{
|
|
504
|
+
pointsObject.machineIncomingFruitPerMinute = (function(){
|
|
505
|
+
if(typeof jsonObject['points'].machineIncomingFruitPerMinute !== 'number')
|
|
506
|
+
{
|
|
507
|
+
return Number.isInteger(Number(jsonObject['points'].machineIncomingFruitPerMinute)) ? Number(jsonObject['points'].machineIncomingFruitPerMinute) : Math.floor(Number(jsonObject['points'].machineIncomingFruitPerMinute));
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
return Number.isInteger(jsonObject['points'].machineIncomingFruitPerMinute) ? jsonObject['points'].machineIncomingFruitPerMinute : Math.floor(jsonObject['points'].machineIncomingFruitPerMinute);
|
|
511
|
+
}());
|
|
512
|
+
}
|
|
513
|
+
else
|
|
514
|
+
{
|
|
515
|
+
pointsObject.machineIncomingFruitPerMinute = 0;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
if(typeof jsonObject['points'] === 'object' && 'machineRecycledFruitPerMinute' in jsonObject['points'])
|
|
519
|
+
{
|
|
520
|
+
pointsObject.machineRecycledFruitPerMinute = (function(){
|
|
521
|
+
if(typeof jsonObject['points'].machineRecycledFruitPerMinute !== 'number')
|
|
522
|
+
{
|
|
523
|
+
return Number.isInteger(Number(jsonObject['points'].machineRecycledFruitPerMinute)) ? Number(jsonObject['points'].machineRecycledFruitPerMinute) : Math.floor(Number(jsonObject['points'].machineRecycledFruitPerMinute));
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
return Number.isInteger(jsonObject['points'].machineRecycledFruitPerMinute) ? jsonObject['points'].machineRecycledFruitPerMinute : Math.floor(jsonObject['points'].machineRecycledFruitPerMinute);
|
|
527
|
+
}());
|
|
528
|
+
}
|
|
529
|
+
else
|
|
530
|
+
{
|
|
531
|
+
pointsObject.machineRecycledFruitPerMinute = 0;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
if(typeof jsonObject['points'] === 'object' && 'machineTraysPerHour' in jsonObject['points'])
|
|
535
|
+
{
|
|
536
|
+
pointsObject.machineTraysPerHour = (function(){
|
|
537
|
+
if(typeof jsonObject['points'].machineTraysPerHour !== 'number')
|
|
538
|
+
{
|
|
539
|
+
return Number.isInteger(Number(jsonObject['points'].machineTraysPerHour)) ? Number(jsonObject['points'].machineTraysPerHour) : Math.floor(Number(jsonObject['points'].machineTraysPerHour));
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
return Number.isInteger(jsonObject['points'].machineTraysPerHour) ? jsonObject['points'].machineTraysPerHour : Math.floor(jsonObject['points'].machineTraysPerHour);
|
|
543
|
+
}());
|
|
544
|
+
}
|
|
545
|
+
else
|
|
546
|
+
{
|
|
547
|
+
pointsObject.machineTraysPerHour = 0;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
if(typeof jsonObject['points'] === 'object' && 'machineTonnesPerHour' in jsonObject['points'])
|
|
551
|
+
{
|
|
552
|
+
pointsObject.machineTonnesPerHour = (function(){
|
|
553
|
+
if(typeof jsonObject['points'].machineTonnesPerHour !== 'number')
|
|
554
|
+
{
|
|
555
|
+
return Number.isInteger(Number(jsonObject['points'].machineTonnesPerHour)) ? Number(jsonObject['points'].machineTonnesPerHour) : Math.floor(Number(jsonObject['points'].machineTonnesPerHour));
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
return Number.isInteger(jsonObject['points'].machineTonnesPerHour) ? jsonObject['points'].machineTonnesPerHour : Math.floor(jsonObject['points'].machineTonnesPerHour);
|
|
559
|
+
}());
|
|
560
|
+
}
|
|
561
|
+
else
|
|
562
|
+
{
|
|
563
|
+
pointsObject.machineTonnesPerHour = 0;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
if(typeof jsonObject['points'] === 'object' && 'machineRodsPerMinute' in jsonObject['points'])
|
|
567
|
+
{
|
|
568
|
+
pointsObject.machineRodsPerMinute = (function(){
|
|
569
|
+
if(typeof jsonObject['points'].machineRodsPerMinute !== 'number')
|
|
570
|
+
{
|
|
571
|
+
return Number.isInteger(Number(jsonObject['points'].machineRodsPerMinute)) ? Number(jsonObject['points'].machineRodsPerMinute) : Math.floor(Number(jsonObject['points'].machineRodsPerMinute));
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
return Number.isInteger(jsonObject['points'].machineRodsPerMinute) ? jsonObject['points'].machineRodsPerMinute : Math.floor(jsonObject['points'].machineRodsPerMinute);
|
|
575
|
+
}());
|
|
576
|
+
}
|
|
577
|
+
else
|
|
578
|
+
{
|
|
579
|
+
pointsObject.machineRodsPerMinute = 0;
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
if(typeof jsonObject['points'] === 'object' && 'machineIncomingFruitPerMinuteBySize' in jsonObject['points'])
|
|
583
|
+
{
|
|
584
|
+
pointsObject.machineIncomingFruitPerMinuteBySize = (function(){
|
|
585
|
+
if(jsonObject['points'].machineIncomingFruitPerMinuteBySize === null)
|
|
586
|
+
{
|
|
587
|
+
return null;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
if(typeof jsonObject['points'].machineIncomingFruitPerMinuteBySize !== 'number')
|
|
591
|
+
{
|
|
592
|
+
return Number.isInteger(Number(jsonObject['points'].machineIncomingFruitPerMinuteBySize)) ? Number(jsonObject['points'].machineIncomingFruitPerMinuteBySize) : Math.floor(Number(jsonObject['points'].machineIncomingFruitPerMinuteBySize));
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
return Number.isInteger(jsonObject['points'].machineIncomingFruitPerMinuteBySize) ? jsonObject['points'].machineIncomingFruitPerMinuteBySize : Math.floor(jsonObject['points'].machineIncomingFruitPerMinuteBySize);
|
|
596
|
+
}());
|
|
597
|
+
}
|
|
598
|
+
else
|
|
599
|
+
{
|
|
600
|
+
pointsObject.machineIncomingFruitPerMinuteBySize = null;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
if(typeof jsonObject['points'] === 'object' && 'machineRecycledFruitPerMinuteBySize' in jsonObject['points'])
|
|
604
|
+
{
|
|
605
|
+
pointsObject.machineRecycledFruitPerMinuteBySize = (function(){
|
|
606
|
+
if(jsonObject['points'].machineRecycledFruitPerMinuteBySize === null)
|
|
607
|
+
{
|
|
608
|
+
return null;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
if(typeof jsonObject['points'].machineRecycledFruitPerMinuteBySize !== 'number')
|
|
612
|
+
{
|
|
613
|
+
return Number.isInteger(Number(jsonObject['points'].machineRecycledFruitPerMinuteBySize)) ? Number(jsonObject['points'].machineRecycledFruitPerMinuteBySize) : Math.floor(Number(jsonObject['points'].machineRecycledFruitPerMinuteBySize));
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
return Number.isInteger(jsonObject['points'].machineRecycledFruitPerMinuteBySize) ? jsonObject['points'].machineRecycledFruitPerMinuteBySize : Math.floor(jsonObject['points'].machineRecycledFruitPerMinuteBySize);
|
|
617
|
+
}());
|
|
618
|
+
}
|
|
619
|
+
else
|
|
620
|
+
{
|
|
621
|
+
pointsObject.machineRecycledFruitPerMinuteBySize = null;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
if(typeof jsonObject['points'] === 'object' && 'machineLanesFruitPerMinuteBySize' in jsonObject['points'])
|
|
625
|
+
{
|
|
626
|
+
pointsObject.machineLanesFruitPerMinuteBySize = (function(){
|
|
627
|
+
if(jsonObject['points'].machineLanesFruitPerMinuteBySize === null)
|
|
628
|
+
{
|
|
629
|
+
return null;
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
if(typeof jsonObject['points'].machineLanesFruitPerMinuteBySize !== 'number')
|
|
633
|
+
{
|
|
634
|
+
return Number.isInteger(Number(jsonObject['points'].machineLanesFruitPerMinuteBySize)) ? Number(jsonObject['points'].machineLanesFruitPerMinuteBySize) : Math.floor(Number(jsonObject['points'].machineLanesFruitPerMinuteBySize));
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
return Number.isInteger(jsonObject['points'].machineLanesFruitPerMinuteBySize) ? jsonObject['points'].machineLanesFruitPerMinuteBySize : Math.floor(jsonObject['points'].machineLanesFruitPerMinuteBySize);
|
|
638
|
+
}());
|
|
639
|
+
}
|
|
640
|
+
else
|
|
641
|
+
{
|
|
642
|
+
pointsObject.machineLanesFruitPerMinuteBySize = null;
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
if(typeof jsonObject['points'] === 'object' && 'createNewBatchRequest' in jsonObject['points'])
|
|
646
|
+
{
|
|
647
|
+
pointsObject.createNewBatchRequest = (function(){
|
|
648
|
+
if(typeof jsonObject['points'].createNewBatchRequest !== 'number')
|
|
649
|
+
{
|
|
650
|
+
return Number.isInteger(Number(jsonObject['points'].createNewBatchRequest)) ? Number(jsonObject['points'].createNewBatchRequest) : Math.floor(Number(jsonObject['points'].createNewBatchRequest));
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
return Number.isInteger(jsonObject['points'].createNewBatchRequest) ? jsonObject['points'].createNewBatchRequest : Math.floor(jsonObject['points'].createNewBatchRequest);
|
|
654
|
+
}());
|
|
655
|
+
}
|
|
656
|
+
else
|
|
657
|
+
{
|
|
658
|
+
pointsObject.createNewBatchRequest = 0;
|
|
659
|
+
}
|
|
660
|
+
|
|
661
|
+
if(typeof jsonObject['points'] === 'object' && 'createBatchOnPackrunChange' in jsonObject['points'])
|
|
662
|
+
{
|
|
663
|
+
pointsObject.createBatchOnPackrunChange = (function(){
|
|
664
|
+
if(typeof jsonObject['points'].createBatchOnPackrunChange !== 'number')
|
|
665
|
+
{
|
|
666
|
+
return Number.isInteger(Number(jsonObject['points'].createBatchOnPackrunChange)) ? Number(jsonObject['points'].createBatchOnPackrunChange) : Math.floor(Number(jsonObject['points'].createBatchOnPackrunChange));
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
return Number.isInteger(jsonObject['points'].createBatchOnPackrunChange) ? jsonObject['points'].createBatchOnPackrunChange : Math.floor(jsonObject['points'].createBatchOnPackrunChange);
|
|
670
|
+
}());
|
|
671
|
+
}
|
|
672
|
+
else
|
|
673
|
+
{
|
|
674
|
+
pointsObject.createBatchOnPackrunChange = 0;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
if(typeof jsonObject['points'] === 'object' && 'createBatchOnTimeBatchChange' in jsonObject['points'])
|
|
678
|
+
{
|
|
679
|
+
pointsObject.createBatchOnTimeBatchChange = (function(){
|
|
680
|
+
if(typeof jsonObject['points'].createBatchOnTimeBatchChange !== 'number')
|
|
681
|
+
{
|
|
682
|
+
return Number.isInteger(Number(jsonObject['points'].createBatchOnTimeBatchChange)) ? Number(jsonObject['points'].createBatchOnTimeBatchChange) : Math.floor(Number(jsonObject['points'].createBatchOnTimeBatchChange));
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
return Number.isInteger(jsonObject['points'].createBatchOnTimeBatchChange) ? jsonObject['points'].createBatchOnTimeBatchChange : Math.floor(jsonObject['points'].createBatchOnTimeBatchChange);
|
|
686
|
+
}());
|
|
687
|
+
}
|
|
688
|
+
else
|
|
689
|
+
{
|
|
690
|
+
pointsObject.createBatchOnTimeBatchChange = 0;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
if(typeof jsonObject['points'] === 'object' && 'outletGroupSummaries' in jsonObject['points'])
|
|
694
|
+
{
|
|
695
|
+
pointsObject.outletGroupSummaries = (function(){
|
|
696
|
+
if(typeof jsonObject['points'].outletGroupSummaries !== 'number')
|
|
697
|
+
{
|
|
698
|
+
return Number.isInteger(Number(jsonObject['points'].outletGroupSummaries)) ? Number(jsonObject['points'].outletGroupSummaries) : Math.floor(Number(jsonObject['points'].outletGroupSummaries));
|
|
699
|
+
}
|
|
700
|
+
|
|
701
|
+
return Number.isInteger(jsonObject['points'].outletGroupSummaries) ? jsonObject['points'].outletGroupSummaries : Math.floor(jsonObject['points'].outletGroupSummaries);
|
|
702
|
+
}());
|
|
703
|
+
}
|
|
704
|
+
else
|
|
705
|
+
{
|
|
706
|
+
pointsObject.outletGroupSummaries = 0;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
if(typeof jsonObject['points'] === 'object' && 'products' in jsonObject['points'])
|
|
710
|
+
{
|
|
711
|
+
pointsObject.products = (function(){
|
|
712
|
+
if(typeof jsonObject['points'].products !== 'number')
|
|
713
|
+
{
|
|
714
|
+
return Number.isInteger(Number(jsonObject['points'].products)) ? Number(jsonObject['points'].products) : Math.floor(Number(jsonObject['points'].products));
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
return Number.isInteger(jsonObject['points'].products) ? jsonObject['points'].products : Math.floor(jsonObject['points'].products);
|
|
718
|
+
}());
|
|
719
|
+
}
|
|
720
|
+
else
|
|
721
|
+
{
|
|
722
|
+
pointsObject.products = 0;
|
|
723
|
+
}
|
|
724
|
+
|
|
725
|
+
if(typeof jsonObject['points'] === 'object' && 'packTypeOutletUtilizationTargets' in jsonObject['points'])
|
|
726
|
+
{
|
|
727
|
+
pointsObject.packTypeOutletUtilizationTargets = (function(){
|
|
728
|
+
if(typeof jsonObject['points'].packTypeOutletUtilizationTargets !== 'number')
|
|
729
|
+
{
|
|
730
|
+
return Number.isInteger(Number(jsonObject['points'].packTypeOutletUtilizationTargets)) ? Number(jsonObject['points'].packTypeOutletUtilizationTargets) : Math.floor(Number(jsonObject['points'].packTypeOutletUtilizationTargets));
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
return Number.isInteger(jsonObject['points'].packTypeOutletUtilizationTargets) ? jsonObject['points'].packTypeOutletUtilizationTargets : Math.floor(jsonObject['points'].packTypeOutletUtilizationTargets);
|
|
734
|
+
}());
|
|
735
|
+
}
|
|
736
|
+
else
|
|
737
|
+
{
|
|
738
|
+
pointsObject.packTypeOutletUtilizationTargets = 0;
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
if(typeof jsonObject['points'] === 'object' && 'class1TraysPerHour' in jsonObject['points'])
|
|
742
|
+
{
|
|
743
|
+
pointsObject.class1TraysPerHour = (function(){
|
|
744
|
+
if(jsonObject['points'].class1TraysPerHour === null)
|
|
745
|
+
{
|
|
746
|
+
return null;
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
if(typeof jsonObject['points'].class1TraysPerHour !== 'number')
|
|
750
|
+
{
|
|
751
|
+
return Number.isInteger(Number(jsonObject['points'].class1TraysPerHour)) ? Number(jsonObject['points'].class1TraysPerHour) : Math.floor(Number(jsonObject['points'].class1TraysPerHour));
|
|
752
|
+
}
|
|
753
|
+
|
|
754
|
+
return Number.isInteger(jsonObject['points'].class1TraysPerHour) ? jsonObject['points'].class1TraysPerHour : Math.floor(jsonObject['points'].class1TraysPerHour);
|
|
755
|
+
}());
|
|
756
|
+
}
|
|
757
|
+
else
|
|
758
|
+
{
|
|
759
|
+
pointsObject.class1TraysPerHour = null;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
return pointsObject;
|
|
763
|
+
}());
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
if('lanes' in jsonObject)
|
|
767
|
+
{
|
|
768
|
+
model.lanes = (function(){
|
|
769
|
+
if(Array.isArray(jsonObject['lanes']) !== true)
|
|
770
|
+
{
|
|
771
|
+
return [];
|
|
772
|
+
}
|
|
773
|
+
|
|
774
|
+
return jsonObject['lanes'].map((lanesItem) => {
|
|
775
|
+
return (function(){
|
|
776
|
+
let lanesItemObject = {};
|
|
777
|
+
|
|
778
|
+
if(typeof lanesItem === 'object' && 'id' in lanesItem)
|
|
779
|
+
{
|
|
780
|
+
lanesItemObject.id = (function(){
|
|
781
|
+
if(typeof lanesItem.id !== 'string')
|
|
782
|
+
{
|
|
783
|
+
return String(lanesItem.id);
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
return lanesItem.id;
|
|
787
|
+
}());
|
|
788
|
+
}
|
|
789
|
+
else
|
|
790
|
+
{
|
|
791
|
+
lanesItemObject.id = "";
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
if(typeof lanesItem === 'object' && 'number' in lanesItem)
|
|
795
|
+
{
|
|
796
|
+
lanesItemObject.number = (function(){
|
|
797
|
+
if(typeof lanesItem.number !== 'number')
|
|
798
|
+
{
|
|
799
|
+
return Number.isInteger(Number(lanesItem.number)) ? Number(lanesItem.number) : Math.floor(Number(lanesItem.number));
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
return Number.isInteger(lanesItem.number) ? lanesItem.number : Math.floor(lanesItem.number);
|
|
803
|
+
}());
|
|
804
|
+
}
|
|
805
|
+
else
|
|
806
|
+
{
|
|
807
|
+
lanesItemObject.number = 0;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
if(typeof lanesItem === 'object' && 'points' in lanesItem)
|
|
811
|
+
{
|
|
812
|
+
lanesItemObject.points = (function(){
|
|
813
|
+
let pointsObject = {};
|
|
814
|
+
|
|
815
|
+
if(typeof lanesItem.points === 'object' && 'cupFill' in lanesItem.points)
|
|
816
|
+
{
|
|
817
|
+
pointsObject.cupFill = (function(){
|
|
818
|
+
if(typeof lanesItem.points.cupFill !== 'number')
|
|
819
|
+
{
|
|
820
|
+
return Number.isInteger(Number(lanesItem.points.cupFill)) ? Number(lanesItem.points.cupFill) : Math.floor(Number(lanesItem.points.cupFill));
|
|
821
|
+
}
|
|
822
|
+
|
|
823
|
+
return Number.isInteger(lanesItem.points.cupFill) ? lanesItem.points.cupFill : Math.floor(lanesItem.points.cupFill);
|
|
824
|
+
}());
|
|
825
|
+
}
|
|
826
|
+
else
|
|
827
|
+
{
|
|
828
|
+
pointsObject.cupFill = 0;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
return pointsObject;
|
|
832
|
+
}());
|
|
833
|
+
}
|
|
834
|
+
else
|
|
835
|
+
{
|
|
836
|
+
lanesItemObject.points = (function(){
|
|
837
|
+
let pointsDefaultValue = {};
|
|
838
|
+
|
|
839
|
+
pointsDefaultValue.cupFill = 0;
|
|
840
|
+
|
|
841
|
+
return pointsDefaultValue;
|
|
842
|
+
}());
|
|
843
|
+
}
|
|
844
|
+
|
|
845
|
+
return lanesItemObject;
|
|
846
|
+
}());
|
|
847
|
+
});
|
|
848
|
+
}());
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
if('outlets' in jsonObject)
|
|
852
|
+
{
|
|
853
|
+
model.outlets = (function(){
|
|
854
|
+
if(Array.isArray(jsonObject['outlets']) !== true)
|
|
855
|
+
{
|
|
856
|
+
return [];
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
return jsonObject['outlets'].map((outletsItem) => {
|
|
860
|
+
return (function(){
|
|
861
|
+
let outletsItemObject = {};
|
|
862
|
+
|
|
863
|
+
if(typeof outletsItem === 'object' && 'id' in outletsItem)
|
|
864
|
+
{
|
|
865
|
+
outletsItemObject.id = (function(){
|
|
866
|
+
if(typeof outletsItem.id !== 'string')
|
|
867
|
+
{
|
|
868
|
+
return String(outletsItem.id);
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
return outletsItem.id;
|
|
872
|
+
}());
|
|
873
|
+
}
|
|
874
|
+
else
|
|
875
|
+
{
|
|
876
|
+
outletsItemObject.id = "";
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
if(typeof outletsItem === 'object' && 'number' in outletsItem)
|
|
880
|
+
{
|
|
881
|
+
outletsItemObject.number = (function(){
|
|
882
|
+
if(typeof outletsItem.number !== 'number')
|
|
883
|
+
{
|
|
884
|
+
return Number.isInteger(Number(outletsItem.number)) ? Number(outletsItem.number) : Math.floor(Number(outletsItem.number));
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
return Number.isInteger(outletsItem.number) ? outletsItem.number : Math.floor(outletsItem.number);
|
|
888
|
+
}());
|
|
889
|
+
}
|
|
890
|
+
else
|
|
891
|
+
{
|
|
892
|
+
outletsItemObject.number = 0;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
if(typeof outletsItem === 'object' && 'type' in outletsItem)
|
|
896
|
+
{
|
|
897
|
+
outletsItemObject.type = (function(){
|
|
898
|
+
if(typeof outletsItem.type !== 'string')
|
|
899
|
+
{
|
|
900
|
+
return String(outletsItem.type);
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
return outletsItem.type;
|
|
904
|
+
}());
|
|
905
|
+
}
|
|
906
|
+
else
|
|
907
|
+
{
|
|
908
|
+
outletsItemObject.type = "";
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
if(typeof outletsItem === 'object' && 'points' in outletsItem)
|
|
912
|
+
{
|
|
913
|
+
outletsItemObject.points = (function(){
|
|
914
|
+
let pointsObject = {};
|
|
915
|
+
|
|
916
|
+
if(typeof outletsItem.points === 'object' && 'name' in outletsItem.points)
|
|
917
|
+
{
|
|
918
|
+
pointsObject.name = (function(){
|
|
919
|
+
if(typeof outletsItem.points.name !== 'number')
|
|
920
|
+
{
|
|
921
|
+
return Number.isInteger(Number(outletsItem.points.name)) ? Number(outletsItem.points.name) : Math.floor(Number(outletsItem.points.name));
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
return Number.isInteger(outletsItem.points.name) ? outletsItem.points.name : Math.floor(outletsItem.points.name);
|
|
925
|
+
}());
|
|
926
|
+
}
|
|
927
|
+
else
|
|
928
|
+
{
|
|
929
|
+
pointsObject.name = 0;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
if(typeof outletsItem.points === 'object' && 'fruitPerMinute' in outletsItem.points)
|
|
933
|
+
{
|
|
934
|
+
pointsObject.fruitPerMinute = (function(){
|
|
935
|
+
if(typeof outletsItem.points.fruitPerMinute !== 'number')
|
|
936
|
+
{
|
|
937
|
+
return Number.isInteger(Number(outletsItem.points.fruitPerMinute)) ? Number(outletsItem.points.fruitPerMinute) : Math.floor(Number(outletsItem.points.fruitPerMinute));
|
|
938
|
+
}
|
|
939
|
+
|
|
940
|
+
return Number.isInteger(outletsItem.points.fruitPerMinute) ? outletsItem.points.fruitPerMinute : Math.floor(outletsItem.points.fruitPerMinute);
|
|
941
|
+
}());
|
|
942
|
+
}
|
|
943
|
+
else
|
|
944
|
+
{
|
|
945
|
+
pointsObject.fruitPerMinute = 0;
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
if(typeof outletsItem.points === 'object' && 'packsPerMinute' in outletsItem.points)
|
|
949
|
+
{
|
|
950
|
+
pointsObject.packsPerMinute = (function(){
|
|
951
|
+
if(typeof outletsItem.points.packsPerMinute !== 'number')
|
|
952
|
+
{
|
|
953
|
+
return Number.isInteger(Number(outletsItem.points.packsPerMinute)) ? Number(outletsItem.points.packsPerMinute) : Math.floor(Number(outletsItem.points.packsPerMinute));
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
return Number.isInteger(outletsItem.points.packsPerMinute) ? outletsItem.points.packsPerMinute : Math.floor(outletsItem.points.packsPerMinute);
|
|
957
|
+
}());
|
|
958
|
+
}
|
|
959
|
+
else
|
|
960
|
+
{
|
|
961
|
+
pointsObject.packsPerMinute = 0;
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
if(typeof outletsItem.points === 'object' && 'utilization' in outletsItem.points)
|
|
965
|
+
{
|
|
966
|
+
pointsObject.utilization = (function(){
|
|
967
|
+
if(typeof outletsItem.points.utilization !== 'number')
|
|
968
|
+
{
|
|
969
|
+
return Number.isInteger(Number(outletsItem.points.utilization)) ? Number(outletsItem.points.utilization) : Math.floor(Number(outletsItem.points.utilization));
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
return Number.isInteger(outletsItem.points.utilization) ? outletsItem.points.utilization : Math.floor(outletsItem.points.utilization);
|
|
973
|
+
}());
|
|
974
|
+
}
|
|
975
|
+
else
|
|
976
|
+
{
|
|
977
|
+
pointsObject.utilization = 0;
|
|
978
|
+
}
|
|
979
|
+
|
|
980
|
+
if(typeof outletsItem.points === 'object' && 'status' in outletsItem.points)
|
|
981
|
+
{
|
|
982
|
+
pointsObject.status = (function(){
|
|
983
|
+
if(typeof outletsItem.points.status !== 'number')
|
|
984
|
+
{
|
|
985
|
+
return Number.isInteger(Number(outletsItem.points.status)) ? Number(outletsItem.points.status) : Math.floor(Number(outletsItem.points.status));
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
return Number.isInteger(outletsItem.points.status) ? outletsItem.points.status : Math.floor(outletsItem.points.status);
|
|
989
|
+
}());
|
|
990
|
+
}
|
|
991
|
+
else
|
|
992
|
+
{
|
|
993
|
+
pointsObject.status = 0;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
if(typeof outletsItem.points === 'object' && 'productId' in outletsItem.points)
|
|
997
|
+
{
|
|
998
|
+
pointsObject.productId = (function(){
|
|
999
|
+
if(typeof outletsItem.points.productId !== 'number')
|
|
1000
|
+
{
|
|
1001
|
+
return Number.isInteger(Number(outletsItem.points.productId)) ? Number(outletsItem.points.productId) : Math.floor(Number(outletsItem.points.productId));
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
return Number.isInteger(outletsItem.points.productId) ? outletsItem.points.productId : Math.floor(outletsItem.points.productId);
|
|
1005
|
+
}());
|
|
1006
|
+
}
|
|
1007
|
+
else
|
|
1008
|
+
{
|
|
1009
|
+
pointsObject.productId = 0;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
if(typeof outletsItem.points === 'object' && 'productName' in outletsItem.points)
|
|
1013
|
+
{
|
|
1014
|
+
pointsObject.productName = (function(){
|
|
1015
|
+
if(typeof outletsItem.points.productName !== 'number')
|
|
1016
|
+
{
|
|
1017
|
+
return Number.isInteger(Number(outletsItem.points.productName)) ? Number(outletsItem.points.productName) : Math.floor(Number(outletsItem.points.productName));
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
return Number.isInteger(outletsItem.points.productName) ? outletsItem.points.productName : Math.floor(outletsItem.points.productName);
|
|
1021
|
+
}());
|
|
1022
|
+
}
|
|
1023
|
+
else
|
|
1024
|
+
{
|
|
1025
|
+
pointsObject.productName = 0;
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
return pointsObject;
|
|
1029
|
+
}());
|
|
1030
|
+
}
|
|
1031
|
+
else
|
|
1032
|
+
{
|
|
1033
|
+
outletsItemObject.points = (function(){
|
|
1034
|
+
let pointsDefaultValue = {};
|
|
1035
|
+
|
|
1036
|
+
pointsDefaultValue.name = 0;
|
|
1037
|
+
|
|
1038
|
+
pointsDefaultValue.fruitPerMinute = 0;
|
|
1039
|
+
|
|
1040
|
+
pointsDefaultValue.packsPerMinute = 0;
|
|
1041
|
+
|
|
1042
|
+
pointsDefaultValue.utilization = 0;
|
|
1043
|
+
|
|
1044
|
+
pointsDefaultValue.status = 0;
|
|
1045
|
+
|
|
1046
|
+
pointsDefaultValue.productId = 0;
|
|
1047
|
+
|
|
1048
|
+
pointsDefaultValue.productName = 0;
|
|
1049
|
+
|
|
1050
|
+
return pointsDefaultValue;
|
|
1051
|
+
}());
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
return outletsItemObject;
|
|
1055
|
+
}());
|
|
1056
|
+
});
|
|
1057
|
+
}());
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
if('fruitSizes' in jsonObject)
|
|
1061
|
+
{
|
|
1062
|
+
model.fruitSizes = (function(){
|
|
1063
|
+
if(Array.isArray(jsonObject['fruitSizes']) !== true)
|
|
1064
|
+
{
|
|
1065
|
+
return [];
|
|
1066
|
+
}
|
|
1067
|
+
|
|
1068
|
+
return jsonObject['fruitSizes'].map((fruitSizesItem) => {
|
|
1069
|
+
return (function(){
|
|
1070
|
+
let fruitSizesItemObject = {};
|
|
1071
|
+
|
|
1072
|
+
if(typeof fruitSizesItem === 'object' && 'fruitSize' in fruitSizesItem)
|
|
1073
|
+
{
|
|
1074
|
+
fruitSizesItemObject.fruitSize = (function(){
|
|
1075
|
+
if(typeof fruitSizesItem.fruitSize !== 'string')
|
|
1076
|
+
{
|
|
1077
|
+
return String(fruitSizesItem.fruitSize);
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
return fruitSizesItem.fruitSize;
|
|
1081
|
+
}());
|
|
1082
|
+
}
|
|
1083
|
+
else
|
|
1084
|
+
{
|
|
1085
|
+
fruitSizesItemObject.fruitSize = "";
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
if(typeof fruitSizesItem === 'object' && 'points' in fruitSizesItem)
|
|
1089
|
+
{
|
|
1090
|
+
fruitSizesItemObject.points = (function(){
|
|
1091
|
+
let pointsObject = {};
|
|
1092
|
+
|
|
1093
|
+
if(typeof fruitSizesItem.points === 'object' && 'incomingFruitPerMinute' in fruitSizesItem.points)
|
|
1094
|
+
{
|
|
1095
|
+
pointsObject.incomingFruitPerMinute = (function(){
|
|
1096
|
+
if(typeof fruitSizesItem.points.incomingFruitPerMinute !== 'number')
|
|
1097
|
+
{
|
|
1098
|
+
return Number.isInteger(Number(fruitSizesItem.points.incomingFruitPerMinute)) ? Number(fruitSizesItem.points.incomingFruitPerMinute) : Math.floor(Number(fruitSizesItem.points.incomingFruitPerMinute));
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
return Number.isInteger(fruitSizesItem.points.incomingFruitPerMinute) ? fruitSizesItem.points.incomingFruitPerMinute : Math.floor(fruitSizesItem.points.incomingFruitPerMinute);
|
|
1102
|
+
}());
|
|
1103
|
+
}
|
|
1104
|
+
else
|
|
1105
|
+
{
|
|
1106
|
+
pointsObject.incomingFruitPerMinute = 0;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
if(typeof fruitSizesItem.points === 'object' && 'recycledFruitPerMinute' in fruitSizesItem.points)
|
|
1110
|
+
{
|
|
1111
|
+
pointsObject.recycledFruitPerMinute = (function(){
|
|
1112
|
+
if(typeof fruitSizesItem.points.recycledFruitPerMinute !== 'number')
|
|
1113
|
+
{
|
|
1114
|
+
return Number.isInteger(Number(fruitSizesItem.points.recycledFruitPerMinute)) ? Number(fruitSizesItem.points.recycledFruitPerMinute) : Math.floor(Number(fruitSizesItem.points.recycledFruitPerMinute));
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
return Number.isInteger(fruitSizesItem.points.recycledFruitPerMinute) ? fruitSizesItem.points.recycledFruitPerMinute : Math.floor(fruitSizesItem.points.recycledFruitPerMinute);
|
|
1118
|
+
}());
|
|
1119
|
+
}
|
|
1120
|
+
else
|
|
1121
|
+
{
|
|
1122
|
+
pointsObject.recycledFruitPerMinute = 0;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
if(typeof fruitSizesItem.points === 'object' && 'allocatedFruitPerMinute' in fruitSizesItem.points)
|
|
1126
|
+
{
|
|
1127
|
+
pointsObject.allocatedFruitPerMinute = (function(){
|
|
1128
|
+
if(typeof fruitSizesItem.points.allocatedFruitPerMinute !== 'number')
|
|
1129
|
+
{
|
|
1130
|
+
return Number.isInteger(Number(fruitSizesItem.points.allocatedFruitPerMinute)) ? Number(fruitSizesItem.points.allocatedFruitPerMinute) : Math.floor(Number(fruitSizesItem.points.allocatedFruitPerMinute));
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
return Number.isInteger(fruitSizesItem.points.allocatedFruitPerMinute) ? fruitSizesItem.points.allocatedFruitPerMinute : Math.floor(fruitSizesItem.points.allocatedFruitPerMinute);
|
|
1134
|
+
}());
|
|
1135
|
+
}
|
|
1136
|
+
else
|
|
1137
|
+
{
|
|
1138
|
+
pointsObject.allocatedFruitPerMinute = 0;
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
return pointsObject;
|
|
1142
|
+
}());
|
|
1143
|
+
}
|
|
1144
|
+
else
|
|
1145
|
+
{
|
|
1146
|
+
fruitSizesItemObject.points = (function(){
|
|
1147
|
+
let pointsDefaultValue = {};
|
|
1148
|
+
|
|
1149
|
+
pointsDefaultValue.incomingFruitPerMinute = 0;
|
|
1150
|
+
|
|
1151
|
+
pointsDefaultValue.recycledFruitPerMinute = 0;
|
|
1152
|
+
|
|
1153
|
+
pointsDefaultValue.allocatedFruitPerMinute = 0;
|
|
1154
|
+
|
|
1155
|
+
return pointsDefaultValue;
|
|
1156
|
+
}());
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
return fruitSizesItemObject;
|
|
1160
|
+
}());
|
|
1161
|
+
});
|
|
1162
|
+
}());
|
|
1163
|
+
}
|
|
1164
|
+
|
|
1165
|
+
if('freshPackIntegration' in jsonObject)
|
|
1166
|
+
{
|
|
1167
|
+
model.freshPackIntegration = (function(){
|
|
1168
|
+
if(jsonObject['freshPackIntegration'] === null)
|
|
1169
|
+
{
|
|
1170
|
+
return null;
|
|
1171
|
+
}
|
|
1172
|
+
|
|
1173
|
+
let freshPackIntegrationObject = {};
|
|
1174
|
+
|
|
1175
|
+
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'points' in jsonObject['freshPackIntegration'])
|
|
1176
|
+
{
|
|
1177
|
+
freshPackIntegrationObject.points = (function(){
|
|
1178
|
+
if(typeof jsonObject['freshPackIntegration'].points !== 'object')
|
|
1179
|
+
{
|
|
1180
|
+
return Object(jsonObject['freshPackIntegration'].points);
|
|
1181
|
+
}
|
|
1182
|
+
|
|
1183
|
+
return jsonObject['freshPackIntegration'].points;
|
|
1184
|
+
}());
|
|
1185
|
+
}
|
|
1186
|
+
else
|
|
1187
|
+
{
|
|
1188
|
+
freshPackIntegrationObject.points = {}
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1191
|
+
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'enabled' in jsonObject['freshPackIntegration'])
|
|
1192
|
+
{
|
|
1193
|
+
freshPackIntegrationObject.enabled = (function(){
|
|
1194
|
+
if(typeof jsonObject['freshPackIntegration'].enabled !== 'boolean')
|
|
1195
|
+
{
|
|
1196
|
+
return Boolean(jsonObject['freshPackIntegration'].enabled);
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
return jsonObject['freshPackIntegration'].enabled;
|
|
1200
|
+
}());
|
|
1201
|
+
}
|
|
1202
|
+
else
|
|
1203
|
+
{
|
|
1204
|
+
freshPackIntegrationObject.enabled = false;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'materialGroupId' in jsonObject['freshPackIntegration'])
|
|
1208
|
+
{
|
|
1209
|
+
freshPackIntegrationObject.materialGroupId = (function(){
|
|
1210
|
+
if(typeof jsonObject['freshPackIntegration'].materialGroupId !== 'number')
|
|
1211
|
+
{
|
|
1212
|
+
return Number.isInteger(Number(jsonObject['freshPackIntegration'].materialGroupId)) ? Number(jsonObject['freshPackIntegration'].materialGroupId) : Math.floor(Number(jsonObject['freshPackIntegration'].materialGroupId));
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
return Number.isInteger(jsonObject['freshPackIntegration'].materialGroupId) ? jsonObject['freshPackIntegration'].materialGroupId : Math.floor(jsonObject['freshPackIntegration'].materialGroupId);
|
|
1216
|
+
}());
|
|
1217
|
+
}
|
|
1218
|
+
else
|
|
1219
|
+
{
|
|
1220
|
+
freshPackIntegrationObject.materialGroupId = 0;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'binTypeId' in jsonObject['freshPackIntegration'])
|
|
1224
|
+
{
|
|
1225
|
+
freshPackIntegrationObject.binTypeId = (function(){
|
|
1226
|
+
if(typeof jsonObject['freshPackIntegration'].binTypeId !== 'number')
|
|
1227
|
+
{
|
|
1228
|
+
return Number.isInteger(Number(jsonObject['freshPackIntegration'].binTypeId)) ? Number(jsonObject['freshPackIntegration'].binTypeId) : Math.floor(Number(jsonObject['freshPackIntegration'].binTypeId));
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
return Number.isInteger(jsonObject['freshPackIntegration'].binTypeId) ? jsonObject['freshPackIntegration'].binTypeId : Math.floor(jsonObject['freshPackIntegration'].binTypeId);
|
|
1232
|
+
}());
|
|
1233
|
+
}
|
|
1234
|
+
else
|
|
1235
|
+
{
|
|
1236
|
+
freshPackIntegrationObject.binTypeId = 0;
|
|
1237
|
+
}
|
|
1238
|
+
|
|
1239
|
+
if(typeof jsonObject['freshPackIntegration'] === 'object' && 'bulkWeightClassTypes' in jsonObject['freshPackIntegration'])
|
|
1240
|
+
{
|
|
1241
|
+
freshPackIntegrationObject.bulkWeightClassTypes = (function(){
|
|
1242
|
+
if(Array.isArray(jsonObject['freshPackIntegration'].bulkWeightClassTypes) !== true)
|
|
1243
|
+
{
|
|
1244
|
+
return [];
|
|
1245
|
+
}
|
|
1246
|
+
|
|
1247
|
+
return jsonObject['freshPackIntegration'].bulkWeightClassTypes.map((bulkWeightClassTypesItem) => {
|
|
1248
|
+
return (function(){
|
|
1249
|
+
if(typeof bulkWeightClassTypesItem !== 'string')
|
|
1250
|
+
{
|
|
1251
|
+
return String(bulkWeightClassTypesItem);
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
return bulkWeightClassTypesItem;
|
|
1255
|
+
}());
|
|
1256
|
+
});
|
|
1257
|
+
}());
|
|
1258
|
+
}
|
|
1259
|
+
else
|
|
1260
|
+
{
|
|
1261
|
+
freshPackIntegrationObject.bulkWeightClassTypes = [];
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
return freshPackIntegrationObject;
|
|
1265
|
+
}());
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
if('reemoonIntegration' in jsonObject)
|
|
1269
|
+
{
|
|
1270
|
+
model.reemoonIntegration = (function(){
|
|
1271
|
+
let reemoonIntegrationObject = {};
|
|
1272
|
+
|
|
1273
|
+
if(typeof jsonObject['reemoonIntegration'] === 'object' && 'points' in jsonObject['reemoonIntegration'])
|
|
1274
|
+
{
|
|
1275
|
+
reemoonIntegrationObject.points = (function(){
|
|
1276
|
+
let pointsObject = {};
|
|
1277
|
+
|
|
1278
|
+
if(typeof jsonObject['reemoonIntegration'].points === 'object' && 'apiCommunicationStatus' in jsonObject['reemoonIntegration'].points)
|
|
1279
|
+
{
|
|
1280
|
+
pointsObject.apiCommunicationStatus = (function(){
|
|
1281
|
+
if(typeof jsonObject['reemoonIntegration'].points.apiCommunicationStatus !== 'number')
|
|
1282
|
+
{
|
|
1283
|
+
return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.apiCommunicationStatus)) ? Number(jsonObject['reemoonIntegration'].points.apiCommunicationStatus) : Math.floor(Number(jsonObject['reemoonIntegration'].points.apiCommunicationStatus));
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
return Number.isInteger(jsonObject['reemoonIntegration'].points.apiCommunicationStatus) ? jsonObject['reemoonIntegration'].points.apiCommunicationStatus : Math.floor(jsonObject['reemoonIntegration'].points.apiCommunicationStatus);
|
|
1287
|
+
}());
|
|
1288
|
+
}
|
|
1289
|
+
else
|
|
1290
|
+
{
|
|
1291
|
+
pointsObject.apiCommunicationStatus = 0;
|
|
1292
|
+
}
|
|
1293
|
+
|
|
1294
|
+
if(typeof jsonObject['reemoonIntegration'].points === 'object' && 'machineId' in jsonObject['reemoonIntegration'].points)
|
|
1295
|
+
{
|
|
1296
|
+
pointsObject.machineId = (function(){
|
|
1297
|
+
if(typeof jsonObject['reemoonIntegration'].points.machineId !== 'number')
|
|
1298
|
+
{
|
|
1299
|
+
return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineId)) ? Number(jsonObject['reemoonIntegration'].points.machineId) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineId));
|
|
1300
|
+
}
|
|
1301
|
+
|
|
1302
|
+
return Number.isInteger(jsonObject['reemoonIntegration'].points.machineId) ? jsonObject['reemoonIntegration'].points.machineId : Math.floor(jsonObject['reemoonIntegration'].points.machineId);
|
|
1303
|
+
}());
|
|
1304
|
+
}
|
|
1305
|
+
else
|
|
1306
|
+
{
|
|
1307
|
+
pointsObject.machineId = 0;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
if(typeof jsonObject['reemoonIntegration'].points === 'object' && 'machineName' in jsonObject['reemoonIntegration'].points)
|
|
1311
|
+
{
|
|
1312
|
+
pointsObject.machineName = (function(){
|
|
1313
|
+
if(typeof jsonObject['reemoonIntegration'].points.machineName !== 'number')
|
|
1314
|
+
{
|
|
1315
|
+
return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineName)) ? Number(jsonObject['reemoonIntegration'].points.machineName) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineName));
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
return Number.isInteger(jsonObject['reemoonIntegration'].points.machineName) ? jsonObject['reemoonIntegration'].points.machineName : Math.floor(jsonObject['reemoonIntegration'].points.machineName);
|
|
1319
|
+
}());
|
|
1320
|
+
}
|
|
1321
|
+
else
|
|
1322
|
+
{
|
|
1323
|
+
pointsObject.machineName = 0;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
if(typeof jsonObject['reemoonIntegration'].points === 'object' && 'machineLaneCount' in jsonObject['reemoonIntegration'].points)
|
|
1327
|
+
{
|
|
1328
|
+
pointsObject.machineLaneCount = (function(){
|
|
1329
|
+
if(typeof jsonObject['reemoonIntegration'].points.machineLaneCount !== 'number')
|
|
1330
|
+
{
|
|
1331
|
+
return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineLaneCount)) ? Number(jsonObject['reemoonIntegration'].points.machineLaneCount) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineLaneCount));
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
return Number.isInteger(jsonObject['reemoonIntegration'].points.machineLaneCount) ? jsonObject['reemoonIntegration'].points.machineLaneCount : Math.floor(jsonObject['reemoonIntegration'].points.machineLaneCount);
|
|
1335
|
+
}());
|
|
1336
|
+
}
|
|
1337
|
+
else
|
|
1338
|
+
{
|
|
1339
|
+
pointsObject.machineLaneCount = 0;
|
|
1340
|
+
}
|
|
1341
|
+
|
|
1342
|
+
if(typeof jsonObject['reemoonIntegration'].points === 'object' && 'machineOutletCount' in jsonObject['reemoonIntegration'].points)
|
|
1343
|
+
{
|
|
1344
|
+
pointsObject.machineOutletCount = (function(){
|
|
1345
|
+
if(typeof jsonObject['reemoonIntegration'].points.machineOutletCount !== 'number')
|
|
1346
|
+
{
|
|
1347
|
+
return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineOutletCount)) ? Number(jsonObject['reemoonIntegration'].points.machineOutletCount) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineOutletCount));
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
return Number.isInteger(jsonObject['reemoonIntegration'].points.machineOutletCount) ? jsonObject['reemoonIntegration'].points.machineOutletCount : Math.floor(jsonObject['reemoonIntegration'].points.machineOutletCount);
|
|
1351
|
+
}());
|
|
1352
|
+
}
|
|
1353
|
+
else
|
|
1354
|
+
{
|
|
1355
|
+
pointsObject.machineOutletCount = 0;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
if(typeof jsonObject['reemoonIntegration'].points === 'object' && 'machineOutletDetails' in jsonObject['reemoonIntegration'].points)
|
|
1359
|
+
{
|
|
1360
|
+
pointsObject.machineOutletDetails = (function(){
|
|
1361
|
+
if(typeof jsonObject['reemoonIntegration'].points.machineOutletDetails !== 'number')
|
|
1362
|
+
{
|
|
1363
|
+
return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineOutletDetails)) ? Number(jsonObject['reemoonIntegration'].points.machineOutletDetails) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineOutletDetails));
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
return Number.isInteger(jsonObject['reemoonIntegration'].points.machineOutletDetails) ? jsonObject['reemoonIntegration'].points.machineOutletDetails : Math.floor(jsonObject['reemoonIntegration'].points.machineOutletDetails);
|
|
1367
|
+
}());
|
|
1368
|
+
}
|
|
1369
|
+
else
|
|
1370
|
+
{
|
|
1371
|
+
pointsObject.machineOutletDetails = 0;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
return pointsObject;
|
|
1375
|
+
}());
|
|
1376
|
+
}
|
|
1377
|
+
else
|
|
1378
|
+
{
|
|
1379
|
+
reemoonIntegrationObject.points = (function(){
|
|
1380
|
+
let pointsDefaultValue = {};
|
|
1381
|
+
|
|
1382
|
+
pointsDefaultValue.apiCommunicationStatus = 0;
|
|
1383
|
+
|
|
1384
|
+
pointsDefaultValue.machineId = 0;
|
|
1385
|
+
|
|
1386
|
+
pointsDefaultValue.machineName = 0;
|
|
1387
|
+
|
|
1388
|
+
pointsDefaultValue.machineLaneCount = 0;
|
|
1389
|
+
|
|
1390
|
+
pointsDefaultValue.machineOutletCount = 0;
|
|
1391
|
+
|
|
1392
|
+
pointsDefaultValue.machineOutletDetails = 0;
|
|
1393
|
+
|
|
1394
|
+
return pointsDefaultValue;
|
|
1395
|
+
}());
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
if(typeof jsonObject['reemoonIntegration'] === 'object' && 'enabled' in jsonObject['reemoonIntegration'])
|
|
1399
|
+
{
|
|
1400
|
+
reemoonIntegrationObject.enabled = (function(){
|
|
1401
|
+
if(typeof jsonObject['reemoonIntegration'].enabled !== 'boolean')
|
|
1402
|
+
{
|
|
1403
|
+
return Boolean(jsonObject['reemoonIntegration'].enabled);
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
return jsonObject['reemoonIntegration'].enabled;
|
|
1407
|
+
}());
|
|
1408
|
+
}
|
|
1409
|
+
else
|
|
1410
|
+
{
|
|
1411
|
+
reemoonIntegrationObject.enabled = false;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
if(typeof jsonObject['reemoonIntegration'] === 'object' && 'username' in jsonObject['reemoonIntegration'])
|
|
1415
|
+
{
|
|
1416
|
+
reemoonIntegrationObject.username = (function(){
|
|
1417
|
+
if(typeof jsonObject['reemoonIntegration'].username !== 'string')
|
|
1418
|
+
{
|
|
1419
|
+
return String(jsonObject['reemoonIntegration'].username);
|
|
1420
|
+
}
|
|
1421
|
+
|
|
1422
|
+
return jsonObject['reemoonIntegration'].username;
|
|
1423
|
+
}());
|
|
1424
|
+
}
|
|
1425
|
+
else
|
|
1426
|
+
{
|
|
1427
|
+
reemoonIntegrationObject.username = "";
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
if(typeof jsonObject['reemoonIntegration'] === 'object' && 'password' in jsonObject['reemoonIntegration'])
|
|
1431
|
+
{
|
|
1432
|
+
reemoonIntegrationObject.password = (function(){
|
|
1433
|
+
if(typeof jsonObject['reemoonIntegration'].password !== 'string')
|
|
1434
|
+
{
|
|
1435
|
+
return String(jsonObject['reemoonIntegration'].password);
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
return jsonObject['reemoonIntegration'].password;
|
|
1439
|
+
}());
|
|
1440
|
+
}
|
|
1441
|
+
else
|
|
1442
|
+
{
|
|
1443
|
+
reemoonIntegrationObject.password = "";
|
|
1444
|
+
}
|
|
1445
|
+
|
|
1446
|
+
if(typeof jsonObject['reemoonIntegration'] === 'object' && 'apiBaseUrl' in jsonObject['reemoonIntegration'])
|
|
1447
|
+
{
|
|
1448
|
+
reemoonIntegrationObject.apiBaseUrl = (function(){
|
|
1449
|
+
if(typeof jsonObject['reemoonIntegration'].apiBaseUrl !== 'string')
|
|
1450
|
+
{
|
|
1451
|
+
return String(jsonObject['reemoonIntegration'].apiBaseUrl);
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
return jsonObject['reemoonIntegration'].apiBaseUrl;
|
|
1455
|
+
}());
|
|
1456
|
+
}
|
|
1457
|
+
else
|
|
1458
|
+
{
|
|
1459
|
+
reemoonIntegrationObject.apiBaseUrl = "";
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
return reemoonIntegrationObject;
|
|
1463
|
+
}());
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
if('sources' in jsonObject)
|
|
1467
|
+
{
|
|
1468
|
+
model.sources = (function(){
|
|
1469
|
+
if(Array.isArray(jsonObject['sources']) !== true)
|
|
1470
|
+
{
|
|
1471
|
+
return [];
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
return jsonObject['sources'].map((sourcesItem) => {
|
|
1475
|
+
return (function(){
|
|
1476
|
+
return sourcesItem;
|
|
1477
|
+
}());
|
|
1478
|
+
});
|
|
1479
|
+
}());
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
if('productClassTypes' in jsonObject)
|
|
1483
|
+
{
|
|
1484
|
+
model.productClassTypes = (function(){
|
|
1485
|
+
if(Array.isArray(jsonObject['productClassTypes']) !== true)
|
|
1486
|
+
{
|
|
1487
|
+
return [];
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
return jsonObject['productClassTypes'].map((productClassTypesItem) => {
|
|
1491
|
+
return (function(){
|
|
1492
|
+
let productClassTypesItemObject = {};
|
|
1493
|
+
|
|
1494
|
+
if(typeof productClassTypesItem === 'object' && 'productName' in productClassTypesItem)
|
|
1495
|
+
{
|
|
1496
|
+
productClassTypesItemObject.productName = (function(){
|
|
1497
|
+
if(typeof productClassTypesItem.productName !== 'string')
|
|
1498
|
+
{
|
|
1499
|
+
return String(productClassTypesItem.productName);
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
return productClassTypesItem.productName;
|
|
1503
|
+
}());
|
|
1504
|
+
}
|
|
1505
|
+
else
|
|
1506
|
+
{
|
|
1507
|
+
productClassTypesItemObject.productName = "";
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
if(typeof productClassTypesItem === 'object' && 'classType' in productClassTypesItem)
|
|
1511
|
+
{
|
|
1512
|
+
productClassTypesItemObject.classType = (function(){
|
|
1513
|
+
if(typeof productClassTypesItem.classType !== 'string')
|
|
1514
|
+
{
|
|
1515
|
+
return String(productClassTypesItem.classType);
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
return productClassTypesItem.classType;
|
|
1519
|
+
}());
|
|
1520
|
+
}
|
|
1521
|
+
else
|
|
1522
|
+
{
|
|
1523
|
+
productClassTypesItemObject.classType = "";
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
if(typeof productClassTypesItem === 'object' && 'matchType' in productClassTypesItem)
|
|
1527
|
+
{
|
|
1528
|
+
productClassTypesItemObject.matchType = (function(){
|
|
1529
|
+
if(typeof productClassTypesItem.matchType !== 'string')
|
|
1530
|
+
{
|
|
1531
|
+
return String(productClassTypesItem.matchType);
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
return productClassTypesItem.matchType;
|
|
1535
|
+
}());
|
|
1536
|
+
}
|
|
1537
|
+
else
|
|
1538
|
+
{
|
|
1539
|
+
productClassTypesItemObject.matchType = "";
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
return productClassTypesItemObject;
|
|
1543
|
+
}());
|
|
1544
|
+
});
|
|
1545
|
+
}());
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1548
|
+
if('deleted' in jsonObject)
|
|
1549
|
+
{
|
|
1550
|
+
model.deleted = (function(){
|
|
1551
|
+
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
1552
|
+
{
|
|
1553
|
+
return Boolean(jsonObject['deleted']);
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
return jsonObject['deleted'];
|
|
1557
|
+
}());
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
if('updateTimestamp' in jsonObject)
|
|
1561
|
+
{
|
|
1562
|
+
model.updateTimestamp = (function(){
|
|
1563
|
+
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
1564
|
+
{
|
|
1565
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
1569
|
+
}());
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
return model;
|
|
1573
|
+
}
|
|
1574
|
+
}
|
|
1575
|
+
|
|
1576
|
+
export default ReemoonSizerModel;
|