@ricado/api-client 2.7.0 → 2.7.2

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.
@@ -293,6 +293,7 @@ var _default = MAFSizerController;
293
293
  * @typedef {Object} MAFSizerController.ArticleClassType
294
294
  * @property {string} articleName Name of the MAF Sizer Article
295
295
  * @property {string} classType The Class Type for this MAF Sizer Article
296
+ * @property {string} matchType The Match Type used when Evaluating the Product Name
296
297
  * @memberof Controllers.Packhouse.Site
297
298
  */
298
299
 
@@ -1460,6 +1460,72 @@ var PackrunController = /*#__PURE__*/function () {
1460
1460
  resultObject.classTypeTotals = [];
1461
1461
  }
1462
1462
 
1463
+ if (_typeof(result) === 'object' && 'classTypeFruitSizeTotals' in result) {
1464
+ resultObject.classTypeFruitSizeTotals = function () {
1465
+ if (Array.isArray(result.classTypeFruitSizeTotals) !== true) {
1466
+ return [];
1467
+ }
1468
+
1469
+ return result.classTypeFruitSizeTotals.map(function (classTypeFruitSizeTotalsItem) {
1470
+ return function () {
1471
+ var classTypeFruitSizeTotalsItemObject = {};
1472
+
1473
+ if (_typeof(classTypeFruitSizeTotalsItem) === 'object' && 'classType' in classTypeFruitSizeTotalsItem) {
1474
+ classTypeFruitSizeTotalsItemObject.classType = function () {
1475
+ if (typeof classTypeFruitSizeTotalsItem.classType !== 'string') {
1476
+ return String(classTypeFruitSizeTotalsItem.classType);
1477
+ }
1478
+
1479
+ return classTypeFruitSizeTotalsItem.classType;
1480
+ }();
1481
+ } else {
1482
+ classTypeFruitSizeTotalsItemObject.classType = "";
1483
+ }
1484
+
1485
+ if (_typeof(classTypeFruitSizeTotalsItem) === 'object' && 'fruitSize' in classTypeFruitSizeTotalsItem) {
1486
+ classTypeFruitSizeTotalsItemObject.fruitSize = function () {
1487
+ if (typeof classTypeFruitSizeTotalsItem.fruitSize !== 'string') {
1488
+ return String(classTypeFruitSizeTotalsItem.fruitSize);
1489
+ }
1490
+
1491
+ return classTypeFruitSizeTotalsItem.fruitSize;
1492
+ }();
1493
+ } else {
1494
+ classTypeFruitSizeTotalsItemObject.fruitSize = "";
1495
+ }
1496
+
1497
+ if (_typeof(classTypeFruitSizeTotalsItem) === 'object' && 'fruitCount' in classTypeFruitSizeTotalsItem) {
1498
+ classTypeFruitSizeTotalsItemObject.fruitCount = function () {
1499
+ if (typeof classTypeFruitSizeTotalsItem.fruitCount !== 'number') {
1500
+ return Number.isInteger(Number(classTypeFruitSizeTotalsItem.fruitCount)) ? Number(classTypeFruitSizeTotalsItem.fruitCount) : Math.floor(Number(classTypeFruitSizeTotalsItem.fruitCount));
1501
+ }
1502
+
1503
+ return Number.isInteger(classTypeFruitSizeTotalsItem.fruitCount) ? classTypeFruitSizeTotalsItem.fruitCount : Math.floor(classTypeFruitSizeTotalsItem.fruitCount);
1504
+ }();
1505
+ } else {
1506
+ classTypeFruitSizeTotalsItemObject.fruitCount = 0;
1507
+ }
1508
+
1509
+ if (_typeof(classTypeFruitSizeTotalsItem) === 'object' && 'fruitWeight' in classTypeFruitSizeTotalsItem) {
1510
+ classTypeFruitSizeTotalsItemObject.fruitWeight = function () {
1511
+ if (typeof classTypeFruitSizeTotalsItem.fruitWeight !== 'number') {
1512
+ return Number(classTypeFruitSizeTotalsItem.fruitWeight);
1513
+ }
1514
+
1515
+ return classTypeFruitSizeTotalsItem.fruitWeight;
1516
+ }();
1517
+ } else {
1518
+ classTypeFruitSizeTotalsItemObject.fruitWeight = 0;
1519
+ }
1520
+
1521
+ return classTypeFruitSizeTotalsItemObject;
1522
+ }();
1523
+ });
1524
+ }();
1525
+ } else {
1526
+ resultObject.classTypeFruitSizeTotals = [];
1527
+ }
1528
+
1463
1529
  if (_typeof(result) === 'object' && 'class1SizerSummary' in result) {
1464
1530
  resultObject.class1SizerSummary = function () {
1465
1531
  if (Array.isArray(result.class1SizerSummary) !== true) {
@@ -2483,6 +2549,136 @@ var PackrunController = /*#__PURE__*/function () {
2483
2549
  return _PackrunModel.default.fromJSON(result, siteId);
2484
2550
  }();
2485
2551
 
2552
+ resolve(resolveValue);
2553
+ }).catch(function (error) {
2554
+ return reject(error);
2555
+ });
2556
+ });
2557
+ }
2558
+ /**
2559
+ * Retrieve Tipped Bins for all Packruns [GET /packhouse/sites/{siteId}/packruns/tippedBins]
2560
+ *
2561
+ * Retrieves the Tipped Bins for all Packruns
2562
+ *
2563
+ * @static
2564
+ * @public
2565
+ * @param {number} siteId The Site ID
2566
+ * @param {Date} createdTimestampBegin Filter by the Timestamp when Packruns were Created. Results Greater than or Equal to Timestamp
2567
+ * @param {Date} createdTimestampEnd Filter by the Timestamp when Packruns were Created. Results Less than or Equal to Timestamp
2568
+ * @return {Promise<Array<PackrunController.PackrunTippedBinsItem>>}
2569
+ */
2570
+
2571
+ }, {
2572
+ key: "getAllTippedBins",
2573
+ value: function getAllTippedBins(siteId, createdTimestampBegin, createdTimestampEnd) {
2574
+ return new Promise(function (resolve, reject) {
2575
+ var queryParameters = {};
2576
+
2577
+ _RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/packruns/tippedBins"), Object.assign(queryParameters, {
2578
+ createdTimestampBegin: createdTimestampBegin,
2579
+ createdTimestampEnd: createdTimestampEnd
2580
+ })).then(function (result) {
2581
+ var resolveValue = function () {
2582
+ if (Array.isArray(result) !== true) {
2583
+ return [];
2584
+ }
2585
+
2586
+ return result.map(function (resultItem) {
2587
+ return function () {
2588
+ var resultItemObject = {};
2589
+
2590
+ if (_typeof(resultItem) === 'object' && 'packrunId' in resultItem) {
2591
+ resultItemObject.packrunId = function () {
2592
+ if (typeof resultItem.packrunId !== 'string') {
2593
+ return String(resultItem.packrunId);
2594
+ }
2595
+
2596
+ return resultItem.packrunId;
2597
+ }();
2598
+ } else {
2599
+ resultItemObject.packrunId = "";
2600
+ }
2601
+
2602
+ if (_typeof(resultItem) === 'object' && 'tippedBins' in resultItem) {
2603
+ resultItemObject.tippedBins = function () {
2604
+ if (typeof resultItem.tippedBins !== 'number') {
2605
+ return Number.isInteger(Number(resultItem.tippedBins)) ? Number(resultItem.tippedBins) : Math.floor(Number(resultItem.tippedBins));
2606
+ }
2607
+
2608
+ return Number.isInteger(resultItem.tippedBins) ? resultItem.tippedBins : Math.floor(resultItem.tippedBins);
2609
+ }();
2610
+ } else {
2611
+ resultItemObject.tippedBins = 0;
2612
+ }
2613
+
2614
+ return resultItemObject;
2615
+ }();
2616
+ });
2617
+ }();
2618
+
2619
+ resolve(resolveValue);
2620
+ }).catch(function (error) {
2621
+ return reject(error);
2622
+ });
2623
+ });
2624
+ }
2625
+ /**
2626
+ * Retrieve Tipped Bins for specified Packruns [POST /packhouse/sites/{siteId}/packruns/tippedBins]
2627
+ *
2628
+ * Retrieves the Tipped Bins for specified Packruns
2629
+ *
2630
+ * @static
2631
+ * @public
2632
+ * @param {number} siteId The Site ID
2633
+ * @param {string[]} packrunIds An Array of Packrun IDs to Fetch Tipped Bins for
2634
+ * @return {Promise<Array<PackrunController.PackrunTippedBinsItem>>}
2635
+ */
2636
+
2637
+ }, {
2638
+ key: "getSpecificTippedBins",
2639
+ value: function getSpecificTippedBins(siteId, packrunIds) {
2640
+ return new Promise(function (resolve, reject) {
2641
+ _RequestHelper.default.postRequest("/packhouse/sites/".concat(siteId, "/packruns/tippedBins"), {
2642
+ packrunIds: packrunIds
2643
+ }).then(function (result) {
2644
+ var resolveValue = function () {
2645
+ if (Array.isArray(result) !== true) {
2646
+ return [];
2647
+ }
2648
+
2649
+ return result.map(function (resultItem) {
2650
+ return function () {
2651
+ var resultItemObject = {};
2652
+
2653
+ if (_typeof(resultItem) === 'object' && 'packrunId' in resultItem) {
2654
+ resultItemObject.packrunId = function () {
2655
+ if (typeof resultItem.packrunId !== 'string') {
2656
+ return String(resultItem.packrunId);
2657
+ }
2658
+
2659
+ return resultItem.packrunId;
2660
+ }();
2661
+ } else {
2662
+ resultItemObject.packrunId = "";
2663
+ }
2664
+
2665
+ if (_typeof(resultItem) === 'object' && 'tippedBins' in resultItem) {
2666
+ resultItemObject.tippedBins = function () {
2667
+ if (typeof resultItem.tippedBins !== 'number') {
2668
+ return Number.isInteger(Number(resultItem.tippedBins)) ? Number(resultItem.tippedBins) : Math.floor(Number(resultItem.tippedBins));
2669
+ }
2670
+
2671
+ return Number.isInteger(resultItem.tippedBins) ? resultItem.tippedBins : Math.floor(resultItem.tippedBins);
2672
+ }();
2673
+ } else {
2674
+ resultItemObject.tippedBins = 0;
2675
+ }
2676
+
2677
+ return resultItemObject;
2678
+ }();
2679
+ });
2680
+ }();
2681
+
2486
2682
  resolve(resolveValue);
2487
2683
  }).catch(function (error) {
2488
2684
  return reject(error);
@@ -2654,6 +2850,17 @@ var _default = PackrunController;
2654
2850
  * @memberof Controllers.Packhouse.Site
2655
2851
  */
2656
2852
 
2853
+ /**
2854
+ * A **ClassTypeFruitSizeTotalItem** Type
2855
+ *
2856
+ * @typedef {Object} PackrunController.ClassTypeFruitSizeTotalItem
2857
+ * @property {string} classType The Class Type
2858
+ * @property {string} fruitSize The Fruit Size
2859
+ * @property {number} fruitCount The Fruit Count
2860
+ * @property {number} fruitWeight The Fruit Weight
2861
+ * @memberof Controllers.Packhouse.Site
2862
+ */
2863
+
2657
2864
  /**
2658
2865
  * A **PackrunSummaryReport** Type
2659
2866
  *
@@ -2681,6 +2888,7 @@ var _default = PackrunController;
2681
2888
  * @property {Object} rejectBinSummary The Reject Bin Summary for the Packrun
2682
2889
  * @property {Object} binTipSummary The Bin Tip Summary for the Packrun
2683
2890
  * @property {Object[]} classTypeTotals An Array of Totals for each Class Type within the Packrun
2891
+ * @property {Array<PackrunController.ClassTypeFruitSizeTotalItem>} classTypeFruitSizeTotals An Array of Totals for each Class Type by Fruit Size within the Packrun
2684
2892
  * @property {Object[]} class1SizerSummary An Array of Class 1 Fruit Summaries by Size for all Sizers within the Packrun
2685
2893
  * @property {number} class1TotalTrays The Total Class 1 Trays for this Packrun
2686
2894
  * @property {number} class1AverageTrayWeight The Average Class 1 Tray Weight for this Packrun
@@ -2770,6 +2978,15 @@ var _default = PackrunController;
2770
2978
  * @memberof Controllers.Packhouse.Site
2771
2979
  */
2772
2980
 
2981
+ /**
2982
+ * A **PackrunTippedBinsItem** Type
2983
+ *
2984
+ * @typedef {Object} PackrunController.PackrunTippedBinsItem
2985
+ * @property {string} packrunId The Packrun ID
2986
+ * @property {number} tippedBins The Total Tipped Bins for the Packrun
2987
+ * @memberof Controllers.Packhouse.Site
2988
+ */
2989
+
2773
2990
  /**
2774
2991
  * A **TimeBatch** Type
2775
2992
  *
@@ -189,7 +189,7 @@ var MAFSizerModel = /*#__PURE__*/function (_BaseModel) {
189
189
  /**
190
190
  * An Array of Article to Class Type Maps for this MAF Sizer
191
191
  *
192
- * @type {Array<{articleName: string, classType: string}>}
192
+ * @type {Array<{articleName: string, classType: string, matchType: string}>}
193
193
  * @public
194
194
  */
195
195
 
@@ -1094,6 +1094,18 @@ var MAFSizerModel = /*#__PURE__*/function (_BaseModel) {
1094
1094
  articleClassTypesItemObject.classType = "";
1095
1095
  }
1096
1096
 
1097
+ if (_typeof(articleClassTypesItem) === 'object' && 'matchType' in articleClassTypesItem) {
1098
+ articleClassTypesItemObject.matchType = function () {
1099
+ if (typeof articleClassTypesItem.matchType !== 'string') {
1100
+ return String(articleClassTypesItem.matchType);
1101
+ }
1102
+
1103
+ return articleClassTypesItem.matchType;
1104
+ }();
1105
+ } else {
1106
+ articleClassTypesItemObject.matchType = "";
1107
+ }
1108
+
1097
1109
  return articleClassTypesItemObject;
1098
1110
  }();
1099
1111
  });
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- var version = '2.7.0';
8
+ var version = '2.7.2';
9
9
  exports.version = version;
package/lib/index.d.ts CHANGED
@@ -14977,6 +14977,10 @@ declare module '@ricado/api-client/Controllers/Packhouse/Site/MAFSizerController
14977
14977
  * The Class Type for this MAF Sizer Article
14978
14978
  */
14979
14979
  classType: string;
14980
+ /**
14981
+ * The Match Type used when Evaluating the Product Name
14982
+ */
14983
+ matchType: string;
14980
14984
  };
14981
14985
  }
14982
14986
  import MAFSizerModel from "@ricado/api-client/Models/Packhouse/Site/MAFSizerModel";
@@ -17279,6 +17283,31 @@ declare module '@ricado/api-client/Controllers/Packhouse/Site/PackrunController'
17279
17283
  * @return {Promise<PackrunModel>}
17280
17284
  */
17281
17285
  static create(siteId: number, createData: PackrunController.CreateData): Promise<PackrunModel>;
17286
+ /**
17287
+ * Retrieve Tipped Bins for all Packruns [GET /packhouse/sites/{siteId}/packruns/tippedBins]
17288
+ *
17289
+ * Retrieves the Tipped Bins for all Packruns
17290
+ *
17291
+ * @static
17292
+ * @public
17293
+ * @param {number} siteId The Site ID
17294
+ * @param {Date} createdTimestampBegin Filter by the Timestamp when Packruns were Created. Results Greater than or Equal to Timestamp
17295
+ * @param {Date} createdTimestampEnd Filter by the Timestamp when Packruns were Created. Results Less than or Equal to Timestamp
17296
+ * @return {Promise<Array<PackrunController.PackrunTippedBinsItem>>}
17297
+ */
17298
+ static getAllTippedBins(siteId: number, createdTimestampBegin: Date, createdTimestampEnd: Date): Promise<Array<PackrunController.PackrunTippedBinsItem>>;
17299
+ /**
17300
+ * Retrieve Tipped Bins for specified Packruns [POST /packhouse/sites/{siteId}/packruns/tippedBins]
17301
+ *
17302
+ * Retrieves the Tipped Bins for specified Packruns
17303
+ *
17304
+ * @static
17305
+ * @public
17306
+ * @param {number} siteId The Site ID
17307
+ * @param {string[]} packrunIds An Array of Packrun IDs to Fetch Tipped Bins for
17308
+ * @return {Promise<Array<PackrunController.PackrunTippedBinsItem>>}
17309
+ */
17310
+ static getSpecificTippedBins(siteId: number, packrunIds: string[]): Promise<Array<PackrunController.PackrunTippedBinsItem>>;
17282
17311
  }
17283
17312
  namespace PackrunController {
17284
17313
  /**
@@ -17661,6 +17690,27 @@ declare module '@ricado/api-client/Controllers/Packhouse/Site/PackrunController'
17661
17690
  */
17662
17691
  batchSummaries: SizerBatchSummaryItem[];
17663
17692
  };
17693
+ /**
17694
+ * A **ClassTypeFruitSizeTotalItem** Type
17695
+ */
17696
+ type ClassTypeFruitSizeTotalItem = {
17697
+ /**
17698
+ * The Class Type
17699
+ */
17700
+ classType: string;
17701
+ /**
17702
+ * The Fruit Size
17703
+ */
17704
+ fruitSize: string;
17705
+ /**
17706
+ * The Fruit Count
17707
+ */
17708
+ fruitCount: number;
17709
+ /**
17710
+ * The Fruit Weight
17711
+ */
17712
+ fruitWeight: number;
17713
+ };
17664
17714
  /**
17665
17715
  * A **PackrunSummaryReport** Type
17666
17716
  */
@@ -17754,6 +17804,10 @@ declare module '@ricado/api-client/Controllers/Packhouse/Site/PackrunController'
17754
17804
  * An Array of Totals for each Class Type within the Packrun
17755
17805
  */
17756
17806
  classTypeTotals: any[];
17807
+ /**
17808
+ * An Array of Totals for each Class Type by Fruit Size within the Packrun
17809
+ */
17810
+ classTypeFruitSizeTotals: ClassTypeFruitSizeTotalItem[];
17757
17811
  /**
17758
17812
  * An Array of Class 1 Fruit Summaries by Size for all Sizers within the Packrun
17759
17813
  */
@@ -18007,6 +18061,19 @@ declare module '@ricado/api-client/Controllers/Packhouse/Site/PackrunController'
18007
18061
  */
18008
18062
  classTypeTotals: ClassTypePercentageItem[];
18009
18063
  };
