@ricado/api-client 2.5.18 → 2.6.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.
@@ -73,6 +73,14 @@ class MAFSizerPackrunSummaryModel extends BaseModel
73
73
  */
74
74
  this.classTypeSummaries = [];
75
75
 
76
+ /**
77
+ * An Array of Packrun Summary Data Objects for each Outlet
78
+ *
79
+ * @type {Array<{name: string, type: string, number: number, totals: Array<{classType: ?string, fruitSize: string, packType: ?string, weight: number, fruitCount: number, packCount: ?number}>}>}
80
+ * @public
81
+ */
82
+ this.outletSummaries = [];
83
+
76
84
  /**
77
85
  * An Array that contains the Articles initially Assigned to each Outlet
78
86
  *
@@ -354,6 +362,205 @@ class MAFSizerPackrunSummaryModel extends BaseModel
354
362
  }());
355
363
  }
356
364
 
365
+ if('outletSummaries' in jsonObject)
366
+ {
367
+ model.outletSummaries = (function(){
368
+ if(Array.isArray(jsonObject['outletSummaries']) !== true)
369
+ {
370
+ return [];
371
+ }
372
+
373
+ return jsonObject['outletSummaries'].map((outletSummariesItem) => {
374
+ return (function(){
375
+ let outletSummariesItemObject = {};
376
+
377
+ if(typeof outletSummariesItem === 'object' && 'name' in outletSummariesItem)
378
+ {
379
+ outletSummariesItemObject.name = (function(){
380
+ if(typeof outletSummariesItem.name !== 'string')
381
+ {
382
+ return String(outletSummariesItem.name);
383
+ }
384
+
385
+ return outletSummariesItem.name;
386
+ }());
387
+ }
388
+ else
389
+ {
390
+ outletSummariesItemObject.name = "";
391
+ }
392
+
393
+ if(typeof outletSummariesItem === 'object' && 'type' in outletSummariesItem)
394
+ {
395
+ outletSummariesItemObject.type = (function(){
396
+ if(typeof outletSummariesItem.type !== 'string')
397
+ {
398
+ return String(outletSummariesItem.type);
399
+ }
400
+
401
+ return outletSummariesItem.type;
402
+ }());
403
+ }
404
+ else
405
+ {
406
+ outletSummariesItemObject.type = "";
407
+ }
408
+
409
+ if(typeof outletSummariesItem === 'object' && 'number' in outletSummariesItem)
410
+ {
411
+ outletSummariesItemObject.number = (function(){
412
+ if(typeof outletSummariesItem.number !== 'number')
413
+ {
414
+ return Number.isInteger(Number(outletSummariesItem.number)) ? Number(outletSummariesItem.number) : Math.floor(Number(outletSummariesItem.number));
415
+ }
416
+
417
+ return Number.isInteger(outletSummariesItem.number) ? outletSummariesItem.number : Math.floor(outletSummariesItem.number);
418
+ }());
419
+ }
420
+ else
421
+ {
422
+ outletSummariesItemObject.number = 0;
423
+ }
424
+
425
+ if(typeof outletSummariesItem === 'object' && 'totals' in outletSummariesItem)
426
+ {
427
+ outletSummariesItemObject.totals = (function(){
428
+ if(Array.isArray(outletSummariesItem.totals) !== true)
429
+ {
430
+ return [];
431
+ }
432
+
433
+ return outletSummariesItem.totals.map((totalsItem) => {
434
+ return (function(){
435
+ let totalsItemObject = {};
436
+
437
+ if(typeof totalsItem === 'object' && 'classType' in totalsItem)
438
+ {
439
+ totalsItemObject.classType = (function(){
440
+ if(totalsItem.classType === null)
441
+ {
442
+ return null;
443
+ }
444
+
445
+ if(typeof totalsItem.classType !== 'string')
446
+ {
447
+ return String(totalsItem.classType);
448
+ }
449
+
450
+ return totalsItem.classType;
451
+ }());
452
+ }
453
+ else
454
+ {
455
+ totalsItemObject.classType = null;
456
+ }
457
+
458
+ if(typeof totalsItem === 'object' && 'fruitSize' in totalsItem)
459
+ {
460
+ totalsItemObject.fruitSize = (function(){
461
+ if(typeof totalsItem.fruitSize !== 'string')
462
+ {
463
+ return String(totalsItem.fruitSize);
464
+ }
465
+
466
+ return totalsItem.fruitSize;
467
+ }());
468
+ }
469
+ else
470
+ {
471
+ totalsItemObject.fruitSize = "";
472
+ }
473
+
474
+ if(typeof totalsItem === 'object' && 'packType' in totalsItem)
475
+ {
476
+ totalsItemObject.packType = (function(){
477
+ if(totalsItem.packType === null)
478
+ {
479
+ return null;
480
+ }
481
+
482
+ if(typeof totalsItem.packType !== 'string')
483
+ {
484
+ return String(totalsItem.packType);
485
+ }
486
+
487
+ return totalsItem.packType;
488
+ }());
489
+ }
490
+ else
491
+ {
492
+ totalsItemObject.packType = null;
493
+ }
494
+
495
+ if(typeof totalsItem === 'object' && 'weight' in totalsItem)
496
+ {
497
+ totalsItemObject.weight = (function(){
498
+ if(typeof totalsItem.weight !== 'number')
499
+ {
500
+ return Number(totalsItem.weight);
501
+ }
502
+
503
+ return totalsItem.weight;
504
+ }());
505
+ }
506
+ else
507
+ {
508
+ totalsItemObject.weight = 0;
509
+ }
510
+
511
+ if(typeof totalsItem === 'object' && 'fruitCount' in totalsItem)
512
+ {
513
+ totalsItemObject.fruitCount = (function(){
514
+ if(typeof totalsItem.fruitCount !== 'number')
515
+ {
516
+ return Number.isInteger(Number(totalsItem.fruitCount)) ? Number(totalsItem.fruitCount) : Math.floor(Number(totalsItem.fruitCount));
517
+ }
518
+
519
+ return Number.isInteger(totalsItem.fruitCount) ? totalsItem.fruitCount : Math.floor(totalsItem.fruitCount);
520
+ }());
521
+ }
522
+ else
523
+ {
524
+ totalsItemObject.fruitCount = 0;
525
+ }
526
+
527
+ if(typeof totalsItem === 'object' && 'packCount' in totalsItem)
528
+ {
529
+ totalsItemObject.packCount = (function(){
530
+ if(totalsItem.packCount === null)
531
+ {
532
+ return null;
533
+ }
534
+
535
+ if(typeof totalsItem.packCount !== 'number')
536
+ {
537
+ return Number(totalsItem.packCount);
538
+ }
539
+
540
+ return totalsItem.packCount;
541
+ }());
542
+ }
543
+ else
544
+ {
545
+ totalsItemObject.packCount = null;
546
+ }
547
+
548
+ return totalsItemObject;
549
+ }());
550
+ });
551
+ }());
552
+ }
553
+ else
554
+ {
555
+ outletSummariesItemObject.totals = [];
556
+ }
557
+
558
+ return outletSummariesItemObject;
559
+ }());
560
+ });
561
+ }());
562
+ }
563
+
357
564
  if('initialOutletArticles' in jsonObject)
358
565
  {
359
566
  model.initialOutletArticles = (function(){
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '2.5.18';
2
+ export const version = '2.6.0';