@ricado/api-client 2.3.17 → 2.3.19
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/BinTipBarcodeScannerController.js +198 -0
- package/lib/Controllers/Packhouse/Site/BinTipBinController.js +14 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +186 -2
- package/lib/Controllers/Packhouse/Site/CompacSizerBinWeightController.js +959 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +89 -15
- package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +1 -1
- package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +35 -4
- package/lib/Controllers/Packhouse/Site/MAFSizerController.js +101 -19
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +435 -23
- package/lib/Controllers/Packhouse/Site/PackrunController.js +11 -2
- package/lib/Controllers/Packhouse/Site/RejectBinController.js +38 -2
- package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +52 -6
- package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +70 -4
- package/lib/Controllers/Packhouse/Site/ShiftController.js +1 -1
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/lib/Controllers/Packhouse/Site/SoftSortBeltController.js +2 -2
- package/lib/Controllers/Packhouse/Site/SoftSortPackrunSummaryController.js +14 -2
- package/lib/Controllers/Packhouse/Site/index.js +6 -0
- package/lib/Models/Packhouse/Site/BinTipBarcodeScannerModel.js +263 -0
- package/lib/Models/Packhouse/Site/BinTipBinModel.js +75 -5
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +1276 -5
- package/lib/Models/Packhouse/Site/CompacSizerBinWeightModel.js +627 -0
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +966 -72
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +260 -8
- package/lib/Models/Packhouse/Site/MAFSizerModel.js +660 -85
- package/lib/Models/Packhouse/Site/PackingLineModel.js +3860 -551
- package/lib/Models/Packhouse/Site/PackrunModel.js +26 -4
- package/lib/Models/Packhouse/Site/RejectBinModel.js +214 -4
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +576 -14
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +113 -9
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +98 -0
- package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +50 -5
- package/lib/Models/Packhouse/Site/SoftSortPackrunSummaryModel.js +75 -5
- package/lib/Models/Packhouse/Site/index.js +6 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +6004 -2037
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/BinTipBarcodeScannerController.js +175 -0
- package/src/Controllers/Packhouse/Site/BinTipBinController.js +14 -2
- package/src/Controllers/Packhouse/Site/CompacSizerBatchController.js +186 -2
- package/src/Controllers/Packhouse/Site/CompacSizerBinWeightController.js +1090 -0
- package/src/Controllers/Packhouse/Site/CompacSizerController.js +89 -15
- package/src/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +1 -1
- package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +35 -4
- package/src/Controllers/Packhouse/Site/MAFSizerController.js +101 -19
- package/src/Controllers/Packhouse/Site/PackingLineController.js +435 -23
- package/src/Controllers/Packhouse/Site/PackrunController.js +11 -2
- package/src/Controllers/Packhouse/Site/RejectBinController.js +38 -2
- package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +52 -6
- package/src/Controllers/Packhouse/Site/RejectBinWeightController.js +70 -4
- package/src/Controllers/Packhouse/Site/ShiftController.js +1 -1
- package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/src/Controllers/Packhouse/Site/SoftSortBeltController.js +2 -2
- package/src/Controllers/Packhouse/Site/SoftSortPackrunSummaryController.js +14 -2
- package/src/Controllers/Packhouse/Site/index.js +4 -0
- package/src/Models/Packhouse/Site/BinTipBarcodeScannerModel.js +252 -0
- package/src/Models/Packhouse/Site/BinTipBinModel.js +97 -5
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +1682 -5
- package/src/Models/Packhouse/Site/CompacSizerBinWeightModel.js +715 -0
- package/src/Models/Packhouse/Site/CompacSizerModel.js +1319 -109
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +339 -8
- package/src/Models/Packhouse/Site/MAFSizerModel.js +869 -92
- package/src/Models/Packhouse/Site/PackingLineModel.js +5086 -671
- package/src/Models/Packhouse/Site/PackrunModel.js +33 -4
- package/src/Models/Packhouse/Site/RejectBinModel.js +280 -4
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +775 -15
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +147 -10
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +120 -0
- package/src/Models/Packhouse/Site/SoftSortBeltModel.js +65 -5
- package/src/Models/Packhouse/Site/SoftSortPackrunSummaryModel.js +97 -5
- package/src/Models/Packhouse/Site/index.js +4 -0
- package/src/PackageVersion.js +1 -1
|
@@ -68,10 +68,56 @@ class CompacSizerBatchModel extends BaseModel
|
|
|
68
68
|
/**
|
|
69
69
|
* The Compac Sizer Batch Data
|
|
70
70
|
*
|
|
71
|
-
* @type {
|
|
71
|
+
* @type {{id: number, name: ?string, growerCode: ?string, growerName: ?string, startTimestamp: ?Date, endTimestamp: ?Date, comments: string[], varietyId: string, varietyName: string, finished: boolean, events: Array<{id: number, batchId: number, type: string, details: string, timestamp: Date, runningSeconds: number, fruitRunningSeconds: number}>, sizingMaps: Array<{id: number, eventId: number, varietySizingMapId: number, name: ?string, fruitSizes: Array<{id: number, eventId: number, index: number, name: ?string, minimumFruitWeight: number, fruitCount: number, minimumTrayWeight: number, varietySizingMapId: number}>}>, grades: Array<{id: number, eventId: number, index: number, name: ?string}>, qualities: Array<{id: number, eventId: number, index: number, name: ?string}>, products: Array<{id: number, eventId: number, guid: string, name: ?string}>, packs: Array<{id: number, eventId: number, guid: string, name: ?string}>, summaryGroups: Array<{id: number, name: ?string, isReject: boolean, orderIndex: number}>, dropSummaries: Array<{id: number, eventId: number, summaryGroupId: number, productId: number, dropId: number, gradeIndex: number, sizeIndex: number, qualityIndex: number, fruitWeight: number, fruitCount: number, varietySizingMapId: number}>, recycleSummaries: Array<{id: number, eventId: number, productId: number, dropId: number, gradeIndex: number, sizeIndex: number, qualityIndex: number, fruitWeight: number, fruitCount: number, varietySizingMapId: number}>, packSummaries: Array<{id: number, eventId: number, summaryGroupId: number, productId: number, packId: number, packCount: number, fruitWeight: number, fruitCount: number}>, drops: Array<{id: number, name: ?string, totallingEnabled: boolean}>}}
|
|
72
72
|
* @public
|
|
73
73
|
*/
|
|
74
|
-
this.batch = {
|
|
74
|
+
this.batch = (function(){
|
|
75
|
+
let batchDefaultValue = {};
|
|
76
|
+
|
|
77
|
+
batchDefaultValue.id = 0;
|
|
78
|
+
|
|
79
|
+
batchDefaultValue.name = null;
|
|
80
|
+
|
|
81
|
+
batchDefaultValue.growerCode = null;
|
|
82
|
+
|
|
83
|
+
batchDefaultValue.growerName = null;
|
|
84
|
+
|
|
85
|
+
batchDefaultValue.startTimestamp = null;
|
|
86
|
+
|
|
87
|
+
batchDefaultValue.endTimestamp = null;
|
|
88
|
+
|
|
89
|
+
batchDefaultValue.comments = [];
|
|
90
|
+
|
|
91
|
+
batchDefaultValue.varietyId = "";
|
|
92
|
+
|
|
93
|
+
batchDefaultValue.varietyName = "";
|
|
94
|
+
|
|
95
|
+
batchDefaultValue.finished = false;
|
|
96
|
+
|
|
97
|
+
batchDefaultValue.events = [];
|
|
98
|
+
|
|
99
|
+
batchDefaultValue.sizingMaps = [];
|
|
100
|
+
|
|
101
|
+
batchDefaultValue.grades = [];
|
|
102
|
+
|
|
103
|
+
batchDefaultValue.qualities = [];
|
|
104
|
+
|
|
105
|
+
batchDefaultValue.products = [];
|
|
106
|
+
|
|
107
|
+
batchDefaultValue.packs = [];
|
|
108
|
+
|
|
109
|
+
batchDefaultValue.summaryGroups = [];
|
|
110
|
+
|
|
111
|
+
batchDefaultValue.dropSummaries = [];
|
|
112
|
+
|
|
113
|
+
batchDefaultValue.recycleSummaries = [];
|
|
114
|
+
|
|
115
|
+
batchDefaultValue.packSummaries = [];
|
|
116
|
+
|
|
117
|
+
batchDefaultValue.drops = [];
|
|
118
|
+
|
|
119
|
+
return batchDefaultValue;
|
|
120
|
+
}());
|
|
75
121
|
|
|
76
122
|
/**
|
|
77
123
|
* Whether the Compac Sizer Batch has been deleted
|
|
@@ -195,12 +241,1643 @@ class CompacSizerBatchModel extends BaseModel
|
|
|
195
241
|
if('batch' in jsonObject)
|
|
196
242
|
{
|
|
197
243
|
model.batch = (function(){
|
|
198
|
-
|
|
244
|
+
let batchObject = {};
|
|
245
|
+
|
|
246
|
+
if(typeof jsonObject['batch'] === 'object' && 'id' in jsonObject['batch'])
|
|
199
247
|
{
|
|
200
|
-
|
|
248
|
+
batchObject.id = (function(){
|
|
249
|
+
if(typeof jsonObject['batch'].id !== 'number')
|
|
250
|
+
{
|
|
251
|
+
return Number.isInteger(Number(jsonObject['batch'].id)) ? Number(jsonObject['batch'].id) : Math.floor(Number(jsonObject['batch'].id));
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return Number.isInteger(jsonObject['batch'].id) ? jsonObject['batch'].id : Math.floor(jsonObject['batch'].id);
|
|
255
|
+
}());
|
|
256
|
+
}
|
|
257
|
+
else
|
|
258
|
+
{
|
|
259
|
+
batchObject.id = 0;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
if(typeof jsonObject['batch'] === 'object' && 'name' in jsonObject['batch'])
|
|
263
|
+
{
|
|
264
|
+
batchObject.name = (function(){
|
|
265
|
+
if(jsonObject['batch'].name === null)
|
|
266
|
+
{
|
|
267
|
+
return null;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
if(typeof jsonObject['batch'].name !== 'string')
|
|
271
|
+
{
|
|
272
|
+
return String(jsonObject['batch'].name);
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return jsonObject['batch'].name;
|
|
276
|
+
}());
|
|
277
|
+
}
|
|
278
|
+
else
|
|
279
|
+
{
|
|
280
|
+
batchObject.name = null;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if(typeof jsonObject['batch'] === 'object' && 'growerCode' in jsonObject['batch'])
|
|
284
|
+
{
|
|
285
|
+
batchObject.growerCode = (function(){
|
|
286
|
+
if(jsonObject['batch'].growerCode === null)
|
|
287
|
+
{
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if(typeof jsonObject['batch'].growerCode !== 'string')
|
|
292
|
+
{
|
|
293
|
+
return String(jsonObject['batch'].growerCode);
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
return jsonObject['batch'].growerCode;
|
|
297
|
+
}());
|
|
298
|
+
}
|
|
299
|
+
else
|
|
300
|
+
{
|
|
301
|
+
batchObject.growerCode = null;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if(typeof jsonObject['batch'] === 'object' && 'growerName' in jsonObject['batch'])
|
|
305
|
+
{
|
|
306
|
+
batchObject.growerName = (function(){
|
|
307
|
+
if(jsonObject['batch'].growerName === null)
|
|
308
|
+
{
|
|
309
|
+
return null;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
if(typeof jsonObject['batch'].growerName !== 'string')
|
|
313
|
+
{
|
|
314
|
+
return String(jsonObject['batch'].growerName);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return jsonObject['batch'].growerName;
|
|
318
|
+
}());
|
|
319
|
+
}
|
|
320
|
+
else
|
|
321
|
+
{
|
|
322
|
+
batchObject.growerName = null;
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
if(typeof jsonObject['batch'] === 'object' && 'startTimestamp' in jsonObject['batch'])
|
|
326
|
+
{
|
|
327
|
+
batchObject.startTimestamp = (function(){
|
|
328
|
+
if(jsonObject['batch'].startTimestamp === null)
|
|
329
|
+
{
|
|
330
|
+
return null;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
if(typeof jsonObject['batch'].startTimestamp !== 'string')
|
|
334
|
+
{
|
|
335
|
+
return new Date(String(jsonObject['batch'].startTimestamp));
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
return new Date(jsonObject['batch'].startTimestamp);
|
|
339
|
+
}());
|
|
340
|
+
}
|
|
341
|
+
else
|
|
342
|
+
{
|
|
343
|
+
batchObject.startTimestamp = null;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if(typeof jsonObject['batch'] === 'object' && 'endTimestamp' in jsonObject['batch'])
|
|
347
|
+
{
|
|
348
|
+
batchObject.endTimestamp = (function(){
|
|
349
|
+
if(jsonObject['batch'].endTimestamp === null)
|
|
350
|
+
{
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if(typeof jsonObject['batch'].endTimestamp !== 'string')
|
|
355
|
+
{
|
|
356
|
+
return new Date(String(jsonObject['batch'].endTimestamp));
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return new Date(jsonObject['batch'].endTimestamp);
|
|
360
|
+
}());
|
|
361
|
+
}
|
|
362
|
+
else
|
|
363
|
+
{
|
|
364
|
+
batchObject.endTimestamp = null;
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
if(typeof jsonObject['batch'] === 'object' && 'comments' in jsonObject['batch'])
|
|
368
|
+
{
|
|
369
|
+
batchObject.comments = (function(){
|
|
370
|
+
if(Array.isArray(jsonObject['batch'].comments) !== true)
|
|
371
|
+
{
|
|
372
|
+
return [];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
return jsonObject['batch'].comments.map((commentsItem) => {
|
|
376
|
+
return (function(){
|
|
377
|
+
if(typeof commentsItem !== 'string')
|
|
378
|
+
{
|
|
379
|
+
return String(commentsItem);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
return commentsItem;
|
|
383
|
+
}());
|
|
384
|
+
});
|
|
385
|
+
}());
|
|
386
|
+
}
|
|
387
|
+
else
|
|
388
|
+
{
|
|
389
|
+
batchObject.comments = [];
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if(typeof jsonObject['batch'] === 'object' && 'varietyId' in jsonObject['batch'])
|
|
393
|
+
{
|
|
394
|
+
batchObject.varietyId = (function(){
|
|
395
|
+
if(typeof jsonObject['batch'].varietyId !== 'string')
|
|
396
|
+
{
|
|
397
|
+
return String(jsonObject['batch'].varietyId);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
return jsonObject['batch'].varietyId;
|
|
401
|
+
}());
|
|
402
|
+
}
|
|
403
|
+
else
|
|
404
|
+
{
|
|
405
|
+
batchObject.varietyId = "";
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
if(typeof jsonObject['batch'] === 'object' && 'varietyName' in jsonObject['batch'])
|
|
409
|
+
{
|
|
410
|
+
batchObject.varietyName = (function(){
|
|
411
|
+
if(typeof jsonObject['batch'].varietyName !== 'string')
|
|
412
|
+
{
|
|
413
|
+
return String(jsonObject['batch'].varietyName);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return jsonObject['batch'].varietyName;
|
|
417
|
+
}());
|
|
418
|
+
}
|
|
419
|
+
else
|
|
420
|
+
{
|
|
421
|
+
batchObject.varietyName = "";
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
if(typeof jsonObject['batch'] === 'object' && 'finished' in jsonObject['batch'])
|
|
425
|
+
{
|
|
426
|
+
batchObject.finished = (function(){
|
|
427
|
+
if(typeof jsonObject['batch'].finished !== 'boolean')
|
|
428
|
+
{
|
|
429
|
+
return Boolean(jsonObject['batch'].finished);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
return jsonObject['batch'].finished;
|
|
433
|
+
}());
|
|
434
|
+
}
|
|
435
|
+
else
|
|
436
|
+
{
|
|
437
|
+
batchObject.finished = false;
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
if(typeof jsonObject['batch'] === 'object' && 'events' in jsonObject['batch'])
|
|
441
|
+
{
|
|
442
|
+
batchObject.events = (function(){
|
|
443
|
+
if(Array.isArray(jsonObject['batch'].events) !== true)
|
|
444
|
+
{
|
|
445
|
+
return [];
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
return jsonObject['batch'].events.map((eventsItem) => {
|
|
449
|
+
return (function(){
|
|
450
|
+
let eventsItemObject = {};
|
|
451
|
+
|
|
452
|
+
if(typeof eventsItem === 'object' && 'id' in eventsItem)
|
|
453
|
+
{
|
|
454
|
+
eventsItemObject.id = (function(){
|
|
455
|
+
if(typeof eventsItem.id !== 'number')
|
|
456
|
+
{
|
|
457
|
+
return Number.isInteger(Number(eventsItem.id)) ? Number(eventsItem.id) : Math.floor(Number(eventsItem.id));
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
return Number.isInteger(eventsItem.id) ? eventsItem.id : Math.floor(eventsItem.id);
|
|
461
|
+
}());
|
|
462
|
+
}
|
|
463
|
+
else
|
|
464
|
+
{
|
|
465
|
+
eventsItemObject.id = 0;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
if(typeof eventsItem === 'object' && 'batchId' in eventsItem)
|
|
469
|
+
{
|
|
470
|
+
eventsItemObject.batchId = (function(){
|
|
471
|
+
if(typeof eventsItem.batchId !== 'number')
|
|
472
|
+
{
|
|
473
|
+
return Number.isInteger(Number(eventsItem.batchId)) ? Number(eventsItem.batchId) : Math.floor(Number(eventsItem.batchId));
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
return Number.isInteger(eventsItem.batchId) ? eventsItem.batchId : Math.floor(eventsItem.batchId);
|
|
477
|
+
}());
|
|
478
|
+
}
|
|
479
|
+
else
|
|
480
|
+
{
|
|
481
|
+
eventsItemObject.batchId = 0;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
if(typeof eventsItem === 'object' && 'type' in eventsItem)
|
|
485
|
+
{
|
|
486
|
+
eventsItemObject.type = (function(){
|
|
487
|
+
if(typeof eventsItem.type !== 'string')
|
|
488
|
+
{
|
|
489
|
+
return String(eventsItem.type);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
return eventsItem.type;
|
|
493
|
+
}());
|
|
494
|
+
}
|
|
495
|
+
else
|
|
496
|
+
{
|
|
497
|
+
eventsItemObject.type = "";
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
if(typeof eventsItem === 'object' && 'details' in eventsItem)
|
|
501
|
+
{
|
|
502
|
+
eventsItemObject.details = (function(){
|
|
503
|
+
if(typeof eventsItem.details !== 'string')
|
|
504
|
+
{
|
|
505
|
+
return String(eventsItem.details);
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
return eventsItem.details;
|
|
509
|
+
}());
|
|
510
|
+
}
|
|
511
|
+
else
|
|
512
|
+
{
|
|
513
|
+
eventsItemObject.details = "";
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
if(typeof eventsItem === 'object' && 'timestamp' in eventsItem)
|
|
517
|
+
{
|
|
518
|
+
eventsItemObject.timestamp = (function(){
|
|
519
|
+
if(typeof eventsItem.timestamp !== 'string')
|
|
520
|
+
{
|
|
521
|
+
return new Date(String(eventsItem.timestamp));
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
return new Date(eventsItem.timestamp);
|
|
525
|
+
}());
|
|
526
|
+
}
|
|
527
|
+
else
|
|
528
|
+
{
|
|
529
|
+
eventsItemObject.timestamp = new Date();
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
if(typeof eventsItem === 'object' && 'runningSeconds' in eventsItem)
|
|
533
|
+
{
|
|
534
|
+
eventsItemObject.runningSeconds = (function(){
|
|
535
|
+
if(typeof eventsItem.runningSeconds !== 'number')
|
|
536
|
+
{
|
|
537
|
+
return Number.isInteger(Number(eventsItem.runningSeconds)) ? Number(eventsItem.runningSeconds) : Math.floor(Number(eventsItem.runningSeconds));
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
return Number.isInteger(eventsItem.runningSeconds) ? eventsItem.runningSeconds : Math.floor(eventsItem.runningSeconds);
|
|
541
|
+
}());
|
|
542
|
+
}
|
|
543
|
+
else
|
|
544
|
+
{
|
|
545
|
+
eventsItemObject.runningSeconds = 0;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
if(typeof eventsItem === 'object' && 'fruitRunningSeconds' in eventsItem)
|
|
549
|
+
{
|
|
550
|
+
eventsItemObject.fruitRunningSeconds = (function(){
|
|
551
|
+
if(typeof eventsItem.fruitRunningSeconds !== 'number')
|
|
552
|
+
{
|
|
553
|
+
return Number.isInteger(Number(eventsItem.fruitRunningSeconds)) ? Number(eventsItem.fruitRunningSeconds) : Math.floor(Number(eventsItem.fruitRunningSeconds));
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
return Number.isInteger(eventsItem.fruitRunningSeconds) ? eventsItem.fruitRunningSeconds : Math.floor(eventsItem.fruitRunningSeconds);
|
|
557
|
+
}());
|
|
558
|
+
}
|
|
559
|
+
else
|
|
560
|
+
{
|
|
561
|
+
eventsItemObject.fruitRunningSeconds = 0;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
return eventsItemObject;
|
|
565
|
+
}());
|
|
566
|
+
});
|
|
567
|
+
}());
|
|
568
|
+
}
|
|
569
|
+
else
|
|
570
|
+
{
|
|
571
|
+
batchObject.events = [];
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
if(typeof jsonObject['batch'] === 'object' && 'sizingMaps' in jsonObject['batch'])
|
|
575
|
+
{
|
|
576
|
+
batchObject.sizingMaps = (function(){
|
|
577
|
+
if(Array.isArray(jsonObject['batch'].sizingMaps) !== true)
|
|
578
|
+
{
|
|
579
|
+
return [];
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
return jsonObject['batch'].sizingMaps.map((sizingMapsItem) => {
|
|
583
|
+
return (function(){
|
|
584
|
+
let sizingMapsItemObject = {};
|
|
585
|
+
|
|
586
|
+
if(typeof sizingMapsItem === 'object' && 'id' in sizingMapsItem)
|
|
587
|
+
{
|
|
588
|
+
sizingMapsItemObject.id = (function(){
|
|
589
|
+
if(typeof sizingMapsItem.id !== 'number')
|
|
590
|
+
{
|
|
591
|
+
return Number.isInteger(Number(sizingMapsItem.id)) ? Number(sizingMapsItem.id) : Math.floor(Number(sizingMapsItem.id));
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
return Number.isInteger(sizingMapsItem.id) ? sizingMapsItem.id : Math.floor(sizingMapsItem.id);
|
|
595
|
+
}());
|
|
596
|
+
}
|
|
597
|
+
else
|
|
598
|
+
{
|
|
599
|
+
sizingMapsItemObject.id = 0;
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
if(typeof sizingMapsItem === 'object' && 'eventId' in sizingMapsItem)
|
|
603
|
+
{
|
|
604
|
+
sizingMapsItemObject.eventId = (function(){
|
|
605
|
+
if(typeof sizingMapsItem.eventId !== 'number')
|
|
606
|
+
{
|
|
607
|
+
return Number.isInteger(Number(sizingMapsItem.eventId)) ? Number(sizingMapsItem.eventId) : Math.floor(Number(sizingMapsItem.eventId));
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
return Number.isInteger(sizingMapsItem.eventId) ? sizingMapsItem.eventId : Math.floor(sizingMapsItem.eventId);
|
|
611
|
+
}());
|
|
612
|
+
}
|
|
613
|
+
else
|
|
614
|
+
{
|
|
615
|
+
sizingMapsItemObject.eventId = 0;
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
if(typeof sizingMapsItem === 'object' && 'varietySizingMapId' in sizingMapsItem)
|
|
619
|
+
{
|
|
620
|
+
sizingMapsItemObject.varietySizingMapId = (function(){
|
|
621
|
+
if(typeof sizingMapsItem.varietySizingMapId !== 'number')
|
|
622
|
+
{
|
|
623
|
+
return Number.isInteger(Number(sizingMapsItem.varietySizingMapId)) ? Number(sizingMapsItem.varietySizingMapId) : Math.floor(Number(sizingMapsItem.varietySizingMapId));
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
return Number.isInteger(sizingMapsItem.varietySizingMapId) ? sizingMapsItem.varietySizingMapId : Math.floor(sizingMapsItem.varietySizingMapId);
|
|
627
|
+
}());
|
|
628
|
+
}
|
|
629
|
+
else
|
|
630
|
+
{
|
|
631
|
+
sizingMapsItemObject.varietySizingMapId = 0;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
if(typeof sizingMapsItem === 'object' && 'name' in sizingMapsItem)
|
|
635
|
+
{
|
|
636
|
+
sizingMapsItemObject.name = (function(){
|
|
637
|
+
if(sizingMapsItem.name === null)
|
|
638
|
+
{
|
|
639
|
+
return null;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
if(typeof sizingMapsItem.name !== 'string')
|
|
643
|
+
{
|
|
644
|
+
return String(sizingMapsItem.name);
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
return sizingMapsItem.name;
|
|
648
|
+
}());
|
|
649
|
+
}
|
|
650
|
+
else
|
|
651
|
+
{
|
|
652
|
+
sizingMapsItemObject.name = null;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
if(typeof sizingMapsItem === 'object' && 'fruitSizes' in sizingMapsItem)
|
|
656
|
+
{
|
|
657
|
+
sizingMapsItemObject.fruitSizes = (function(){
|
|
658
|
+
if(Array.isArray(sizingMapsItem.fruitSizes) !== true)
|
|
659
|
+
{
|
|
660
|
+
return [];
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
return sizingMapsItem.fruitSizes.map((fruitSizesItem) => {
|
|
664
|
+
return (function(){
|
|
665
|
+
let fruitSizesItemObject = {};
|
|
666
|
+
|
|
667
|
+
if(typeof fruitSizesItem === 'object' && 'id' in fruitSizesItem)
|
|
668
|
+
{
|
|
669
|
+
fruitSizesItemObject.id = (function(){
|
|
670
|
+
if(typeof fruitSizesItem.id !== 'number')
|
|
671
|
+
{
|
|
672
|
+
return Number.isInteger(Number(fruitSizesItem.id)) ? Number(fruitSizesItem.id) : Math.floor(Number(fruitSizesItem.id));
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
return Number.isInteger(fruitSizesItem.id) ? fruitSizesItem.id : Math.floor(fruitSizesItem.id);
|
|
676
|
+
}());
|
|
677
|
+
}
|
|
678
|
+
else
|
|
679
|
+
{
|
|
680
|
+
fruitSizesItemObject.id = 0;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
if(typeof fruitSizesItem === 'object' && 'eventId' in fruitSizesItem)
|
|
684
|
+
{
|
|
685
|
+
fruitSizesItemObject.eventId = (function(){
|
|
686
|
+
if(typeof fruitSizesItem.eventId !== 'number')
|
|
687
|
+
{
|
|
688
|
+
return Number.isInteger(Number(fruitSizesItem.eventId)) ? Number(fruitSizesItem.eventId) : Math.floor(Number(fruitSizesItem.eventId));
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
return Number.isInteger(fruitSizesItem.eventId) ? fruitSizesItem.eventId : Math.floor(fruitSizesItem.eventId);
|
|
692
|
+
}());
|
|
693
|
+
}
|
|
694
|
+
else
|
|
695
|
+
{
|
|
696
|
+
fruitSizesItemObject.eventId = 0;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
if(typeof fruitSizesItem === 'object' && 'index' in fruitSizesItem)
|
|
700
|
+
{
|
|
701
|
+
fruitSizesItemObject.index = (function(){
|
|
702
|
+
if(typeof fruitSizesItem.index !== 'number')
|
|
703
|
+
{
|
|
704
|
+
return Number.isInteger(Number(fruitSizesItem.index)) ? Number(fruitSizesItem.index) : Math.floor(Number(fruitSizesItem.index));
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
return Number.isInteger(fruitSizesItem.index) ? fruitSizesItem.index : Math.floor(fruitSizesItem.index);
|
|
708
|
+
}());
|
|
709
|
+
}
|
|
710
|
+
else
|
|
711
|
+
{
|
|
712
|
+
fruitSizesItemObject.index = 0;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
if(typeof fruitSizesItem === 'object' && 'name' in fruitSizesItem)
|
|
716
|
+
{
|
|
717
|
+
fruitSizesItemObject.name = (function(){
|
|
718
|
+
if(fruitSizesItem.name === null)
|
|
719
|
+
{
|
|
720
|
+
return null;
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if(typeof fruitSizesItem.name !== 'string')
|
|
724
|
+
{
|
|
725
|
+
return String(fruitSizesItem.name);
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
return fruitSizesItem.name;
|
|
729
|
+
}());
|
|
730
|
+
}
|
|
731
|
+
else
|
|
732
|
+
{
|
|
733
|
+
fruitSizesItemObject.name = null;
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
if(typeof fruitSizesItem === 'object' && 'minimumFruitWeight' in fruitSizesItem)
|
|
737
|
+
{
|
|
738
|
+
fruitSizesItemObject.minimumFruitWeight = (function(){
|
|
739
|
+
if(typeof fruitSizesItem.minimumFruitWeight !== 'number')
|
|
740
|
+
{
|
|
741
|
+
return Number(fruitSizesItem.minimumFruitWeight);
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
return fruitSizesItem.minimumFruitWeight;
|
|
745
|
+
}());
|
|
746
|
+
}
|
|
747
|
+
else
|
|
748
|
+
{
|
|
749
|
+
fruitSizesItemObject.minimumFruitWeight = 0;
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
if(typeof fruitSizesItem === 'object' && 'fruitCount' in fruitSizesItem)
|
|
753
|
+
{
|
|
754
|
+
fruitSizesItemObject.fruitCount = (function(){
|
|
755
|
+
if(typeof fruitSizesItem.fruitCount !== 'number')
|
|
756
|
+
{
|
|
757
|
+
return Number.isInteger(Number(fruitSizesItem.fruitCount)) ? Number(fruitSizesItem.fruitCount) : Math.floor(Number(fruitSizesItem.fruitCount));
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
return Number.isInteger(fruitSizesItem.fruitCount) ? fruitSizesItem.fruitCount : Math.floor(fruitSizesItem.fruitCount);
|
|
761
|
+
}());
|
|
762
|
+
}
|
|
763
|
+
else
|
|
764
|
+
{
|
|
765
|
+
fruitSizesItemObject.fruitCount = 0;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
if(typeof fruitSizesItem === 'object' && 'minimumTrayWeight' in fruitSizesItem)
|
|
769
|
+
{
|
|
770
|
+
fruitSizesItemObject.minimumTrayWeight = (function(){
|
|
771
|
+
if(typeof fruitSizesItem.minimumTrayWeight !== 'number')
|
|
772
|
+
{
|
|
773
|
+
return Number(fruitSizesItem.minimumTrayWeight);
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
return fruitSizesItem.minimumTrayWeight;
|
|
777
|
+
}());
|
|
778
|
+
}
|
|
779
|
+
else
|
|
780
|
+
{
|
|
781
|
+
fruitSizesItemObject.minimumTrayWeight = 0;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
if(typeof fruitSizesItem === 'object' && 'varietySizingMapId' in fruitSizesItem)
|
|
785
|
+
{
|
|
786
|
+
fruitSizesItemObject.varietySizingMapId = (function(){
|
|
787
|
+
if(typeof fruitSizesItem.varietySizingMapId !== 'number')
|
|
788
|
+
{
|
|
789
|
+
return Number.isInteger(Number(fruitSizesItem.varietySizingMapId)) ? Number(fruitSizesItem.varietySizingMapId) : Math.floor(Number(fruitSizesItem.varietySizingMapId));
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
return Number.isInteger(fruitSizesItem.varietySizingMapId) ? fruitSizesItem.varietySizingMapId : Math.floor(fruitSizesItem.varietySizingMapId);
|
|
793
|
+
}());
|
|
794
|
+
}
|
|
795
|
+
else
|
|
796
|
+
{
|
|
797
|
+
fruitSizesItemObject.varietySizingMapId = 0;
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
return fruitSizesItemObject;
|
|
801
|
+
}());
|
|
802
|
+
});
|
|
803
|
+
}());
|
|
804
|
+
}
|
|
805
|
+
else
|
|
806
|
+
{
|
|
807
|
+
sizingMapsItemObject.fruitSizes = [];
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
return sizingMapsItemObject;
|
|
811
|
+
}());
|
|
812
|
+
});
|
|
813
|
+
}());
|
|
814
|
+
}
|
|
815
|
+
else
|
|
816
|
+
{
|
|
817
|
+
batchObject.sizingMaps = [];
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
if(typeof jsonObject['batch'] === 'object' && 'grades' in jsonObject['batch'])
|
|
821
|
+
{
|
|
822
|
+
batchObject.grades = (function(){
|
|
823
|
+
if(Array.isArray(jsonObject['batch'].grades) !== true)
|
|
824
|
+
{
|
|
825
|
+
return [];
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
return jsonObject['batch'].grades.map((gradesItem) => {
|
|
829
|
+
return (function(){
|
|
830
|
+
let gradesItemObject = {};
|
|
831
|
+
|
|
832
|
+
if(typeof gradesItem === 'object' && 'id' in gradesItem)
|
|
833
|
+
{
|
|
834
|
+
gradesItemObject.id = (function(){
|
|
835
|
+
if(typeof gradesItem.id !== 'number')
|
|
836
|
+
{
|
|
837
|
+
return Number.isInteger(Number(gradesItem.id)) ? Number(gradesItem.id) : Math.floor(Number(gradesItem.id));
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
return Number.isInteger(gradesItem.id) ? gradesItem.id : Math.floor(gradesItem.id);
|
|
841
|
+
}());
|
|
842
|
+
}
|
|
843
|
+
else
|
|
844
|
+
{
|
|
845
|
+
gradesItemObject.id = 0;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
if(typeof gradesItem === 'object' && 'eventId' in gradesItem)
|
|
849
|
+
{
|
|
850
|
+
gradesItemObject.eventId = (function(){
|
|
851
|
+
if(typeof gradesItem.eventId !== 'number')
|
|
852
|
+
{
|
|
853
|
+
return Number.isInteger(Number(gradesItem.eventId)) ? Number(gradesItem.eventId) : Math.floor(Number(gradesItem.eventId));
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
return Number.isInteger(gradesItem.eventId) ? gradesItem.eventId : Math.floor(gradesItem.eventId);
|
|
857
|
+
}());
|
|
858
|
+
}
|
|
859
|
+
else
|
|
860
|
+
{
|
|
861
|
+
gradesItemObject.eventId = 0;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
if(typeof gradesItem === 'object' && 'index' in gradesItem)
|
|
865
|
+
{
|
|
866
|
+
gradesItemObject.index = (function(){
|
|
867
|
+
if(typeof gradesItem.index !== 'number')
|
|
868
|
+
{
|
|
869
|
+
return Number.isInteger(Number(gradesItem.index)) ? Number(gradesItem.index) : Math.floor(Number(gradesItem.index));
|
|
870
|
+
}
|
|
871
|
+
|
|
872
|
+
return Number.isInteger(gradesItem.index) ? gradesItem.index : Math.floor(gradesItem.index);
|
|
873
|
+
}());
|
|
874
|
+
}
|
|
875
|
+
else
|
|
876
|
+
{
|
|
877
|
+
gradesItemObject.index = 0;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
if(typeof gradesItem === 'object' && 'name' in gradesItem)
|
|
881
|
+
{
|
|
882
|
+
gradesItemObject.name = (function(){
|
|
883
|
+
if(gradesItem.name === null)
|
|
884
|
+
{
|
|
885
|
+
return null;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
if(typeof gradesItem.name !== 'string')
|
|
889
|
+
{
|
|
890
|
+
return String(gradesItem.name);
|
|
891
|
+
}
|
|
892
|
+
|
|
893
|
+
return gradesItem.name;
|
|
894
|
+
}());
|
|
895
|
+
}
|
|
896
|
+
else
|
|
897
|
+
{
|
|
898
|
+
gradesItemObject.name = null;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
return gradesItemObject;
|
|
902
|
+
}());
|
|
903
|
+
});
|
|
904
|
+
}());
|
|
905
|
+
}
|
|
906
|
+
else
|
|
907
|
+
{
|
|
908
|
+
batchObject.grades = [];
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
if(typeof jsonObject['batch'] === 'object' && 'qualities' in jsonObject['batch'])
|
|
912
|
+
{
|
|
913
|
+
batchObject.qualities = (function(){
|
|
914
|
+
if(Array.isArray(jsonObject['batch'].qualities) !== true)
|
|
915
|
+
{
|
|
916
|
+
return [];
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
return jsonObject['batch'].qualities.map((qualitiesItem) => {
|
|
920
|
+
return (function(){
|
|
921
|
+
let qualitiesItemObject = {};
|
|
922
|
+
|
|
923
|
+
if(typeof qualitiesItem === 'object' && 'id' in qualitiesItem)
|
|
924
|
+
{
|
|
925
|
+
qualitiesItemObject.id = (function(){
|
|
926
|
+
if(typeof qualitiesItem.id !== 'number')
|
|
927
|
+
{
|
|
928
|
+
return Number.isInteger(Number(qualitiesItem.id)) ? Number(qualitiesItem.id) : Math.floor(Number(qualitiesItem.id));
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
return Number.isInteger(qualitiesItem.id) ? qualitiesItem.id : Math.floor(qualitiesItem.id);
|
|
932
|
+
}());
|
|
933
|
+
}
|
|
934
|
+
else
|
|
935
|
+
{
|
|
936
|
+
qualitiesItemObject.id = 0;
|
|
937
|
+
}
|
|
938
|
+
|
|
939
|
+
if(typeof qualitiesItem === 'object' && 'eventId' in qualitiesItem)
|
|
940
|
+
{
|
|
941
|
+
qualitiesItemObject.eventId = (function(){
|
|
942
|
+
if(typeof qualitiesItem.eventId !== 'number')
|
|
943
|
+
{
|
|
944
|
+
return Number.isInteger(Number(qualitiesItem.eventId)) ? Number(qualitiesItem.eventId) : Math.floor(Number(qualitiesItem.eventId));
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
return Number.isInteger(qualitiesItem.eventId) ? qualitiesItem.eventId : Math.floor(qualitiesItem.eventId);
|
|
948
|
+
}());
|
|
949
|
+
}
|
|
950
|
+
else
|
|
951
|
+
{
|
|
952
|
+
qualitiesItemObject.eventId = 0;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
if(typeof qualitiesItem === 'object' && 'index' in qualitiesItem)
|
|
956
|
+
{
|
|
957
|
+
qualitiesItemObject.index = (function(){
|
|
958
|
+
if(typeof qualitiesItem.index !== 'number')
|
|
959
|
+
{
|
|
960
|
+
return Number.isInteger(Number(qualitiesItem.index)) ? Number(qualitiesItem.index) : Math.floor(Number(qualitiesItem.index));
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
return Number.isInteger(qualitiesItem.index) ? qualitiesItem.index : Math.floor(qualitiesItem.index);
|
|
964
|
+
}());
|
|
965
|
+
}
|
|
966
|
+
else
|
|
967
|
+
{
|
|
968
|
+
qualitiesItemObject.index = 0;
|
|
969
|
+
}
|
|
970
|
+
|
|
971
|
+
if(typeof qualitiesItem === 'object' && 'name' in qualitiesItem)
|
|
972
|
+
{
|
|
973
|
+
qualitiesItemObject.name = (function(){
|
|
974
|
+
if(qualitiesItem.name === null)
|
|
975
|
+
{
|
|
976
|
+
return null;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
if(typeof qualitiesItem.name !== 'string')
|
|
980
|
+
{
|
|
981
|
+
return String(qualitiesItem.name);
|
|
982
|
+
}
|
|
983
|
+
|
|
984
|
+
return qualitiesItem.name;
|
|
985
|
+
}());
|
|
986
|
+
}
|
|
987
|
+
else
|
|
988
|
+
{
|
|
989
|
+
qualitiesItemObject.name = null;
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
return qualitiesItemObject;
|
|
993
|
+
}());
|
|
994
|
+
});
|
|
995
|
+
}());
|
|
996
|
+
}
|
|
997
|
+
else
|
|
998
|
+
{
|
|
999
|
+
batchObject.qualities = [];
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
if(typeof jsonObject['batch'] === 'object' && 'products' in jsonObject['batch'])
|
|
1003
|
+
{
|
|
1004
|
+
batchObject.products = (function(){
|
|
1005
|
+
if(Array.isArray(jsonObject['batch'].products) !== true)
|
|
1006
|
+
{
|
|
1007
|
+
return [];
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
return jsonObject['batch'].products.map((productsItem) => {
|
|
1011
|
+
return (function(){
|
|
1012
|
+
let productsItemObject = {};
|
|
1013
|
+
|
|
1014
|
+
if(typeof productsItem === 'object' && 'id' in productsItem)
|
|
1015
|
+
{
|
|
1016
|
+
productsItemObject.id = (function(){
|
|
1017
|
+
if(typeof productsItem.id !== 'number')
|
|
1018
|
+
{
|
|
1019
|
+
return Number.isInteger(Number(productsItem.id)) ? Number(productsItem.id) : Math.floor(Number(productsItem.id));
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
return Number.isInteger(productsItem.id) ? productsItem.id : Math.floor(productsItem.id);
|
|
1023
|
+
}());
|
|
1024
|
+
}
|
|
1025
|
+
else
|
|
1026
|
+
{
|
|
1027
|
+
productsItemObject.id = 0;
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
if(typeof productsItem === 'object' && 'eventId' in productsItem)
|
|
1031
|
+
{
|
|
1032
|
+
productsItemObject.eventId = (function(){
|
|
1033
|
+
if(typeof productsItem.eventId !== 'number')
|
|
1034
|
+
{
|
|
1035
|
+
return Number.isInteger(Number(productsItem.eventId)) ? Number(productsItem.eventId) : Math.floor(Number(productsItem.eventId));
|
|
1036
|
+
}
|
|
1037
|
+
|
|
1038
|
+
return Number.isInteger(productsItem.eventId) ? productsItem.eventId : Math.floor(productsItem.eventId);
|
|
1039
|
+
}());
|
|
1040
|
+
}
|
|
1041
|
+
else
|
|
1042
|
+
{
|
|
1043
|
+
productsItemObject.eventId = 0;
|
|
1044
|
+
}
|
|
1045
|
+
|
|
1046
|
+
if(typeof productsItem === 'object' && 'guid' in productsItem)
|
|
1047
|
+
{
|
|
1048
|
+
productsItemObject.guid = (function(){
|
|
1049
|
+
if(typeof productsItem.guid !== 'string')
|
|
1050
|
+
{
|
|
1051
|
+
return String(productsItem.guid);
|
|
1052
|
+
}
|
|
1053
|
+
|
|
1054
|
+
return productsItem.guid;
|
|
1055
|
+
}());
|
|
1056
|
+
}
|
|
1057
|
+
else
|
|
1058
|
+
{
|
|
1059
|
+
productsItemObject.guid = "";
|
|
1060
|
+
}
|
|
1061
|
+
|
|
1062
|
+
if(typeof productsItem === 'object' && 'name' in productsItem)
|
|
1063
|
+
{
|
|
1064
|
+
productsItemObject.name = (function(){
|
|
1065
|
+
if(productsItem.name === null)
|
|
1066
|
+
{
|
|
1067
|
+
return null;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
if(typeof productsItem.name !== 'string')
|
|
1071
|
+
{
|
|
1072
|
+
return String(productsItem.name);
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
return productsItem.name;
|
|
1076
|
+
}());
|
|
1077
|
+
}
|
|
1078
|
+
else
|
|
1079
|
+
{
|
|
1080
|
+
productsItemObject.name = null;
|
|
1081
|
+
}
|
|
1082
|
+
|
|
1083
|
+
return productsItemObject;
|
|
1084
|
+
}());
|
|
1085
|
+
});
|
|
1086
|
+
}());
|
|
1087
|
+
}
|
|
1088
|
+
else
|
|
1089
|
+
{
|
|
1090
|
+
batchObject.products = [];
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
if(typeof jsonObject['batch'] === 'object' && 'packs' in jsonObject['batch'])
|
|
1094
|
+
{
|
|
1095
|
+
batchObject.packs = (function(){
|
|
1096
|
+
if(Array.isArray(jsonObject['batch'].packs) !== true)
|
|
1097
|
+
{
|
|
1098
|
+
return [];
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
return jsonObject['batch'].packs.map((packsItem) => {
|
|
1102
|
+
return (function(){
|
|
1103
|
+
let packsItemObject = {};
|
|
1104
|
+
|
|
1105
|
+
if(typeof packsItem === 'object' && 'id' in packsItem)
|
|
1106
|
+
{
|
|
1107
|
+
packsItemObject.id = (function(){
|
|
1108
|
+
if(typeof packsItem.id !== 'number')
|
|
1109
|
+
{
|
|
1110
|
+
return Number.isInteger(Number(packsItem.id)) ? Number(packsItem.id) : Math.floor(Number(packsItem.id));
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
return Number.isInteger(packsItem.id) ? packsItem.id : Math.floor(packsItem.id);
|
|
1114
|
+
}());
|
|
1115
|
+
}
|
|
1116
|
+
else
|
|
1117
|
+
{
|
|
1118
|
+
packsItemObject.id = 0;
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
if(typeof packsItem === 'object' && 'eventId' in packsItem)
|
|
1122
|
+
{
|
|
1123
|
+
packsItemObject.eventId = (function(){
|
|
1124
|
+
if(typeof packsItem.eventId !== 'number')
|
|
1125
|
+
{
|
|
1126
|
+
return Number.isInteger(Number(packsItem.eventId)) ? Number(packsItem.eventId) : Math.floor(Number(packsItem.eventId));
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
return Number.isInteger(packsItem.eventId) ? packsItem.eventId : Math.floor(packsItem.eventId);
|
|
1130
|
+
}());
|
|
1131
|
+
}
|
|
1132
|
+
else
|
|
1133
|
+
{
|
|
1134
|
+
packsItemObject.eventId = 0;
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
if(typeof packsItem === 'object' && 'guid' in packsItem)
|
|
1138
|
+
{
|
|
1139
|
+
packsItemObject.guid = (function(){
|
|
1140
|
+
if(typeof packsItem.guid !== 'string')
|
|
1141
|
+
{
|
|
1142
|
+
return String(packsItem.guid);
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
return packsItem.guid;
|
|
1146
|
+
}());
|
|
1147
|
+
}
|
|
1148
|
+
else
|
|
1149
|
+
{
|
|
1150
|
+
packsItemObject.guid = "";
|
|
1151
|
+
}
|
|
1152
|
+
|
|
1153
|
+
if(typeof packsItem === 'object' && 'name' in packsItem)
|
|
1154
|
+
{
|
|
1155
|
+
packsItemObject.name = (function(){
|
|
1156
|
+
if(packsItem.name === null)
|
|
1157
|
+
{
|
|
1158
|
+
return null;
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
if(typeof packsItem.name !== 'string')
|
|
1162
|
+
{
|
|
1163
|
+
return String(packsItem.name);
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
return packsItem.name;
|
|
1167
|
+
}());
|
|
1168
|
+
}
|
|
1169
|
+
else
|
|
1170
|
+
{
|
|
1171
|
+
packsItemObject.name = null;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
return packsItemObject;
|
|
1175
|
+
}());
|
|
1176
|
+
});
|
|
1177
|
+
}());
|
|
1178
|
+
}
|
|
1179
|
+
else
|
|
1180
|
+
{
|
|
1181
|
+
batchObject.packs = [];
|
|
1182
|
+
}
|
|
1183
|
+
|
|
1184
|
+
if(typeof jsonObject['batch'] === 'object' && 'summaryGroups' in jsonObject['batch'])
|
|
1185
|
+
{
|
|
1186
|
+
batchObject.summaryGroups = (function(){
|
|
1187
|
+
if(Array.isArray(jsonObject['batch'].summaryGroups) !== true)
|
|
1188
|
+
{
|
|
1189
|
+
return [];
|
|
1190
|
+
}
|
|
1191
|
+
|
|
1192
|
+
return jsonObject['batch'].summaryGroups.map((summaryGroupsItem) => {
|
|
1193
|
+
return (function(){
|
|
1194
|
+
let summaryGroupsItemObject = {};
|
|
1195
|
+
|
|
1196
|
+
if(typeof summaryGroupsItem === 'object' && 'id' in summaryGroupsItem)
|
|
1197
|
+
{
|
|
1198
|
+
summaryGroupsItemObject.id = (function(){
|
|
1199
|
+
if(typeof summaryGroupsItem.id !== 'number')
|
|
1200
|
+
{
|
|
1201
|
+
return Number.isInteger(Number(summaryGroupsItem.id)) ? Number(summaryGroupsItem.id) : Math.floor(Number(summaryGroupsItem.id));
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
return Number.isInteger(summaryGroupsItem.id) ? summaryGroupsItem.id : Math.floor(summaryGroupsItem.id);
|
|
1205
|
+
}());
|
|
1206
|
+
}
|
|
1207
|
+
else
|
|
1208
|
+
{
|
|
1209
|
+
summaryGroupsItemObject.id = 0;
|
|
1210
|
+
}
|
|
1211
|
+
|
|
1212
|
+
if(typeof summaryGroupsItem === 'object' && 'name' in summaryGroupsItem)
|
|
1213
|
+
{
|
|
1214
|
+
summaryGroupsItemObject.name = (function(){
|
|
1215
|
+
if(summaryGroupsItem.name === null)
|
|
1216
|
+
{
|
|
1217
|
+
return null;
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
if(typeof summaryGroupsItem.name !== 'string')
|
|
1221
|
+
{
|
|
1222
|
+
return String(summaryGroupsItem.name);
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
return summaryGroupsItem.name;
|
|
1226
|
+
}());
|
|
1227
|
+
}
|
|
1228
|
+
else
|
|
1229
|
+
{
|
|
1230
|
+
summaryGroupsItemObject.name = null;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
if(typeof summaryGroupsItem === 'object' && 'isReject' in summaryGroupsItem)
|
|
1234
|
+
{
|
|
1235
|
+
summaryGroupsItemObject.isReject = (function(){
|
|
1236
|
+
if(typeof summaryGroupsItem.isReject !== 'boolean')
|
|
1237
|
+
{
|
|
1238
|
+
return Boolean(summaryGroupsItem.isReject);
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
return summaryGroupsItem.isReject;
|
|
1242
|
+
}());
|
|
1243
|
+
}
|
|
1244
|
+
else
|
|
1245
|
+
{
|
|
1246
|
+
summaryGroupsItemObject.isReject = false;
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
if(typeof summaryGroupsItem === 'object' && 'orderIndex' in summaryGroupsItem)
|
|
1250
|
+
{
|
|
1251
|
+
summaryGroupsItemObject.orderIndex = (function(){
|
|
1252
|
+
if(typeof summaryGroupsItem.orderIndex !== 'number')
|
|
1253
|
+
{
|
|
1254
|
+
return Number.isInteger(Number(summaryGroupsItem.orderIndex)) ? Number(summaryGroupsItem.orderIndex) : Math.floor(Number(summaryGroupsItem.orderIndex));
|
|
1255
|
+
}
|
|
1256
|
+
|
|
1257
|
+
return Number.isInteger(summaryGroupsItem.orderIndex) ? summaryGroupsItem.orderIndex : Math.floor(summaryGroupsItem.orderIndex);
|
|
1258
|
+
}());
|
|
1259
|
+
}
|
|
1260
|
+
else
|
|
1261
|
+
{
|
|
1262
|
+
summaryGroupsItemObject.orderIndex = 0;
|
|
1263
|
+
}
|
|
1264
|
+
|
|
1265
|
+
return summaryGroupsItemObject;
|
|
1266
|
+
}());
|
|
1267
|
+
});
|
|
1268
|
+
}());
|
|
1269
|
+
}
|
|
1270
|
+
else
|
|
1271
|
+
{
|
|
1272
|
+
batchObject.summaryGroups = [];
|
|
1273
|
+
}
|
|
1274
|
+
|
|
1275
|
+
if(typeof jsonObject['batch'] === 'object' && 'dropSummaries' in jsonObject['batch'])
|
|
1276
|
+
{
|
|
1277
|
+
batchObject.dropSummaries = (function(){
|
|
1278
|
+
if(Array.isArray(jsonObject['batch'].dropSummaries) !== true)
|
|
1279
|
+
{
|
|
1280
|
+
return [];
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
return jsonObject['batch'].dropSummaries.map((dropSummariesItem) => {
|
|
1284
|
+
return (function(){
|
|
1285
|
+
let dropSummariesItemObject = {};
|
|
1286
|
+
|
|
1287
|
+
if(typeof dropSummariesItem === 'object' && 'id' in dropSummariesItem)
|
|
1288
|
+
{
|
|
1289
|
+
dropSummariesItemObject.id = (function(){
|
|
1290
|
+
if(typeof dropSummariesItem.id !== 'number')
|
|
1291
|
+
{
|
|
1292
|
+
return Number.isInteger(Number(dropSummariesItem.id)) ? Number(dropSummariesItem.id) : Math.floor(Number(dropSummariesItem.id));
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
return Number.isInteger(dropSummariesItem.id) ? dropSummariesItem.id : Math.floor(dropSummariesItem.id);
|
|
1296
|
+
}());
|
|
1297
|
+
}
|
|
1298
|
+
else
|
|
1299
|
+
{
|
|
1300
|
+
dropSummariesItemObject.id = 0;
|
|
1301
|
+
}
|
|
1302
|
+
|
|
1303
|
+
if(typeof dropSummariesItem === 'object' && 'eventId' in dropSummariesItem)
|
|
1304
|
+
{
|
|
1305
|
+
dropSummariesItemObject.eventId = (function(){
|
|
1306
|
+
if(typeof dropSummariesItem.eventId !== 'number')
|
|
1307
|
+
{
|
|
1308
|
+
return Number.isInteger(Number(dropSummariesItem.eventId)) ? Number(dropSummariesItem.eventId) : Math.floor(Number(dropSummariesItem.eventId));
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
return Number.isInteger(dropSummariesItem.eventId) ? dropSummariesItem.eventId : Math.floor(dropSummariesItem.eventId);
|
|
1312
|
+
}());
|
|
1313
|
+
}
|
|
1314
|
+
else
|
|
1315
|
+
{
|
|
1316
|
+
dropSummariesItemObject.eventId = 0;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
if(typeof dropSummariesItem === 'object' && 'summaryGroupId' in dropSummariesItem)
|
|
1320
|
+
{
|
|
1321
|
+
dropSummariesItemObject.summaryGroupId = (function(){
|
|
1322
|
+
if(typeof dropSummariesItem.summaryGroupId !== 'number')
|
|
1323
|
+
{
|
|
1324
|
+
return Number.isInteger(Number(dropSummariesItem.summaryGroupId)) ? Number(dropSummariesItem.summaryGroupId) : Math.floor(Number(dropSummariesItem.summaryGroupId));
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
return Number.isInteger(dropSummariesItem.summaryGroupId) ? dropSummariesItem.summaryGroupId : Math.floor(dropSummariesItem.summaryGroupId);
|
|
1328
|
+
}());
|
|
1329
|
+
}
|
|
1330
|
+
else
|
|
1331
|
+
{
|
|
1332
|
+
dropSummariesItemObject.summaryGroupId = 0;
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
if(typeof dropSummariesItem === 'object' && 'productId' in dropSummariesItem)
|
|
1336
|
+
{
|
|
1337
|
+
dropSummariesItemObject.productId = (function(){
|
|
1338
|
+
if(typeof dropSummariesItem.productId !== 'number')
|
|
1339
|
+
{
|
|
1340
|
+
return Number.isInteger(Number(dropSummariesItem.productId)) ? Number(dropSummariesItem.productId) : Math.floor(Number(dropSummariesItem.productId));
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
return Number.isInteger(dropSummariesItem.productId) ? dropSummariesItem.productId : Math.floor(dropSummariesItem.productId);
|
|
1344
|
+
}());
|
|
1345
|
+
}
|
|
1346
|
+
else
|
|
1347
|
+
{
|
|
1348
|
+
dropSummariesItemObject.productId = 0;
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
if(typeof dropSummariesItem === 'object' && 'dropId' in dropSummariesItem)
|
|
1352
|
+
{
|
|
1353
|
+
dropSummariesItemObject.dropId = (function(){
|
|
1354
|
+
if(typeof dropSummariesItem.dropId !== 'number')
|
|
1355
|
+
{
|
|
1356
|
+
return Number.isInteger(Number(dropSummariesItem.dropId)) ? Number(dropSummariesItem.dropId) : Math.floor(Number(dropSummariesItem.dropId));
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
return Number.isInteger(dropSummariesItem.dropId) ? dropSummariesItem.dropId : Math.floor(dropSummariesItem.dropId);
|
|
1360
|
+
}());
|
|
1361
|
+
}
|
|
1362
|
+
else
|
|
1363
|
+
{
|
|
1364
|
+
dropSummariesItemObject.dropId = 0;
|
|
1365
|
+
}
|
|
1366
|
+
|
|
1367
|
+
if(typeof dropSummariesItem === 'object' && 'gradeIndex' in dropSummariesItem)
|
|
1368
|
+
{
|
|
1369
|
+
dropSummariesItemObject.gradeIndex = (function(){
|
|
1370
|
+
if(typeof dropSummariesItem.gradeIndex !== 'number')
|
|
1371
|
+
{
|
|
1372
|
+
return Number.isInteger(Number(dropSummariesItem.gradeIndex)) ? Number(dropSummariesItem.gradeIndex) : Math.floor(Number(dropSummariesItem.gradeIndex));
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
return Number.isInteger(dropSummariesItem.gradeIndex) ? dropSummariesItem.gradeIndex : Math.floor(dropSummariesItem.gradeIndex);
|
|
1376
|
+
}());
|
|
1377
|
+
}
|
|
1378
|
+
else
|
|
1379
|
+
{
|
|
1380
|
+
dropSummariesItemObject.gradeIndex = 0;
|
|
1381
|
+
}
|
|
1382
|
+
|
|
1383
|
+
if(typeof dropSummariesItem === 'object' && 'sizeIndex' in dropSummariesItem)
|
|
1384
|
+
{
|
|
1385
|
+
dropSummariesItemObject.sizeIndex = (function(){
|
|
1386
|
+
if(typeof dropSummariesItem.sizeIndex !== 'number')
|
|
1387
|
+
{
|
|
1388
|
+
return Number.isInteger(Number(dropSummariesItem.sizeIndex)) ? Number(dropSummariesItem.sizeIndex) : Math.floor(Number(dropSummariesItem.sizeIndex));
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1391
|
+
return Number.isInteger(dropSummariesItem.sizeIndex) ? dropSummariesItem.sizeIndex : Math.floor(dropSummariesItem.sizeIndex);
|
|
1392
|
+
}());
|
|
1393
|
+
}
|
|
1394
|
+
else
|
|
1395
|
+
{
|
|
1396
|
+
dropSummariesItemObject.sizeIndex = 0;
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
if(typeof dropSummariesItem === 'object' && 'qualityIndex' in dropSummariesItem)
|
|
1400
|
+
{
|
|
1401
|
+
dropSummariesItemObject.qualityIndex = (function(){
|
|
1402
|
+
if(typeof dropSummariesItem.qualityIndex !== 'number')
|
|
1403
|
+
{
|
|
1404
|
+
return Number.isInteger(Number(dropSummariesItem.qualityIndex)) ? Number(dropSummariesItem.qualityIndex) : Math.floor(Number(dropSummariesItem.qualityIndex));
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
return Number.isInteger(dropSummariesItem.qualityIndex) ? dropSummariesItem.qualityIndex : Math.floor(dropSummariesItem.qualityIndex);
|
|
1408
|
+
}());
|
|
1409
|
+
}
|
|
1410
|
+
else
|
|
1411
|
+
{
|
|
1412
|
+
dropSummariesItemObject.qualityIndex = 0;
|
|
1413
|
+
}
|
|
1414
|
+
|
|
1415
|
+
if(typeof dropSummariesItem === 'object' && 'fruitWeight' in dropSummariesItem)
|
|
1416
|
+
{
|
|
1417
|
+
dropSummariesItemObject.fruitWeight = (function(){
|
|
1418
|
+
if(typeof dropSummariesItem.fruitWeight !== 'number')
|
|
1419
|
+
{
|
|
1420
|
+
return Number(dropSummariesItem.fruitWeight);
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
return dropSummariesItem.fruitWeight;
|
|
1424
|
+
}());
|
|
1425
|
+
}
|
|
1426
|
+
else
|
|
1427
|
+
{
|
|
1428
|
+
dropSummariesItemObject.fruitWeight = 0;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
if(typeof dropSummariesItem === 'object' && 'fruitCount' in dropSummariesItem)
|
|
1432
|
+
{
|
|
1433
|
+
dropSummariesItemObject.fruitCount = (function(){
|
|
1434
|
+
if(typeof dropSummariesItem.fruitCount !== 'number')
|
|
1435
|
+
{
|
|
1436
|
+
return Number.isInteger(Number(dropSummariesItem.fruitCount)) ? Number(dropSummariesItem.fruitCount) : Math.floor(Number(dropSummariesItem.fruitCount));
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
return Number.isInteger(dropSummariesItem.fruitCount) ? dropSummariesItem.fruitCount : Math.floor(dropSummariesItem.fruitCount);
|
|
1440
|
+
}());
|
|
1441
|
+
}
|
|
1442
|
+
else
|
|
1443
|
+
{
|
|
1444
|
+
dropSummariesItemObject.fruitCount = 0;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1447
|
+
if(typeof dropSummariesItem === 'object' && 'varietySizingMapId' in dropSummariesItem)
|
|
1448
|
+
{
|
|
1449
|
+
dropSummariesItemObject.varietySizingMapId = (function(){
|
|
1450
|
+
if(typeof dropSummariesItem.varietySizingMapId !== 'number')
|
|
1451
|
+
{
|
|
1452
|
+
return Number.isInteger(Number(dropSummariesItem.varietySizingMapId)) ? Number(dropSummariesItem.varietySizingMapId) : Math.floor(Number(dropSummariesItem.varietySizingMapId));
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
return Number.isInteger(dropSummariesItem.varietySizingMapId) ? dropSummariesItem.varietySizingMapId : Math.floor(dropSummariesItem.varietySizingMapId);
|
|
1456
|
+
}());
|
|
1457
|
+
}
|
|
1458
|
+
else
|
|
1459
|
+
{
|
|
1460
|
+
dropSummariesItemObject.varietySizingMapId = 0;
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
return dropSummariesItemObject;
|
|
1464
|
+
}());
|
|
1465
|
+
});
|
|
1466
|
+
}());
|
|
1467
|
+
}
|
|
1468
|
+
else
|
|
1469
|
+
{
|
|
1470
|
+
batchObject.dropSummaries = [];
|
|
1471
|
+
}
|
|
1472
|
+
|
|
1473
|
+
if(typeof jsonObject['batch'] === 'object' && 'recycleSummaries' in jsonObject['batch'])
|
|
1474
|
+
{
|
|
1475
|
+
batchObject.recycleSummaries = (function(){
|
|
1476
|
+
if(Array.isArray(jsonObject['batch'].recycleSummaries) !== true)
|
|
1477
|
+
{
|
|
1478
|
+
return [];
|
|
1479
|
+
}
|
|
1480
|
+
|
|
1481
|
+
return jsonObject['batch'].recycleSummaries.map((recycleSummariesItem) => {
|
|
1482
|
+
return (function(){
|
|
1483
|
+
let recycleSummariesItemObject = {};
|
|
1484
|
+
|
|
1485
|
+
if(typeof recycleSummariesItem === 'object' && 'id' in recycleSummariesItem)
|
|
1486
|
+
{
|
|
1487
|
+
recycleSummariesItemObject.id = (function(){
|
|
1488
|
+
if(typeof recycleSummariesItem.id !== 'number')
|
|
1489
|
+
{
|
|
1490
|
+
return Number.isInteger(Number(recycleSummariesItem.id)) ? Number(recycleSummariesItem.id) : Math.floor(Number(recycleSummariesItem.id));
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
return Number.isInteger(recycleSummariesItem.id) ? recycleSummariesItem.id : Math.floor(recycleSummariesItem.id);
|
|
1494
|
+
}());
|
|
1495
|
+
}
|
|
1496
|
+
else
|
|
1497
|
+
{
|
|
1498
|
+
recycleSummariesItemObject.id = 0;
|
|
1499
|
+
}
|
|
1500
|
+
|
|
1501
|
+
if(typeof recycleSummariesItem === 'object' && 'eventId' in recycleSummariesItem)
|
|
1502
|
+
{
|
|
1503
|
+
recycleSummariesItemObject.eventId = (function(){
|
|
1504
|
+
if(typeof recycleSummariesItem.eventId !== 'number')
|
|
1505
|
+
{
|
|
1506
|
+
return Number.isInteger(Number(recycleSummariesItem.eventId)) ? Number(recycleSummariesItem.eventId) : Math.floor(Number(recycleSummariesItem.eventId));
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
return Number.isInteger(recycleSummariesItem.eventId) ? recycleSummariesItem.eventId : Math.floor(recycleSummariesItem.eventId);
|
|
1510
|
+
}());
|
|
1511
|
+
}
|
|
1512
|
+
else
|
|
1513
|
+
{
|
|
1514
|
+
recycleSummariesItemObject.eventId = 0;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
if(typeof recycleSummariesItem === 'object' && 'productId' in recycleSummariesItem)
|
|
1518
|
+
{
|
|
1519
|
+
recycleSummariesItemObject.productId = (function(){
|
|
1520
|
+
if(typeof recycleSummariesItem.productId !== 'number')
|
|
1521
|
+
{
|
|
1522
|
+
return Number.isInteger(Number(recycleSummariesItem.productId)) ? Number(recycleSummariesItem.productId) : Math.floor(Number(recycleSummariesItem.productId));
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
return Number.isInteger(recycleSummariesItem.productId) ? recycleSummariesItem.productId : Math.floor(recycleSummariesItem.productId);
|
|
1526
|
+
}());
|
|
1527
|
+
}
|
|
1528
|
+
else
|
|
1529
|
+
{
|
|
1530
|
+
recycleSummariesItemObject.productId = 0;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
if(typeof recycleSummariesItem === 'object' && 'dropId' in recycleSummariesItem)
|
|
1534
|
+
{
|
|
1535
|
+
recycleSummariesItemObject.dropId = (function(){
|
|
1536
|
+
if(typeof recycleSummariesItem.dropId !== 'number')
|
|
1537
|
+
{
|
|
1538
|
+
return Number.isInteger(Number(recycleSummariesItem.dropId)) ? Number(recycleSummariesItem.dropId) : Math.floor(Number(recycleSummariesItem.dropId));
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
return Number.isInteger(recycleSummariesItem.dropId) ? recycleSummariesItem.dropId : Math.floor(recycleSummariesItem.dropId);
|
|
1542
|
+
}());
|
|
1543
|
+
}
|
|
1544
|
+
else
|
|
1545
|
+
{
|
|
1546
|
+
recycleSummariesItemObject.dropId = 0;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
if(typeof recycleSummariesItem === 'object' && 'gradeIndex' in recycleSummariesItem)
|
|
1550
|
+
{
|
|
1551
|
+
recycleSummariesItemObject.gradeIndex = (function(){
|
|
1552
|
+
if(typeof recycleSummariesItem.gradeIndex !== 'number')
|
|
1553
|
+
{
|
|
1554
|
+
return Number.isInteger(Number(recycleSummariesItem.gradeIndex)) ? Number(recycleSummariesItem.gradeIndex) : Math.floor(Number(recycleSummariesItem.gradeIndex));
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1557
|
+
return Number.isInteger(recycleSummariesItem.gradeIndex) ? recycleSummariesItem.gradeIndex : Math.floor(recycleSummariesItem.gradeIndex);
|
|
1558
|
+
}());
|
|
1559
|
+
}
|
|
1560
|
+
else
|
|
1561
|
+
{
|
|
1562
|
+
recycleSummariesItemObject.gradeIndex = 0;
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
if(typeof recycleSummariesItem === 'object' && 'sizeIndex' in recycleSummariesItem)
|
|
1566
|
+
{
|
|
1567
|
+
recycleSummariesItemObject.sizeIndex = (function(){
|
|
1568
|
+
if(typeof recycleSummariesItem.sizeIndex !== 'number')
|
|
1569
|
+
{
|
|
1570
|
+
return Number.isInteger(Number(recycleSummariesItem.sizeIndex)) ? Number(recycleSummariesItem.sizeIndex) : Math.floor(Number(recycleSummariesItem.sizeIndex));
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
return Number.isInteger(recycleSummariesItem.sizeIndex) ? recycleSummariesItem.sizeIndex : Math.floor(recycleSummariesItem.sizeIndex);
|
|
1574
|
+
}());
|
|
1575
|
+
}
|
|
1576
|
+
else
|
|
1577
|
+
{
|
|
1578
|
+
recycleSummariesItemObject.sizeIndex = 0;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
if(typeof recycleSummariesItem === 'object' && 'qualityIndex' in recycleSummariesItem)
|
|
1582
|
+
{
|
|
1583
|
+
recycleSummariesItemObject.qualityIndex = (function(){
|
|
1584
|
+
if(typeof recycleSummariesItem.qualityIndex !== 'number')
|
|
1585
|
+
{
|
|
1586
|
+
return Number.isInteger(Number(recycleSummariesItem.qualityIndex)) ? Number(recycleSummariesItem.qualityIndex) : Math.floor(Number(recycleSummariesItem.qualityIndex));
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
return Number.isInteger(recycleSummariesItem.qualityIndex) ? recycleSummariesItem.qualityIndex : Math.floor(recycleSummariesItem.qualityIndex);
|
|
1590
|
+
}());
|
|
1591
|
+
}
|
|
1592
|
+
else
|
|
1593
|
+
{
|
|
1594
|
+
recycleSummariesItemObject.qualityIndex = 0;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
if(typeof recycleSummariesItem === 'object' && 'fruitWeight' in recycleSummariesItem)
|
|
1598
|
+
{
|
|
1599
|
+
recycleSummariesItemObject.fruitWeight = (function(){
|
|
1600
|
+
if(typeof recycleSummariesItem.fruitWeight !== 'number')
|
|
1601
|
+
{
|
|
1602
|
+
return Number(recycleSummariesItem.fruitWeight);
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
return recycleSummariesItem.fruitWeight;
|
|
1606
|
+
}());
|
|
1607
|
+
}
|
|
1608
|
+
else
|
|
1609
|
+
{
|
|
1610
|
+
recycleSummariesItemObject.fruitWeight = 0;
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
if(typeof recycleSummariesItem === 'object' && 'fruitCount' in recycleSummariesItem)
|
|
1614
|
+
{
|
|
1615
|
+
recycleSummariesItemObject.fruitCount = (function(){
|
|
1616
|
+
if(typeof recycleSummariesItem.fruitCount !== 'number')
|
|
1617
|
+
{
|
|
1618
|
+
return Number.isInteger(Number(recycleSummariesItem.fruitCount)) ? Number(recycleSummariesItem.fruitCount) : Math.floor(Number(recycleSummariesItem.fruitCount));
|
|
1619
|
+
}
|
|
1620
|
+
|
|
1621
|
+
return Number.isInteger(recycleSummariesItem.fruitCount) ? recycleSummariesItem.fruitCount : Math.floor(recycleSummariesItem.fruitCount);
|
|
1622
|
+
}());
|
|
1623
|
+
}
|
|
1624
|
+
else
|
|
1625
|
+
{
|
|
1626
|
+
recycleSummariesItemObject.fruitCount = 0;
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
if(typeof recycleSummariesItem === 'object' && 'varietySizingMapId' in recycleSummariesItem)
|
|
1630
|
+
{
|
|
1631
|
+
recycleSummariesItemObject.varietySizingMapId = (function(){
|
|
1632
|
+
if(typeof recycleSummariesItem.varietySizingMapId !== 'number')
|
|
1633
|
+
{
|
|
1634
|
+
return Number.isInteger(Number(recycleSummariesItem.varietySizingMapId)) ? Number(recycleSummariesItem.varietySizingMapId) : Math.floor(Number(recycleSummariesItem.varietySizingMapId));
|
|
1635
|
+
}
|
|
1636
|
+
|
|
1637
|
+
return Number.isInteger(recycleSummariesItem.varietySizingMapId) ? recycleSummariesItem.varietySizingMapId : Math.floor(recycleSummariesItem.varietySizingMapId);
|
|
1638
|
+
}());
|
|
1639
|
+
}
|
|
1640
|
+
else
|
|
1641
|
+
{
|
|
1642
|
+
recycleSummariesItemObject.varietySizingMapId = 0;
|
|
1643
|
+
}
|
|
1644
|
+
|
|
1645
|
+
return recycleSummariesItemObject;
|
|
1646
|
+
}());
|
|
1647
|
+
});
|
|
1648
|
+
}());
|
|
1649
|
+
}
|
|
1650
|
+
else
|
|
1651
|
+
{
|
|
1652
|
+
batchObject.recycleSummaries = [];
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
if(typeof jsonObject['batch'] === 'object' && 'packSummaries' in jsonObject['batch'])
|
|
1656
|
+
{
|
|
1657
|
+
batchObject.packSummaries = (function(){
|
|
1658
|
+
if(Array.isArray(jsonObject['batch'].packSummaries) !== true)
|
|
1659
|
+
{
|
|
1660
|
+
return [];
|
|
1661
|
+
}
|
|
1662
|
+
|
|
1663
|
+
return jsonObject['batch'].packSummaries.map((packSummariesItem) => {
|
|
1664
|
+
return (function(){
|
|
1665
|
+
let packSummariesItemObject = {};
|
|
1666
|
+
|
|
1667
|
+
if(typeof packSummariesItem === 'object' && 'id' in packSummariesItem)
|
|
1668
|
+
{
|
|
1669
|
+
packSummariesItemObject.id = (function(){
|
|
1670
|
+
if(typeof packSummariesItem.id !== 'number')
|
|
1671
|
+
{
|
|
1672
|
+
return Number.isInteger(Number(packSummariesItem.id)) ? Number(packSummariesItem.id) : Math.floor(Number(packSummariesItem.id));
|
|
1673
|
+
}
|
|
1674
|
+
|
|
1675
|
+
return Number.isInteger(packSummariesItem.id) ? packSummariesItem.id : Math.floor(packSummariesItem.id);
|
|
1676
|
+
}());
|
|
1677
|
+
}
|
|
1678
|
+
else
|
|
1679
|
+
{
|
|
1680
|
+
packSummariesItemObject.id = 0;
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
if(typeof packSummariesItem === 'object' && 'eventId' in packSummariesItem)
|
|
1684
|
+
{
|
|
1685
|
+
packSummariesItemObject.eventId = (function(){
|
|
1686
|
+
if(typeof packSummariesItem.eventId !== 'number')
|
|
1687
|
+
{
|
|
1688
|
+
return Number.isInteger(Number(packSummariesItem.eventId)) ? Number(packSummariesItem.eventId) : Math.floor(Number(packSummariesItem.eventId));
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
return Number.isInteger(packSummariesItem.eventId) ? packSummariesItem.eventId : Math.floor(packSummariesItem.eventId);
|
|
1692
|
+
}());
|
|
1693
|
+
}
|
|
1694
|
+
else
|
|
1695
|
+
{
|
|
1696
|
+
packSummariesItemObject.eventId = 0;
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
if(typeof packSummariesItem === 'object' && 'summaryGroupId' in packSummariesItem)
|
|
1700
|
+
{
|
|
1701
|
+
packSummariesItemObject.summaryGroupId = (function(){
|
|
1702
|
+
if(typeof packSummariesItem.summaryGroupId !== 'number')
|
|
1703
|
+
{
|
|
1704
|
+
return Number.isInteger(Number(packSummariesItem.summaryGroupId)) ? Number(packSummariesItem.summaryGroupId) : Math.floor(Number(packSummariesItem.summaryGroupId));
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
return Number.isInteger(packSummariesItem.summaryGroupId) ? packSummariesItem.summaryGroupId : Math.floor(packSummariesItem.summaryGroupId);
|
|
1708
|
+
}());
|
|
1709
|
+
}
|
|
1710
|
+
else
|
|
1711
|
+
{
|
|
1712
|
+
packSummariesItemObject.summaryGroupId = 0;
|
|
1713
|
+
}
|
|
1714
|
+
|
|
1715
|
+
if(typeof packSummariesItem === 'object' && 'productId' in packSummariesItem)
|
|
1716
|
+
{
|
|
1717
|
+
packSummariesItemObject.productId = (function(){
|
|
1718
|
+
if(typeof packSummariesItem.productId !== 'number')
|
|
1719
|
+
{
|
|
1720
|
+
return Number.isInteger(Number(packSummariesItem.productId)) ? Number(packSummariesItem.productId) : Math.floor(Number(packSummariesItem.productId));
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
return Number.isInteger(packSummariesItem.productId) ? packSummariesItem.productId : Math.floor(packSummariesItem.productId);
|
|
1724
|
+
}());
|
|
1725
|
+
}
|
|
1726
|
+
else
|
|
1727
|
+
{
|
|
1728
|
+
packSummariesItemObject.productId = 0;
|
|
1729
|
+
}
|
|
1730
|
+
|
|
1731
|
+
if(typeof packSummariesItem === 'object' && 'packId' in packSummariesItem)
|
|
1732
|
+
{
|
|
1733
|
+
packSummariesItemObject.packId = (function(){
|
|
1734
|
+
if(typeof packSummariesItem.packId !== 'number')
|
|
1735
|
+
{
|
|
1736
|
+
return Number.isInteger(Number(packSummariesItem.packId)) ? Number(packSummariesItem.packId) : Math.floor(Number(packSummariesItem.packId));
|
|
1737
|
+
}
|
|
1738
|
+
|
|
1739
|
+
return Number.isInteger(packSummariesItem.packId) ? packSummariesItem.packId : Math.floor(packSummariesItem.packId);
|
|
1740
|
+
}());
|
|
1741
|
+
}
|
|
1742
|
+
else
|
|
1743
|
+
{
|
|
1744
|
+
packSummariesItemObject.packId = 0;
|
|
1745
|
+
}
|
|
1746
|
+
|
|
1747
|
+
if(typeof packSummariesItem === 'object' && 'packCount' in packSummariesItem)
|
|
1748
|
+
{
|
|
1749
|
+
packSummariesItemObject.packCount = (function(){
|
|
1750
|
+
if(typeof packSummariesItem.packCount !== 'number')
|
|
1751
|
+
{
|
|
1752
|
+
return Number.isInteger(Number(packSummariesItem.packCount)) ? Number(packSummariesItem.packCount) : Math.floor(Number(packSummariesItem.packCount));
|
|
1753
|
+
}
|
|
1754
|
+
|
|
1755
|
+
return Number.isInteger(packSummariesItem.packCount) ? packSummariesItem.packCount : Math.floor(packSummariesItem.packCount);
|
|
1756
|
+
}());
|
|
1757
|
+
}
|
|
1758
|
+
else
|
|
1759
|
+
{
|
|
1760
|
+
packSummariesItemObject.packCount = 0;
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
if(typeof packSummariesItem === 'object' && 'fruitWeight' in packSummariesItem)
|
|
1764
|
+
{
|
|
1765
|
+
packSummariesItemObject.fruitWeight = (function(){
|
|
1766
|
+
if(typeof packSummariesItem.fruitWeight !== 'number')
|
|
1767
|
+
{
|
|
1768
|
+
return Number(packSummariesItem.fruitWeight);
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
return packSummariesItem.fruitWeight;
|
|
1772
|
+
}());
|
|
1773
|
+
}
|
|
1774
|
+
else
|
|
1775
|
+
{
|
|
1776
|
+
packSummariesItemObject.fruitWeight = 0;
|
|
1777
|
+
}
|
|
1778
|
+
|
|
1779
|
+
if(typeof packSummariesItem === 'object' && 'fruitCount' in packSummariesItem)
|
|
1780
|
+
{
|
|
1781
|
+
packSummariesItemObject.fruitCount = (function(){
|
|
1782
|
+
if(typeof packSummariesItem.fruitCount !== 'number')
|
|
1783
|
+
{
|
|
1784
|
+
return Number.isInteger(Number(packSummariesItem.fruitCount)) ? Number(packSummariesItem.fruitCount) : Math.floor(Number(packSummariesItem.fruitCount));
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
return Number.isInteger(packSummariesItem.fruitCount) ? packSummariesItem.fruitCount : Math.floor(packSummariesItem.fruitCount);
|
|
1788
|
+
}());
|
|
1789
|
+
}
|
|
1790
|
+
else
|
|
1791
|
+
{
|
|
1792
|
+
packSummariesItemObject.fruitCount = 0;
|
|
1793
|
+
}
|
|
1794
|
+
|
|
1795
|
+
return packSummariesItemObject;
|
|
1796
|
+
}());
|
|
1797
|
+
});
|
|
1798
|
+
}());
|
|
1799
|
+
}
|
|
1800
|
+
else
|
|
1801
|
+
{
|
|
1802
|
+
batchObject.packSummaries = [];
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
if(typeof jsonObject['batch'] === 'object' && 'drops' in jsonObject['batch'])
|
|
1806
|
+
{
|
|
1807
|
+
batchObject.drops = (function(){
|
|
1808
|
+
if(Array.isArray(jsonObject['batch'].drops) !== true)
|
|
1809
|
+
{
|
|
1810
|
+
return [];
|
|
1811
|
+
}
|
|
1812
|
+
|
|
1813
|
+
return jsonObject['batch'].drops.map((dropsItem) => {
|
|
1814
|
+
return (function(){
|
|
1815
|
+
let dropsItemObject = {};
|
|
1816
|
+
|
|
1817
|
+
if(typeof dropsItem === 'object' && 'id' in dropsItem)
|
|
1818
|
+
{
|
|
1819
|
+
dropsItemObject.id = (function(){
|
|
1820
|
+
if(typeof dropsItem.id !== 'number')
|
|
1821
|
+
{
|
|
1822
|
+
return Number.isInteger(Number(dropsItem.id)) ? Number(dropsItem.id) : Math.floor(Number(dropsItem.id));
|
|
1823
|
+
}
|
|
1824
|
+
|
|
1825
|
+
return Number.isInteger(dropsItem.id) ? dropsItem.id : Math.floor(dropsItem.id);
|
|
1826
|
+
}());
|
|
1827
|
+
}
|
|
1828
|
+
else
|
|
1829
|
+
{
|
|
1830
|
+
dropsItemObject.id = 0;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
if(typeof dropsItem === 'object' && 'name' in dropsItem)
|
|
1834
|
+
{
|
|
1835
|
+
dropsItemObject.name = (function(){
|
|
1836
|
+
if(dropsItem.name === null)
|
|
1837
|
+
{
|
|
1838
|
+
return null;
|
|
1839
|
+
}
|
|
1840
|
+
|
|
1841
|
+
if(typeof dropsItem.name !== 'string')
|
|
1842
|
+
{
|
|
1843
|
+
return String(dropsItem.name);
|
|
1844
|
+
}
|
|
1845
|
+
|
|
1846
|
+
return dropsItem.name;
|
|
1847
|
+
}());
|
|
1848
|
+
}
|
|
1849
|
+
else
|
|
1850
|
+
{
|
|
1851
|
+
dropsItemObject.name = null;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
if(typeof dropsItem === 'object' && 'totallingEnabled' in dropsItem)
|
|
1855
|
+
{
|
|
1856
|
+
dropsItemObject.totallingEnabled = (function(){
|
|
1857
|
+
if(typeof dropsItem.totallingEnabled !== 'boolean')
|
|
1858
|
+
{
|
|
1859
|
+
return Boolean(dropsItem.totallingEnabled);
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
return dropsItem.totallingEnabled;
|
|
1863
|
+
}());
|
|
1864
|
+
}
|
|
1865
|
+
else
|
|
1866
|
+
{
|
|
1867
|
+
dropsItemObject.totallingEnabled = false;
|
|
1868
|
+
}
|
|
1869
|
+
|
|
1870
|
+
return dropsItemObject;
|
|
1871
|
+
}());
|
|
1872
|
+
});
|
|
1873
|
+
}());
|
|
1874
|
+
}
|
|
1875
|
+
else
|
|
1876
|
+
{
|
|
1877
|
+
batchObject.drops = [];
|
|
201
1878
|
}
|
|
202
1879
|
|
|
203
|
-
return
|
|
1880
|
+
return batchObject;
|
|
204
1881
|
}());
|
|
205
1882
|
}
|
|
206
1883
|
|