@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.
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/MAFSizerController.js +1 -0
- package/lib/Controllers/Packhouse/Site/PackrunController.js +217 -0
- package/lib/Models/Packhouse/Site/MAFSizerModel.js +13 -1
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +69 -1
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/MAFSizerController.js +1 -0
- package/src/Controllers/Packhouse/Site/PackrunController.js +248 -0
- package/src/Models/Packhouse/Site/MAFSizerModel.js +17 -1
- package/src/PackageVersion.js +1 -1
|
@@ -1817,6 +1817,92 @@ class PackrunController
|
|
|
1817
1817
|
resultObject.classTypeTotals = [];
|
|
1818
1818
|
}
|
|
1819
1819
|
|
|
1820
|
+
if(typeof result === 'object' && 'classTypeFruitSizeTotals' in result)
|
|
1821
|
+
{
|
|
1822
|
+
resultObject.classTypeFruitSizeTotals = (function(){
|
|
1823
|
+
if(Array.isArray(result.classTypeFruitSizeTotals) !== true)
|
|
1824
|
+
{
|
|
1825
|
+
return [];
|
|
1826
|
+
}
|
|
1827
|
+
|
|
1828
|
+
return result.classTypeFruitSizeTotals.map((classTypeFruitSizeTotalsItem) => {
|
|
1829
|
+
return (function(){
|
|
1830
|
+
let classTypeFruitSizeTotalsItemObject = {};
|
|
1831
|
+
|
|
1832
|
+
if(typeof classTypeFruitSizeTotalsItem === 'object' && 'classType' in classTypeFruitSizeTotalsItem)
|
|
1833
|
+
{
|
|
1834
|
+
classTypeFruitSizeTotalsItemObject.classType = (function(){
|
|
1835
|
+
if(typeof classTypeFruitSizeTotalsItem.classType !== 'string')
|
|
1836
|
+
{
|
|
1837
|
+
return String(classTypeFruitSizeTotalsItem.classType);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
return classTypeFruitSizeTotalsItem.classType;
|
|
1841
|
+
}());
|
|
1842
|
+
}
|
|
1843
|
+
else
|
|
1844
|
+
{
|
|
1845
|
+
classTypeFruitSizeTotalsItemObject.classType = "";
|
|
1846
|
+
}
|
|
1847
|
+
|
|
1848
|
+
if(typeof classTypeFruitSizeTotalsItem === 'object' && 'fruitSize' in classTypeFruitSizeTotalsItem)
|
|
1849
|
+
{
|
|
1850
|
+
classTypeFruitSizeTotalsItemObject.fruitSize = (function(){
|
|
1851
|
+
if(typeof classTypeFruitSizeTotalsItem.fruitSize !== 'string')
|
|
1852
|
+
{
|
|
1853
|
+
return String(classTypeFruitSizeTotalsItem.fruitSize);
|
|
1854
|
+
}
|
|
1855
|
+
|
|
1856
|
+
return classTypeFruitSizeTotalsItem.fruitSize;
|
|
1857
|
+
}());
|
|
1858
|
+
}
|
|
1859
|
+
else
|
|
1860
|
+
{
|
|
1861
|
+
classTypeFruitSizeTotalsItemObject.fruitSize = "";
|
|
1862
|
+
}
|
|
1863
|
+
|
|
1864
|
+
if(typeof classTypeFruitSizeTotalsItem === 'object' && 'fruitCount' in classTypeFruitSizeTotalsItem)
|
|
1865
|
+
{
|
|
1866
|
+
classTypeFruitSizeTotalsItemObject.fruitCount = (function(){
|
|
1867
|
+
if(typeof classTypeFruitSizeTotalsItem.fruitCount !== 'number')
|
|
1868
|
+
{
|
|
1869
|
+
return Number.isInteger(Number(classTypeFruitSizeTotalsItem.fruitCount)) ? Number(classTypeFruitSizeTotalsItem.fruitCount) : Math.floor(Number(classTypeFruitSizeTotalsItem.fruitCount));
|
|
1870
|
+
}
|
|
1871
|
+
|
|
1872
|
+
return Number.isInteger(classTypeFruitSizeTotalsItem.fruitCount) ? classTypeFruitSizeTotalsItem.fruitCount : Math.floor(classTypeFruitSizeTotalsItem.fruitCount);
|
|
1873
|
+
}());
|
|
1874
|
+
}
|
|
1875
|
+
else
|
|
1876
|
+
{
|
|
1877
|
+
classTypeFruitSizeTotalsItemObject.fruitCount = 0;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
if(typeof classTypeFruitSizeTotalsItem === 'object' && 'fruitWeight' in classTypeFruitSizeTotalsItem)
|
|
1881
|
+
{
|
|
1882
|
+
classTypeFruitSizeTotalsItemObject.fruitWeight = (function(){
|
|
1883
|
+
if(typeof classTypeFruitSizeTotalsItem.fruitWeight !== 'number')
|
|
1884
|
+
{
|
|
1885
|
+
return Number(classTypeFruitSizeTotalsItem.fruitWeight);
|
|
1886
|
+
}
|
|
1887
|
+
|
|
1888
|
+
return classTypeFruitSizeTotalsItem.fruitWeight;
|
|
1889
|
+
}());
|
|
1890
|
+
}
|
|
1891
|
+
else
|
|
1892
|
+
{
|
|
1893
|
+
classTypeFruitSizeTotalsItemObject.fruitWeight = 0;
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
return classTypeFruitSizeTotalsItemObject;
|
|
1897
|
+
}());
|
|
1898
|
+
});
|
|
1899
|
+
}());
|
|
1900
|
+
}
|
|
1901
|
+
else
|
|
1902
|
+
{
|
|
1903
|
+
resultObject.classTypeFruitSizeTotals = [];
|
|
1904
|
+
}
|
|
1905
|
+
|
|
1820
1906
|
if(typeof result === 'object' && 'class1SizerSummary' in result)
|
|
1821
1907
|
{
|
|
1822
1908
|
resultObject.class1SizerSummary = (function(){
|
|
@@ -3132,6 +3218,147 @@ class PackrunController
|
|
|
3132
3218
|
.catch(error => reject(error));
|
|
3133
3219
|
});
|
|
3134
3220
|
}
|
|
3221
|
+
|
|
3222
|
+
/**
|
|
3223
|
+
* Retrieve Tipped Bins for all Packruns [GET /packhouse/sites/{siteId}/packruns/tippedBins]
|
|
3224
|
+
*
|
|
3225
|
+
* Retrieves the Tipped Bins for all Packruns
|
|
3226
|
+
*
|
|
3227
|
+
* @static
|
|
3228
|
+
* @public
|
|
3229
|
+
* @param {number} siteId The Site ID
|
|
3230
|
+
* @param {Date} createdTimestampBegin Filter by the Timestamp when Packruns were Created. Results Greater than or Equal to Timestamp
|
|
3231
|
+
* @param {Date} createdTimestampEnd Filter by the Timestamp when Packruns were Created. Results Less than or Equal to Timestamp
|
|
3232
|
+
* @return {Promise<Array<PackrunController.PackrunTippedBinsItem>>}
|
|
3233
|
+
*/
|
|
3234
|
+
static getAllTippedBins(siteId, createdTimestampBegin, createdTimestampEnd)
|
|
3235
|
+
{
|
|
3236
|
+
return new Promise((resolve, reject) => {
|
|
3237
|
+
let queryParameters = {};
|
|
3238
|
+
|
|
3239
|
+
RequestHelper.getRequest(`/packhouse/sites/${siteId}/packruns/tippedBins`, Object.assign(queryParameters, {createdTimestampBegin, createdTimestampEnd}))
|
|
3240
|
+
.then((result) => {
|
|
3241
|
+
let resolveValue = (function(){
|
|
3242
|
+
if(Array.isArray(result) !== true)
|
|
3243
|
+
{
|
|
3244
|
+
return [];
|
|
3245
|
+
}
|
|
3246
|
+
|
|
3247
|
+
return result.map((resultItem) => {
|
|
3248
|
+
return (function(){
|
|
3249
|
+
let resultItemObject = {};
|
|
3250
|
+
|
|
3251
|
+
if(typeof resultItem === 'object' && 'packrunId' in resultItem)
|
|
3252
|
+
{
|
|
3253
|
+
resultItemObject.packrunId = (function(){
|
|
3254
|
+
if(typeof resultItem.packrunId !== 'string')
|
|
3255
|
+
{
|
|
3256
|
+
return String(resultItem.packrunId);
|
|
3257
|
+
}
|
|
3258
|
+
|
|
3259
|
+
return resultItem.packrunId;
|
|
3260
|
+
}());
|
|
3261
|
+
}
|
|
3262
|
+
else
|
|
3263
|
+
{
|
|
3264
|
+
resultItemObject.packrunId = "";
|
|
3265
|
+
}
|
|
3266
|
+
|
|
3267
|
+
if(typeof resultItem === 'object' && 'tippedBins' in resultItem)
|
|
3268
|
+
{
|
|
3269
|
+
resultItemObject.tippedBins = (function(){
|
|
3270
|
+
if(typeof resultItem.tippedBins !== 'number')
|
|
3271
|
+
{
|
|
3272
|
+
return Number.isInteger(Number(resultItem.tippedBins)) ? Number(resultItem.tippedBins) : Math.floor(Number(resultItem.tippedBins));
|
|
3273
|
+
}
|
|
3274
|
+
|
|
3275
|
+
return Number.isInteger(resultItem.tippedBins) ? resultItem.tippedBins : Math.floor(resultItem.tippedBins);
|
|
3276
|
+
}());
|
|
3277
|
+
}
|
|
3278
|
+
else
|
|
3279
|
+
{
|
|
3280
|
+
resultItemObject.tippedBins = 0;
|
|
3281
|
+
}
|
|
3282
|
+
|
|
3283
|
+
return resultItemObject;
|
|
3284
|
+
}());
|
|
3285
|
+
});
|
|
3286
|
+
}());
|
|
3287
|
+
|
|
3288
|
+
resolve(resolveValue);
|
|
3289
|
+
})
|
|
3290
|
+
.catch(error => reject(error));
|
|
3291
|
+
});
|
|
3292
|
+
}
|
|
3293
|
+
|
|
3294
|
+
/**
|
|
3295
|
+
* Retrieve Tipped Bins for specified Packruns [POST /packhouse/sites/{siteId}/packruns/tippedBins]
|
|
3296
|
+
*
|
|
3297
|
+
* Retrieves the Tipped Bins for specified Packruns
|
|
3298
|
+
*
|
|
3299
|
+
* @static
|
|
3300
|
+
* @public
|
|
3301
|
+
* @param {number} siteId The Site ID
|
|
3302
|
+
* @param {string[]} packrunIds An Array of Packrun IDs to Fetch Tipped Bins for
|
|
3303
|
+
* @return {Promise<Array<PackrunController.PackrunTippedBinsItem>>}
|
|
3304
|
+
*/
|
|
3305
|
+
static getSpecificTippedBins(siteId, packrunIds)
|
|
3306
|
+
{
|
|
3307
|
+
return new Promise((resolve, reject) => {
|
|
3308
|
+
RequestHelper.postRequest(`/packhouse/sites/${siteId}/packruns/tippedBins`, {packrunIds})
|
|
3309
|
+
.then((result) => {
|
|
3310
|
+
let resolveValue = (function(){
|
|
3311
|
+
if(Array.isArray(result) !== true)
|
|
3312
|
+
{
|
|
3313
|
+
return [];
|
|
3314
|
+
}
|
|
3315
|
+
|
|
3316
|
+
return result.map((resultItem) => {
|
|
3317
|
+
return (function(){
|
|
3318
|
+
let resultItemObject = {};
|
|
3319
|
+
|
|
3320
|
+
if(typeof resultItem === 'object' && 'packrunId' in resultItem)
|
|
3321
|
+
{
|
|
3322
|
+
resultItemObject.packrunId = (function(){
|
|
3323
|
+
if(typeof resultItem.packrunId !== 'string')
|
|
3324
|
+
{
|
|
3325
|
+
return String(resultItem.packrunId);
|
|
3326
|
+
}
|
|
3327
|
+
|
|
3328
|
+
return resultItem.packrunId;
|
|
3329
|
+
}());
|
|
3330
|
+
}
|
|
3331
|
+
else
|
|
3332
|
+
{
|
|
3333
|
+
resultItemObject.packrunId = "";
|
|
3334
|
+
}
|
|
3335
|
+
|
|
3336
|
+
if(typeof resultItem === 'object' && 'tippedBins' in resultItem)
|
|
3337
|
+
{
|
|
3338
|
+
resultItemObject.tippedBins = (function(){
|
|
3339
|
+
if(typeof resultItem.tippedBins !== 'number')
|
|
3340
|
+
{
|
|
3341
|
+
return Number.isInteger(Number(resultItem.tippedBins)) ? Number(resultItem.tippedBins) : Math.floor(Number(resultItem.tippedBins));
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
return Number.isInteger(resultItem.tippedBins) ? resultItem.tippedBins : Math.floor(resultItem.tippedBins);
|
|
3345
|
+
}());
|
|
3346
|
+
}
|
|
3347
|
+
else
|
|
3348
|
+
{
|
|
3349
|
+
resultItemObject.tippedBins = 0;
|
|
3350
|
+
}
|
|
3351
|
+
|
|
3352
|
+
return resultItemObject;
|
|
3353
|
+
}());
|
|
3354
|
+
});
|
|
3355
|
+
}());
|
|
3356
|
+
|
|
3357
|
+
resolve(resolveValue);
|
|
3358
|
+
})
|
|
3359
|
+
.catch(error => reject(error));
|
|
3360
|
+
});
|
|
3361
|
+
}
|
|
3135
3362
|
}
|
|
3136
3363
|
|
|
3137
3364
|
export default PackrunController;
|
|
@@ -3295,6 +3522,17 @@ export default PackrunController;
|
|
|
3295
3522
|
* @memberof Controllers.Packhouse.Site
|
|
3296
3523
|
*/
|
|
3297
3524
|
|
|
3525
|
+
/**
|
|
3526
|
+
* A **ClassTypeFruitSizeTotalItem** Type
|
|
3527
|
+
*
|
|
3528
|
+
* @typedef {Object} PackrunController.ClassTypeFruitSizeTotalItem
|
|
3529
|
+
* @property {string} classType The Class Type
|
|
3530
|
+
* @property {string} fruitSize The Fruit Size
|
|
3531
|
+
* @property {number} fruitCount The Fruit Count
|
|
3532
|
+
* @property {number} fruitWeight The Fruit Weight
|
|
3533
|
+
* @memberof Controllers.Packhouse.Site
|
|
3534
|
+
*/
|
|
3535
|
+
|
|
3298
3536
|
/**
|
|
3299
3537
|
* A **PackrunSummaryReport** Type
|
|
3300
3538
|
*
|
|
@@ -3322,6 +3560,7 @@ export default PackrunController;
|
|
|
3322
3560
|
* @property {Object} rejectBinSummary The Reject Bin Summary for the Packrun
|
|
3323
3561
|
* @property {Object} binTipSummary The Bin Tip Summary for the Packrun
|
|
3324
3562
|
* @property {Object[]} classTypeTotals An Array of Totals for each Class Type within the Packrun
|
|
3563
|
+
* @property {Array<PackrunController.ClassTypeFruitSizeTotalItem>} classTypeFruitSizeTotals An Array of Totals for each Class Type by Fruit Size within the Packrun
|
|
3325
3564
|
* @property {Object[]} class1SizerSummary An Array of Class 1 Fruit Summaries by Size for all Sizers within the Packrun
|
|
3326
3565
|
* @property {number} class1TotalTrays The Total Class 1 Trays for this Packrun
|
|
3327
3566
|
* @property {number} class1AverageTrayWeight The Average Class 1 Tray Weight for this Packrun
|
|
@@ -3411,6 +3650,15 @@ export default PackrunController;
|
|
|
3411
3650
|
* @memberof Controllers.Packhouse.Site
|
|
3412
3651
|
*/
|
|
3413
3652
|
|
|
3653
|
+
/**
|
|
3654
|
+
* A **PackrunTippedBinsItem** Type
|
|
3655
|
+
*
|
|
3656
|
+
* @typedef {Object} PackrunController.PackrunTippedBinsItem
|
|
3657
|
+
* @property {string} packrunId The Packrun ID
|
|
3658
|
+
* @property {number} tippedBins The Total Tipped Bins for the Packrun
|
|
3659
|
+
* @memberof Controllers.Packhouse.Site
|
|
3660
|
+
*/
|
|
3661
|
+
|
|
3414
3662
|
/**
|
|
3415
3663
|
* A **TimeBatch** Type
|
|
3416
3664
|
*
|
|
@@ -182,7 +182,7 @@ class MAFSizerModel extends BaseModel
|
|
|
182
182
|
/**
|
|
183
183
|
* An Array of Article to Class Type Maps for this MAF Sizer
|
|
184
184
|
*
|
|
185
|
-
* @type {Array<{articleName: string, classType: string}>}
|
|
185
|
+
* @type {Array<{articleName: string, classType: string, matchType: string}>}
|
|
186
186
|
* @public
|
|
187
187
|
*/
|
|
188
188
|
this.articleClassTypes = [];
|
|
@@ -1340,6 +1340,22 @@ class MAFSizerModel extends BaseModel
|
|
|
1340
1340
|
{
|
|
1341
1341
|
articleClassTypesItemObject.classType = "";
|
|
1342
1342
|
}
|
|
1343
|
+
|
|
1344
|
+
if(typeof articleClassTypesItem === 'object' && 'matchType' in articleClassTypesItem)
|
|
1345
|
+
{
|
|
1346
|
+
articleClassTypesItemObject.matchType = (function(){
|
|
1347
|
+
if(typeof articleClassTypesItem.matchType !== 'string')
|
|
1348
|
+
{
|
|
1349
|
+
return String(articleClassTypesItem.matchType);
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
return articleClassTypesItem.matchType;
|
|
1353
|
+
}());
|
|
1354
|
+
}
|
|
1355
|
+
else
|
|
1356
|
+
{
|
|
1357
|
+
articleClassTypesItemObject.matchType = "";
|
|
1358
|
+
}
|
|
1343
1359
|
|
|
1344
1360
|
return articleClassTypesItemObject;
|
|
1345
1361
|
}());
|
package/src/PackageVersion.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '2.7.
|
|
2
|
+
export const version = '2.7.2';
|