@ricado/api-client 2.5.16 → 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.
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Lab/Site/FruitProfileController.js +16 -0
- package/lib/Controllers/Lab/Site/SampleController.js +8 -0
- package/lib/Controllers/Packhouse/Site/MAFSizerBatchController.js +46 -1
- package/lib/Controllers/Packhouse/Site/MAFSizerPackrunSummaryController.js +26 -0
- package/lib/Controllers/Packhouse/Site/PackrunController.js +73 -0
- package/lib/Models/Lab/Site/FruitProfileModel.js +144 -0
- package/lib/Models/Lab/Site/SampleModel.js +88 -0
- package/lib/Models/Packhouse/Site/MAFSizerBatchModel.js +321 -15
- package/lib/Models/Packhouse/Site/MAFSizerPackrunSummaryModel.js +162 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +441 -6
- package/package.json +1 -1
- package/src/Controllers/Lab/Site/FruitProfileController.js +16 -0
- package/src/Controllers/Lab/Site/SampleController.js +8 -0
- package/src/Controllers/Packhouse/Site/MAFSizerBatchController.js +46 -1
- package/src/Controllers/Packhouse/Site/MAFSizerPackrunSummaryController.js +26 -0
- package/src/Controllers/Packhouse/Site/PackrunController.js +94 -0
- package/src/Models/Lab/Site/FruitProfileModel.js +160 -0
- package/src/Models/Lab/Site/SampleModel.js +100 -0
- package/src/Models/Packhouse/Site/MAFSizerBatchModel.js +397 -15
- package/src/Models/Packhouse/Site/MAFSizerPackrunSummaryModel.js +207 -0
- package/src/PackageVersion.js +1 -1
|
@@ -143,10 +143,18 @@ var MAFSizerBatchModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
143
143
|
*/
|
|
144
144
|
|
|
145
145
|
_this.packrunId = null;
|
|
146
|
+
/**
|
|
147
|
+
* When the Final Update from the MAF Sizer Orphea Database has been Received
|
|
148
|
+
*
|
|
149
|
+
* @type {?Date}
|
|
150
|
+
* @public
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
_this.finalOrpheaUpdate = null;
|
|
146
154
|
/**
|
|
147
155
|
* An Array of Summary Data Objects for each Article
|
|
148
156
|
*
|
|
149
|
-
* @type {Array<{name: string, fruitCount: number, fruitWeight: number}>}
|
|
157
|
+
* @type {Array<{index: ?number, name: string, fruitCount: number, fruitWeight: number}>}
|
|
150
158
|
* @public
|
|
151
159
|
*/
|
|
152
160
|
|
|
@@ -154,7 +162,7 @@ var MAFSizerBatchModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
154
162
|
/**
|
|
155
163
|
* An Array of Summary Data Objects for each Outlet
|
|
156
164
|
*
|
|
157
|
-
* @type {Array<{number: number, fruitCount: number, fruitWeight: number}>}
|
|
165
|
+
* @type {Array<{number: number, fruitCount: number, fruitWeight: number, seenArticles: number[], activeArticles: number[]}>}
|
|
158
166
|
* @public
|
|
159
167
|
*/
|
|
160
168
|
|
|
@@ -162,11 +170,35 @@ var MAFSizerBatchModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
162
170
|
/**
|
|
163
171
|
* An Array of Summary Data Objects for each Fruit Size and Article
|
|
164
172
|
*
|
|
165
|
-
* @type {Array<{
|
|
173
|
+
* @type {Array<{sizeIndex: number, sizeName: string, articleIndex: number, articleName: string, fruitCount: number, fruitWeight: number}>}
|
|
166
174
|
* @public
|
|
167
175
|
*/
|
|
168
176
|
|
|
169
177
|
_this.fruitSummaries = [];
|
|
178
|
+
/**
|
|
179
|
+
* An Array of Summary Data Objects for each Outlet by Fruit Size and Article
|
|
180
|
+
*
|
|
181
|
+
* @type {Array<{outletNumber: number, sizeIndex: number, sizeName: string, articleIndex: number, articleName: string, fruitCount: number, fruitWeight: number}>}
|
|
182
|
+
* @public
|
|
183
|
+
*/
|
|
184
|
+
|
|
185
|
+
_this.outletFruitSummaries = [];
|
|
186
|
+
/**
|
|
187
|
+
* An Array of Size Names and Indexes
|
|
188
|
+
*
|
|
189
|
+
* @type {Array<{index: number, name: string}>}
|
|
190
|
+
* @public
|
|
191
|
+
*/
|
|
192
|
+
|
|
193
|
+
_this.sizeNames = [];
|
|
194
|
+
/**
|
|
195
|
+
* An Array of Article Names and Indexes
|
|
196
|
+
*
|
|
197
|
+
* @type {Array<{index: number, name: string}>}
|
|
198
|
+
* @public
|
|
199
|
+
*/
|
|
200
|
+
|
|
201
|
+
_this.articleNames = [];
|
|
170
202
|
/**
|
|
171
203
|
* Whether the MAF Sizer Batch has been deleted
|
|
172
204
|
*
|
|
@@ -356,6 +388,20 @@ var MAFSizerBatchModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
356
388
|
}();
|
|
357
389
|
}
|
|
358
390
|
|
|
391
|
+
if ('finalOrpheaUpdate' in jsonObject) {
|
|
392
|
+
model.finalOrpheaUpdate = function () {
|
|
393
|
+
if (jsonObject['finalOrpheaUpdate'] === null) {
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
if (typeof jsonObject['finalOrpheaUpdate'] !== 'string') {
|
|
398
|
+
return new Date(String(jsonObject['finalOrpheaUpdate']));
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
return new Date(jsonObject['finalOrpheaUpdate']);
|
|
402
|
+
}();
|
|
403
|
+
}
|
|
404
|
+
|
|
359
405
|
if ('articleSummaries' in jsonObject) {
|
|
360
406
|
model.articleSummaries = function () {
|
|
361
407
|
if (Array.isArray(jsonObject['articleSummaries']) !== true) {
|
|
@@ -366,6 +412,22 @@ var MAFSizerBatchModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
366
412
|
return function () {
|
|
367
413
|
var articleSummariesItemObject = {};
|
|
368
414
|
|
|
415
|
+
if (_typeof(articleSummariesItem) === 'object' && 'index' in articleSummariesItem) {
|
|
416
|
+
articleSummariesItemObject.index = function () {
|
|
417
|
+
if (articleSummariesItem.index === null) {
|
|
418
|
+
return null;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
if (typeof articleSummariesItem.index !== 'number') {
|
|
422
|
+
return Number.isInteger(Number(articleSummariesItem.index)) ? Number(articleSummariesItem.index) : Math.floor(Number(articleSummariesItem.index));
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return Number.isInteger(articleSummariesItem.index) ? articleSummariesItem.index : Math.floor(articleSummariesItem.index);
|
|
426
|
+
}();
|
|
427
|
+
} else {
|
|
428
|
+
articleSummariesItemObject.index = null;
|
|
429
|
+
}
|
|
430
|
+
|
|
369
431
|
if (_typeof(articleSummariesItem) === 'object' && 'name' in articleSummariesItem) {
|
|
370
432
|
articleSummariesItemObject.name = function () {
|
|
371
433
|
if (typeof articleSummariesItem.name !== 'string') {
|
|
@@ -454,6 +516,46 @@ var MAFSizerBatchModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
454
516
|
outletSummariesItemObject.fruitWeight = 0;
|
|
455
517
|
}
|
|
456
518
|
|
|
519
|
+
if (_typeof(outletSummariesItem) === 'object' && 'seenArticles' in outletSummariesItem) {
|
|
520
|
+
outletSummariesItemObject.seenArticles = function () {
|
|
521
|
+
if (Array.isArray(outletSummariesItem.seenArticles) !== true) {
|
|
522
|
+
return [];
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
return outletSummariesItem.seenArticles.map(function (seenArticlesItem) {
|
|
526
|
+
return function () {
|
|
527
|
+
if (typeof seenArticlesItem !== 'number') {
|
|
528
|
+
return Number.isInteger(Number(seenArticlesItem)) ? Number(seenArticlesItem) : Math.floor(Number(seenArticlesItem));
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
return Number.isInteger(seenArticlesItem) ? seenArticlesItem : Math.floor(seenArticlesItem);
|
|
532
|
+
}();
|
|
533
|
+
});
|
|
534
|
+
}();
|
|
535
|
+
} else {
|
|
536
|
+
outletSummariesItemObject.seenArticles = [];
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
if (_typeof(outletSummariesItem) === 'object' && 'activeArticles' in outletSummariesItem) {
|
|
540
|
+
outletSummariesItemObject.activeArticles = function () {
|
|
541
|
+
if (Array.isArray(outletSummariesItem.activeArticles) !== true) {
|
|
542
|
+
return [];
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return outletSummariesItem.activeArticles.map(function (activeArticlesItem) {
|
|
546
|
+
return function () {
|
|
547
|
+
if (typeof activeArticlesItem !== 'number') {
|
|
548
|
+
return Number.isInteger(Number(activeArticlesItem)) ? Number(activeArticlesItem) : Math.floor(Number(activeArticlesItem));
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
return Number.isInteger(activeArticlesItem) ? activeArticlesItem : Math.floor(activeArticlesItem);
|
|
552
|
+
}();
|
|
553
|
+
});
|
|
554
|
+
}();
|
|
555
|
+
} else {
|
|
556
|
+
outletSummariesItemObject.activeArticles = [];
|
|
557
|
+
}
|
|
558
|
+
|
|
457
559
|
return outletSummariesItemObject;
|
|
458
560
|
}();
|
|
459
561
|
});
|
|
@@ -470,28 +572,52 @@ var MAFSizerBatchModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
470
572
|
return function () {
|
|
471
573
|
var fruitSummariesItemObject = {};
|
|
472
574
|
|
|
473
|
-
if (_typeof(fruitSummariesItem) === 'object' && '
|
|
474
|
-
fruitSummariesItemObject.
|
|
475
|
-
if (typeof fruitSummariesItem.
|
|
476
|
-
return
|
|
575
|
+
if (_typeof(fruitSummariesItem) === 'object' && 'sizeIndex' in fruitSummariesItem) {
|
|
576
|
+
fruitSummariesItemObject.sizeIndex = function () {
|
|
577
|
+
if (typeof fruitSummariesItem.sizeIndex !== 'number') {
|
|
578
|
+
return Number.isInteger(Number(fruitSummariesItem.sizeIndex)) ? Number(fruitSummariesItem.sizeIndex) : Math.floor(Number(fruitSummariesItem.sizeIndex));
|
|
477
579
|
}
|
|
478
580
|
|
|
479
|
-
return fruitSummariesItem.
|
|
581
|
+
return Number.isInteger(fruitSummariesItem.sizeIndex) ? fruitSummariesItem.sizeIndex : Math.floor(fruitSummariesItem.sizeIndex);
|
|
480
582
|
}();
|
|
481
583
|
} else {
|
|
482
|
-
fruitSummariesItemObject.
|
|
584
|
+
fruitSummariesItemObject.sizeIndex = 0;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
if (_typeof(fruitSummariesItem) === 'object' && 'sizeName' in fruitSummariesItem) {
|
|
588
|
+
fruitSummariesItemObject.sizeName = function () {
|
|
589
|
+
if (typeof fruitSummariesItem.sizeName !== 'string') {
|
|
590
|
+
return String(fruitSummariesItem.sizeName);
|
|
591
|
+
}
|
|
592
|
+
|
|
593
|
+
return fruitSummariesItem.sizeName;
|
|
594
|
+
}();
|
|
595
|
+
} else {
|
|
596
|
+
fruitSummariesItemObject.sizeName = "";
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
if (_typeof(fruitSummariesItem) === 'object' && 'articleIndex' in fruitSummariesItem) {
|
|
600
|
+
fruitSummariesItemObject.articleIndex = function () {
|
|
601
|
+
if (typeof fruitSummariesItem.articleIndex !== 'number') {
|
|
602
|
+
return Number.isInteger(Number(fruitSummariesItem.articleIndex)) ? Number(fruitSummariesItem.articleIndex) : Math.floor(Number(fruitSummariesItem.articleIndex));
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
return Number.isInteger(fruitSummariesItem.articleIndex) ? fruitSummariesItem.articleIndex : Math.floor(fruitSummariesItem.articleIndex);
|
|
606
|
+
}();
|
|
607
|
+
} else {
|
|
608
|
+
fruitSummariesItemObject.articleIndex = 0;
|
|
483
609
|
}
|
|
484
610
|
|
|
485
|
-
if (_typeof(fruitSummariesItem) === 'object' && '
|
|
486
|
-
fruitSummariesItemObject.
|
|
487
|
-
if (typeof fruitSummariesItem.
|
|
488
|
-
return String(fruitSummariesItem.
|
|
611
|
+
if (_typeof(fruitSummariesItem) === 'object' && 'articleName' in fruitSummariesItem) {
|
|
612
|
+
fruitSummariesItemObject.articleName = function () {
|
|
613
|
+
if (typeof fruitSummariesItem.articleName !== 'string') {
|
|
614
|
+
return String(fruitSummariesItem.articleName);
|
|
489
615
|
}
|
|
490
616
|
|
|
491
|
-
return fruitSummariesItem.
|
|
617
|
+
return fruitSummariesItem.articleName;
|
|
492
618
|
}();
|
|
493
619
|
} else {
|
|
494
|
-
fruitSummariesItemObject.
|
|
620
|
+
fruitSummariesItemObject.articleName = "";
|
|
495
621
|
}
|
|
496
622
|
|
|
497
623
|
if (_typeof(fruitSummariesItem) === 'object' && 'fruitCount' in fruitSummariesItem) {
|
|
@@ -524,6 +650,186 @@ var MAFSizerBatchModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
524
650
|
}();
|
|
525
651
|
}
|
|
526
652
|
|
|
653
|
+
if ('outletFruitSummaries' in jsonObject) {
|
|
654
|
+
model.outletFruitSummaries = function () {
|
|
655
|
+
if (Array.isArray(jsonObject['outletFruitSummaries']) !== true) {
|
|
656
|
+
return [];
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
return jsonObject['outletFruitSummaries'].map(function (outletFruitSummariesItem) {
|
|
660
|
+
return function () {
|
|
661
|
+
var outletFruitSummariesItemObject = {};
|
|
662
|
+
|
|
663
|
+
if (_typeof(outletFruitSummariesItem) === 'object' && 'outletNumber' in outletFruitSummariesItem) {
|
|
664
|
+
outletFruitSummariesItemObject.outletNumber = function () {
|
|
665
|
+
if (typeof outletFruitSummariesItem.outletNumber !== 'number') {
|
|
666
|
+
return Number.isInteger(Number(outletFruitSummariesItem.outletNumber)) ? Number(outletFruitSummariesItem.outletNumber) : Math.floor(Number(outletFruitSummariesItem.outletNumber));
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
return Number.isInteger(outletFruitSummariesItem.outletNumber) ? outletFruitSummariesItem.outletNumber : Math.floor(outletFruitSummariesItem.outletNumber);
|
|
670
|
+
}();
|
|
671
|
+
} else {
|
|
672
|
+
outletFruitSummariesItemObject.outletNumber = 0;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
if (_typeof(outletFruitSummariesItem) === 'object' && 'sizeIndex' in outletFruitSummariesItem) {
|
|
676
|
+
outletFruitSummariesItemObject.sizeIndex = function () {
|
|
677
|
+
if (typeof outletFruitSummariesItem.sizeIndex !== 'number') {
|
|
678
|
+
return Number.isInteger(Number(outletFruitSummariesItem.sizeIndex)) ? Number(outletFruitSummariesItem.sizeIndex) : Math.floor(Number(outletFruitSummariesItem.sizeIndex));
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
return Number.isInteger(outletFruitSummariesItem.sizeIndex) ? outletFruitSummariesItem.sizeIndex : Math.floor(outletFruitSummariesItem.sizeIndex);
|
|
682
|
+
}();
|
|
683
|
+
} else {
|
|
684
|
+
outletFruitSummariesItemObject.sizeIndex = 0;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
if (_typeof(outletFruitSummariesItem) === 'object' && 'sizeName' in outletFruitSummariesItem) {
|
|
688
|
+
outletFruitSummariesItemObject.sizeName = function () {
|
|
689
|
+
if (typeof outletFruitSummariesItem.sizeName !== 'string') {
|
|
690
|
+
return String(outletFruitSummariesItem.sizeName);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
return outletFruitSummariesItem.sizeName;
|
|
694
|
+
}();
|
|
695
|
+
} else {
|
|
696
|
+
outletFruitSummariesItemObject.sizeName = "";
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
if (_typeof(outletFruitSummariesItem) === 'object' && 'articleIndex' in outletFruitSummariesItem) {
|
|
700
|
+
outletFruitSummariesItemObject.articleIndex = function () {
|
|
701
|
+
if (typeof outletFruitSummariesItem.articleIndex !== 'number') {
|
|
702
|
+
return Number.isInteger(Number(outletFruitSummariesItem.articleIndex)) ? Number(outletFruitSummariesItem.articleIndex) : Math.floor(Number(outletFruitSummariesItem.articleIndex));
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
return Number.isInteger(outletFruitSummariesItem.articleIndex) ? outletFruitSummariesItem.articleIndex : Math.floor(outletFruitSummariesItem.articleIndex);
|
|
706
|
+
}();
|
|
707
|
+
} else {
|
|
708
|
+
outletFruitSummariesItemObject.articleIndex = 0;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
if (_typeof(outletFruitSummariesItem) === 'object' && 'articleName' in outletFruitSummariesItem) {
|
|
712
|
+
outletFruitSummariesItemObject.articleName = function () {
|
|
713
|
+
if (typeof outletFruitSummariesItem.articleName !== 'string') {
|
|
714
|
+
return String(outletFruitSummariesItem.articleName);
|
|
715
|
+
}
|
|
716
|
+
|
|
717
|
+
return outletFruitSummariesItem.articleName;
|
|
718
|
+
}();
|
|
719
|
+
} else {
|
|
720
|
+
outletFruitSummariesItemObject.articleName = "";
|
|
721
|
+
}
|
|
722
|
+
|
|
723
|
+
if (_typeof(outletFruitSummariesItem) === 'object' && 'fruitCount' in outletFruitSummariesItem) {
|
|
724
|
+
outletFruitSummariesItemObject.fruitCount = function () {
|
|
725
|
+
if (typeof outletFruitSummariesItem.fruitCount !== 'number') {
|
|
726
|
+
return Number.isInteger(Number(outletFruitSummariesItem.fruitCount)) ? Number(outletFruitSummariesItem.fruitCount) : Math.floor(Number(outletFruitSummariesItem.fruitCount));
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
return Number.isInteger(outletFruitSummariesItem.fruitCount) ? outletFruitSummariesItem.fruitCount : Math.floor(outletFruitSummariesItem.fruitCount);
|
|
730
|
+
}();
|
|
731
|
+
} else {
|
|
732
|
+
outletFruitSummariesItemObject.fruitCount = 0;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
if (_typeof(outletFruitSummariesItem) === 'object' && 'fruitWeight' in outletFruitSummariesItem) {
|
|
736
|
+
outletFruitSummariesItemObject.fruitWeight = function () {
|
|
737
|
+
if (typeof outletFruitSummariesItem.fruitWeight !== 'number') {
|
|
738
|
+
return Number(outletFruitSummariesItem.fruitWeight);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
return outletFruitSummariesItem.fruitWeight;
|
|
742
|
+
}();
|
|
743
|
+
} else {
|
|
744
|
+
outletFruitSummariesItemObject.fruitWeight = 0;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
return outletFruitSummariesItemObject;
|
|
748
|
+
}();
|
|
749
|
+
});
|
|
750
|
+
}();
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
if ('sizeNames' in jsonObject) {
|
|
754
|
+
model.sizeNames = function () {
|
|
755
|
+
if (Array.isArray(jsonObject['sizeNames']) !== true) {
|
|
756
|
+
return [];
|
|
757
|
+
}
|
|
758
|
+
|
|
759
|
+
return jsonObject['sizeNames'].map(function (sizeNamesItem) {
|
|
760
|
+
return function () {
|
|
761
|
+
var sizeNamesItemObject = {};
|
|
762
|
+
|
|
763
|
+
if (_typeof(sizeNamesItem) === 'object' && 'index' in sizeNamesItem) {
|
|
764
|
+
sizeNamesItemObject.index = function () {
|
|
765
|
+
if (typeof sizeNamesItem.index !== 'number') {
|
|
766
|
+
return Number.isInteger(Number(sizeNamesItem.index)) ? Number(sizeNamesItem.index) : Math.floor(Number(sizeNamesItem.index));
|
|
767
|
+
}
|
|
768
|
+
|
|
769
|
+
return Number.isInteger(sizeNamesItem.index) ? sizeNamesItem.index : Math.floor(sizeNamesItem.index);
|
|
770
|
+
}();
|
|
771
|
+
} else {
|
|
772
|
+
sizeNamesItemObject.index = 0;
|
|
773
|
+
}
|
|
774
|
+
|
|
775
|
+
if (_typeof(sizeNamesItem) === 'object' && 'name' in sizeNamesItem) {
|
|
776
|
+
sizeNamesItemObject.name = function () {
|
|
777
|
+
if (typeof sizeNamesItem.name !== 'string') {
|
|
778
|
+
return String(sizeNamesItem.name);
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
return sizeNamesItem.name;
|
|
782
|
+
}();
|
|
783
|
+
} else {
|
|
784
|
+
sizeNamesItemObject.name = "";
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
return sizeNamesItemObject;
|
|
788
|
+
}();
|
|
789
|
+
});
|
|
790
|
+
}();
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
if ('articleNames' in jsonObject) {
|
|
794
|
+
model.articleNames = function () {
|
|
795
|
+
if (Array.isArray(jsonObject['articleNames']) !== true) {
|
|
796
|
+
return [];
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
return jsonObject['articleNames'].map(function (articleNamesItem) {
|
|
800
|
+
return function () {
|
|
801
|
+
var articleNamesItemObject = {};
|
|
802
|
+
|
|
803
|
+
if (_typeof(articleNamesItem) === 'object' && 'index' in articleNamesItem) {
|
|
804
|
+
articleNamesItemObject.index = function () {
|
|
805
|
+
if (typeof articleNamesItem.index !== 'number') {
|
|
806
|
+
return Number.isInteger(Number(articleNamesItem.index)) ? Number(articleNamesItem.index) : Math.floor(Number(articleNamesItem.index));
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
return Number.isInteger(articleNamesItem.index) ? articleNamesItem.index : Math.floor(articleNamesItem.index);
|
|
810
|
+
}();
|
|
811
|
+
} else {
|
|
812
|
+
articleNamesItemObject.index = 0;
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
if (_typeof(articleNamesItem) === 'object' && 'name' in articleNamesItem) {
|
|
816
|
+
articleNamesItemObject.name = function () {
|
|
817
|
+
if (typeof articleNamesItem.name !== 'string') {
|
|
818
|
+
return String(articleNamesItem.name);
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
return articleNamesItem.name;
|
|
822
|
+
}();
|
|
823
|
+
} else {
|
|
824
|
+
articleNamesItemObject.name = "";
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
return articleNamesItemObject;
|
|
828
|
+
}();
|
|
829
|
+
});
|
|
830
|
+
}();
|
|
831
|
+
}
|
|
832
|
+
|
|
527
833
|
if ('deleted' in jsonObject) {
|
|
528
834
|
model.deleted = function () {
|
|
529
835
|
if (typeof jsonObject['deleted'] !== 'boolean') {
|
|
@@ -103,6 +103,14 @@ var MAFSizerPackrunSummaryModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
103
103
|
*/
|
|
104
104
|
|
|
105
105
|
_this.classTypeSummaries = [];
|
|
106
|
+
/**
|
|
107
|
+
* An Array of Packrun Summary Data Objects for each Outlet
|
|
108
|
+
*
|
|
109
|
+
* @type {Array<{name: string, type: string, number: number, totals: Array<{classType: ?string, fruitSize: string, packType: ?string, weight: number, fruitCount: number, packCount: ?number}>}>}
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
_this.outletSummaries = [];
|
|
106
114
|
/**
|
|
107
115
|
* An Array that contains the Articles initially Assigned to each Outlet
|
|
108
116
|
*
|
|
@@ -342,6 +350,160 @@ var MAFSizerPackrunSummaryModel = /*#__PURE__*/function (_BaseModel) {
|
|
|
342
350
|
}();
|
|
343
351
|
}
|
|
344
352
|
|
|
353
|
+
if ('outletSummaries' in jsonObject) {
|
|
354
|
+
model.outletSummaries = function () {
|
|
355
|
+
if (Array.isArray(jsonObject['outletSummaries']) !== true) {
|
|
356
|
+
return [];
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return jsonObject['outletSummaries'].map(function (outletSummariesItem) {
|
|
360
|
+
return function () {
|
|
361
|
+
var outletSummariesItemObject = {};
|
|
362
|
+
|
|
363
|
+
if (_typeof(outletSummariesItem) === 'object' && 'name' in outletSummariesItem) {
|
|
364
|
+
outletSummariesItemObject.name = function () {
|
|
365
|
+
if (typeof outletSummariesItem.name !== 'string') {
|
|
366
|
+
return String(outletSummariesItem.name);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
return outletSummariesItem.name;
|
|
370
|
+
}();
|
|
371
|
+
} else {
|
|
372
|
+
outletSummariesItemObject.name = "";
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
if (_typeof(outletSummariesItem) === 'object' && 'type' in outletSummariesItem) {
|
|
376
|
+
outletSummariesItemObject.type = function () {
|
|
377
|
+
if (typeof outletSummariesItem.type !== 'string') {
|
|
378
|
+
return String(outletSummariesItem.type);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return outletSummariesItem.type;
|
|
382
|
+
}();
|
|
383
|
+
} else {
|
|
384
|
+
outletSummariesItemObject.type = "";
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
if (_typeof(outletSummariesItem) === 'object' && 'number' in outletSummariesItem) {
|
|
388
|
+
outletSummariesItemObject.number = function () {
|
|
389
|
+
if (typeof outletSummariesItem.number !== 'number') {
|
|
390
|
+
return Number.isInteger(Number(outletSummariesItem.number)) ? Number(outletSummariesItem.number) : Math.floor(Number(outletSummariesItem.number));
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
return Number.isInteger(outletSummariesItem.number) ? outletSummariesItem.number : Math.floor(outletSummariesItem.number);
|
|
394
|
+
}();
|
|
395
|
+
} else {
|
|
396
|
+
outletSummariesItemObject.number = 0;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
if (_typeof(outletSummariesItem) === 'object' && 'totals' in outletSummariesItem) {
|
|
400
|
+
outletSummariesItemObject.totals = function () {
|
|
401
|
+
if (Array.isArray(outletSummariesItem.totals) !== true) {
|
|
402
|
+
return [];
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
return outletSummariesItem.totals.map(function (totalsItem) {
|
|
406
|
+
return function () {
|
|
407
|
+
var totalsItemObject = {};
|
|
408
|
+
|
|
409
|
+
if (_typeof(totalsItem) === 'object' && 'classType' in totalsItem) {
|
|
410
|
+
totalsItemObject.classType = function () {
|
|
411
|
+
if (totalsItem.classType === null) {
|
|
412
|
+
return null;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
if (typeof totalsItem.classType !== 'string') {
|
|
416
|
+
return String(totalsItem.classType);
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
return totalsItem.classType;
|
|
420
|
+
}();
|
|
421
|
+
} else {
|
|
422
|
+
totalsItemObject.classType = null;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if (_typeof(totalsItem) === 'object' && 'fruitSize' in totalsItem) {
|
|
426
|
+
totalsItemObject.fruitSize = function () {
|
|
427
|
+
if (typeof totalsItem.fruitSize !== 'string') {
|
|
428
|
+
return String(totalsItem.fruitSize);
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
return totalsItem.fruitSize;
|
|
432
|
+
}();
|
|
433
|
+
} else {
|
|
434
|
+
totalsItemObject.fruitSize = "";
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
if (_typeof(totalsItem) === 'object' && 'packType' in totalsItem) {
|
|
438
|
+
totalsItemObject.packType = function () {
|
|
439
|
+
if (totalsItem.packType === null) {
|
|
440
|
+
return null;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
if (typeof totalsItem.packType !== 'string') {
|
|
444
|
+
return String(totalsItem.packType);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
return totalsItem.packType;
|
|
448
|
+
}();
|
|
449
|
+
} else {
|
|
450
|
+
totalsItemObject.packType = null;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
if (_typeof(totalsItem) === 'object' && 'weight' in totalsItem) {
|
|
454
|
+
totalsItemObject.weight = function () {
|
|
455
|
+
if (typeof totalsItem.weight !== 'number') {
|
|
456
|
+
return Number(totalsItem.weight);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
return totalsItem.weight;
|
|
460
|
+
}();
|
|
461
|
+
} else {
|
|
462
|
+
totalsItemObject.weight = 0;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
if (_typeof(totalsItem) === 'object' && 'fruitCount' in totalsItem) {
|
|
466
|
+
totalsItemObject.fruitCount = function () {
|
|
467
|
+
if (typeof totalsItem.fruitCount !== 'number') {
|
|
468
|
+
return Number.isInteger(Number(totalsItem.fruitCount)) ? Number(totalsItem.fruitCount) : Math.floor(Number(totalsItem.fruitCount));
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
return Number.isInteger(totalsItem.fruitCount) ? totalsItem.fruitCount : Math.floor(totalsItem.fruitCount);
|
|
472
|
+
}();
|
|
473
|
+
} else {
|
|
474
|
+
totalsItemObject.fruitCount = 0;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (_typeof(totalsItem) === 'object' && 'packCount' in totalsItem) {
|
|
478
|
+
totalsItemObject.packCount = function () {
|
|
479
|
+
if (totalsItem.packCount === null) {
|
|
480
|
+
return null;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
if (typeof totalsItem.packCount !== 'number') {
|
|
484
|
+
return Number(totalsItem.packCount);
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
return totalsItem.packCount;
|
|
488
|
+
}();
|
|
489
|
+
} else {
|
|
490
|
+
totalsItemObject.packCount = null;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
return totalsItemObject;
|
|
494
|
+
}();
|
|
495
|
+
});
|
|
496
|
+
}();
|
|
497
|
+
} else {
|
|
498
|
+
outletSummariesItemObject.totals = [];
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
return outletSummariesItemObject;
|
|
502
|
+
}();
|
|
503
|
+
});
|
|
504
|
+
}();
|
|
505
|
+
}
|
|
506
|
+
|
|
345
507
|
if ('initialOutletArticles' in jsonObject) {
|
|
346
508
|
model.initialOutletArticles = function () {
|
|
347
509
|
if (Array.isArray(jsonObject['initialOutletArticles']) !== true) {
|
package/lib/PackageVersion.js
CHANGED