18064
+ /**
18065
+ * A **PackrunTippedBinsItem** Type
18066
+ */
18067
+ type PackrunTippedBinsItem = {
18068
+ /**
18069
+ * The Packrun ID
18070
+ */
18071
+ packrunId: string;
18072
+ /**
18073
+ * The Total Tipped Bins for the Packrun
18074
+ */
18075
+ tippedBins: number;
18076
+ };
18010
18077
  /**
18011
18078
  * A **TimeBatch** Type
18012
18079
  */
@@ -28501,12 +28568,13 @@ declare module '@ricado/api-client/Models/Packhouse/Site/MAFSizerModel' {
28501
28568
  /**
28502
28569
  * An Array of Article to Class Type Maps for this MAF Sizer
28503
28570
  *
28504
- * @type {Array<{articleName: string, classType: string}>}
28571
+ * @type {Array<{articleName: string, classType: string, matchType: string}>}
28505
28572
  * @public
28506
28573
  */
28507
28574
  articleClassTypes: {
28508
28575
  articleName: string;
28509
28576
  classType: string;
28577
+ matchType: string;
28510
28578
  }[];
28511
28579
  /**
28512
28580
  * Whether the MAF Sizer has been deleted
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ricado/api-client",
3
- "version": "2.7.0",
3
+ "version": "2.7.2",
4
4
  "description": "RICADO Gen 4 API Client Library for NodeJS and Browsers",
5
5
  "author": {
6
6
  "name": "Ash Neilson"
@@ -272,5 +272,6 @@ export default MAFSizerController;
272
272
  * @typedef {Object} MAFSizerController.ArticleClassType
273
273
  * @property {string} articleName Name of the MAF Sizer Article
274
274
  * @property {string} classType The Class Type for this MAF Sizer Article
275
+ * @property {string} matchType The Match Type used when Evaluating the Product Name
275
276
  * @memberof Controllers.Packhouse.Site
276
277
  */