@ricado/api-client 2.6.0 → 2.7.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.
Files changed (29) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/Packhouse/Site/PackingLineController.js +2 -1
  3. package/lib/Controllers/Packhouse/Site/ReemoonSizerBatchController.js +915 -0
  4. package/lib/Controllers/Packhouse/Site/ReemoonSizerController.js +300 -0
  5. package/lib/Controllers/Packhouse/Site/ReemoonSizerOutletProductChangeController.js +885 -0
  6. package/lib/Controllers/Packhouse/Site/ReemoonSizerPackrunSummaryController.js +914 -0
  7. package/lib/Controllers/Packhouse/Site/index.js +12 -0
  8. package/lib/Models/Packhouse/Site/PackingLineModel.js +38 -1
  9. package/lib/Models/Packhouse/Site/ReemoonSizerBatchModel.js +547 -0
  10. package/lib/Models/Packhouse/Site/ReemoonSizerModel.js +1272 -0
  11. package/lib/Models/Packhouse/Site/ReemoonSizerOutletProductChangeModel.js +293 -0
  12. package/lib/Models/Packhouse/Site/ReemoonSizerPackrunSummaryModel.js +461 -0
  13. package/lib/Models/Packhouse/Site/index.js +12 -0
  14. package/lib/PackageVersion.js +1 -1
  15. package/lib/index.d.ts +7128 -5158
  16. package/package.json +1 -1
  17. package/src/Controllers/Packhouse/Site/PackingLineController.js +2 -1
  18. package/src/Controllers/Packhouse/Site/ReemoonSizerBatchController.js +1046 -0
  19. package/src/Controllers/Packhouse/Site/ReemoonSizerController.js +277 -0
  20. package/src/Controllers/Packhouse/Site/ReemoonSizerOutletProductChangeController.js +1016 -0
  21. package/src/Controllers/Packhouse/Site/ReemoonSizerPackrunSummaryController.js +1045 -0
  22. package/src/Controllers/Packhouse/Site/index.js +8 -0
  23. package/src/Models/Packhouse/Site/PackingLineModel.js +49 -1
  24. package/src/Models/Packhouse/Site/ReemoonSizerBatchModel.js +596 -0
  25. package/src/Models/Packhouse/Site/ReemoonSizerModel.js +1576 -0
  26. package/src/Models/Packhouse/Site/ReemoonSizerOutletProductChangeModel.js +280 -0
  27. package/src/Models/Packhouse/Site/ReemoonSizerPackrunSummaryModel.js +501 -0
  28. package/src/Models/Packhouse/Site/index.js +8 -0
  29. package/src/PackageVersion.js +1 -1
@@ -0,0 +1,461 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _BaseModel2 = _interopRequireDefault(require("../../../Models/BaseModel"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
13
+
14
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
+
16
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
17
+
18
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
+
20
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
+
22
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
+
24
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25
+
26
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
27
+
28
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
+
30
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
+
32
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
33
+
34
+ /**
35
+ * Model Class for a Reemoon Sizer Packrun Summary
36
+ *
37
+ * @class
38
+ * @hideconstructor
39
+ * @extends BaseModel
40
+ */
41
+ var ReemoonSizerPackrunSummaryModel = /*#__PURE__*/function (_BaseModel) {
42
+ _inherits(ReemoonSizerPackrunSummaryModel, _BaseModel);
43
+
44
+ var _super = _createSuper(ReemoonSizerPackrunSummaryModel);
45
+
46
+ /**
47
+ * ReemoonSizerPackrunSummaryModel Constructor
48
+ *
49
+ * @protected
50
+ * @param {number} siteId The Site ID associated with this Reemoon Sizer Packrun Summary
51
+ */
52
+ function ReemoonSizerPackrunSummaryModel(siteId) {
53
+ var _this;
54
+
55
+ _classCallCheck(this, ReemoonSizerPackrunSummaryModel);
56
+
57
+ _this = _super.call(this);
58
+ /**
59
+ * The Reemoon Sizer Packrun Summary ID
60
+ *
61
+ * @type {string}
62
+ * @public
63
+ */
64
+
65
+ _this.id = "";
66
+ /**
67
+ * The Reemoon Sizer ID this Summary is associated with
68
+ *
69
+ * @type {string}
70
+ * @public
71
+ */
72
+
73
+ _this.reemoonSizerId = "";
74
+ /**
75
+ * The Packrun ID this Summary is associated with
76
+ *
77
+ * @type {string}
78
+ * @public
79
+ */
80
+
81
+ _this.packrunId = "";
82
+ /**
83
+ * When this Summary was Created
84
+ *
85
+ * @type {Date}
86
+ * @public
87
+ */
88
+
89
+ _this.createdTimestamp = new Date();
90
+ /**
91
+ * The Time Batch this Summary is associated with
92
+ *
93
+ * @type {?string}
94
+ * @public
95
+ */
96
+
97
+ _this.timeBatchId = null;
98
+ /**
99
+ * An Array of Packrun Summary Data Objects for each Outlet
100
+ *
101
+ * @type {Array<{name: string, type: string, number: number, totals: Array<{classType: ?string, fruitSize: string, packType: ?string, weight: number, fruitCount: number, packCount: ?number}>}>}
102
+ * @public
103
+ */
104
+
105
+ _this.outletSummaries = [];
106
+ /**
107
+ * An Array that contains the Products initially Assigned to each Outlet
108
+ *
109
+ * @type {Array<{outletNumber: number, productId: ?number, productName: string}>}
110
+ * @public
111
+ */
112
+
113
+ _this.initialOutletProducts = [];
114
+ /**
115
+ * Whether the Reemoon Sizer Packrun Summary has been deleted
116
+ *
117
+ * @type {boolean}
118
+ * @public
119
+ */
120
+
121
+ _this.deleted = false;
122
+ /**
123
+ * When the Reemoon Sizer Packrun Summary was last updated
124
+ *
125
+ * @type {Date}
126
+ * @public
127
+ */
128
+
129
+ _this.updateTimestamp = new Date();
130
+ /**
131
+ * The Site ID associated with this Reemoon Sizer Packrun Summary
132
+ *
133
+ * @type {number}
134
+ * @public
135
+ */
136
+
137
+ _this.siteId = siteId;
138
+ return _this;
139
+ }
140
+ /**
141
+ * Create a new **ReemoonSizerPackrunSummaryModel** from a JSON Object or JSON String
142
+ *
143
+ * @static
144
+ * @public
145
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
146
+ * @param {number} siteId The Site ID associated with this Reemoon Sizer Packrun Summary
147
+ * @return {ReemoonSizerPackrunSummaryModel}
148
+ */
149
+
150
+
151
+ _createClass(ReemoonSizerPackrunSummaryModel, null, [{
152
+ key: "fromJSON",
153
+ value: function fromJSON(json, siteId) {
154
+ var model = new ReemoonSizerPackrunSummaryModel(siteId);
155
+ /**
156
+ * The JSON Object
157
+ *
158
+ * @type {Object<string, any>}
159
+ */
160
+
161
+ var jsonObject = {};
162
+
163
+ if (typeof json === 'string') {
164
+ jsonObject = JSON.parse(json);
165
+ } else if (_typeof(json) === 'object') {
166
+ jsonObject = json;
167
+ }
168
+
169
+ if ('id' in jsonObject) {
170
+ model.id = function () {
171
+ if (typeof jsonObject['id'] !== 'string') {
172
+ return String(jsonObject['id']);
173
+ }
174
+
175
+ return jsonObject['id'];
176
+ }();
177
+ }
178
+
179
+ if ('reemoonSizerId' in jsonObject) {
180
+ model.reemoonSizerId = function () {
181
+ if (typeof jsonObject['reemoonSizerId'] !== 'string') {
182
+ return String(jsonObject['reemoonSizerId']);
183
+ }
184
+
185
+ return jsonObject['reemoonSizerId'];
186
+ }();
187
+ }
188
+
189
+ if ('packrunId' in jsonObject) {
190
+ model.packrunId = function () {
191
+ if (typeof jsonObject['packrunId'] !== 'string') {
192
+ return String(jsonObject['packrunId']);
193
+ }
194
+
195
+ return jsonObject['packrunId'];
196
+ }();
197
+ }
198
+
199
+ if ('createdTimestamp' in jsonObject) {
200
+ model.createdTimestamp = function () {
201
+ if (typeof jsonObject['createdTimestamp'] !== 'string') {
202
+ return new Date(String(jsonObject['createdTimestamp']));
203
+ }
204
+
205
+ return new Date(jsonObject['createdTimestamp']);
206
+ }();
207
+ }
208
+
209
+ if ('timeBatchId' in jsonObject) {
210
+ model.timeBatchId = function () {
211
+ if (jsonObject['timeBatchId'] === null) {
212
+ return null;
213
+ }
214
+
215
+ if (typeof jsonObject['timeBatchId'] !== 'string') {
216
+ return String(jsonObject['timeBatchId']);
217
+ }
218
+
219
+ return jsonObject['timeBatchId'];
220
+ }();
221
+ }
222
+
223
+ if ('outletSummaries' in jsonObject) {
224
+ model.outletSummaries = function () {
225
+ if (Array.isArray(jsonObject['outletSummaries']) !== true) {
226
+ return [];
227
+ }
228
+
229
+ return jsonObject['outletSummaries'].map(function (outletSummariesItem) {
230
+ return function () {
231
+ var outletSummariesItemObject = {};
232
+
233
+ if (_typeof(outletSummariesItem) === 'object' && 'name' in outletSummariesItem) {
234
+ outletSummariesItemObject.name = function () {
235
+ if (typeof outletSummariesItem.name !== 'string') {
236
+ return String(outletSummariesItem.name);
237
+ }
238
+
239
+ return outletSummariesItem.name;
240
+ }();
241
+ } else {
242
+ outletSummariesItemObject.name = "";
243
+ }
244
+
245
+ if (_typeof(outletSummariesItem) === 'object' && 'type' in outletSummariesItem) {
246
+ outletSummariesItemObject.type = function () {
247
+ if (typeof outletSummariesItem.type !== 'string') {
248
+ return String(outletSummariesItem.type);
249
+ }
250
+
251
+ return outletSummariesItem.type;
252
+ }();
253
+ } else {
254
+ outletSummariesItemObject.type = "";
255
+ }
256
+
257
+ if (_typeof(outletSummariesItem) === 'object' && 'number' in outletSummariesItem) {
258
+ outletSummariesItemObject.number = function () {
259
+ if (typeof outletSummariesItem.number !== 'number') {
260
+ return Number.isInteger(Number(outletSummariesItem.number)) ? Number(outletSummariesItem.number) : Math.floor(Number(outletSummariesItem.number));
261
+ }
262
+
263
+ return Number.isInteger(outletSummariesItem.number) ? outletSummariesItem.number : Math.floor(outletSummariesItem.number);
264
+ }();
265
+ } else {
266
+ outletSummariesItemObject.number = 0;
267
+ }
268
+
269
+ if (_typeof(outletSummariesItem) === 'object' && 'totals' in outletSummariesItem) {
270
+ outletSummariesItemObject.totals = function () {
271
+ if (Array.isArray(outletSummariesItem.totals) !== true) {
272
+ return [];
273
+ }
274
+
275
+ return outletSummariesItem.totals.map(function (totalsItem) {
276
+ return function () {
277
+ var totalsItemObject = {};
278
+
279
+ if (_typeof(totalsItem) === 'object' && 'classType' in totalsItem) {
280
+ totalsItemObject.classType = function () {
281
+ if (totalsItem.classType === null) {
282
+ return null;
283
+ }
284
+
285
+ if (typeof totalsItem.classType !== 'string') {
286
+ return String(totalsItem.classType);
287
+ }
288
+
289
+ return totalsItem.classType;
290
+ }();
291
+ } else {
292
+ totalsItemObject.classType = null;
293
+ }
294
+
295
+ if (_typeof(totalsItem) === 'object' && 'fruitSize' in totalsItem) {
296
+ totalsItemObject.fruitSize = function () {
297
+ if (typeof totalsItem.fruitSize !== 'string') {
298
+ return String(totalsItem.fruitSize);
299
+ }
300
+
301
+ return totalsItem.fruitSize;
302
+ }();
303
+ } else {
304
+ totalsItemObject.fruitSize = "";
305
+ }
306
+
307
+ if (_typeof(totalsItem) === 'object' && 'packType' in totalsItem) {
308
+ totalsItemObject.packType = function () {
309
+ if (totalsItem.packType === null) {
310
+ return null;
311
+ }
312
+
313
+ if (typeof totalsItem.packType !== 'string') {
314
+ return String(totalsItem.packType);
315
+ }
316
+
317
+ return totalsItem.packType;
318
+ }();
319
+ } else {
320
+ totalsItemObject.packType = null;
321
+ }
322
+
323
+ if (_typeof(totalsItem) === 'object' && 'weight' in totalsItem) {
324
+ totalsItemObject.weight = function () {
325
+ if (typeof totalsItem.weight !== 'number') {
326
+ return Number(totalsItem.weight);
327
+ }
328
+
329
+ return totalsItem.weight;
330
+ }();
331
+ } else {
332
+ totalsItemObject.weight = 0;
333
+ }
334
+
335
+ if (_typeof(totalsItem) === 'object' && 'fruitCount' in totalsItem) {
336
+ totalsItemObject.fruitCount = function () {
337
+ if (typeof totalsItem.fruitCount !== 'number') {
338
+ return Number.isInteger(Number(totalsItem.fruitCount)) ? Number(totalsItem.fruitCount) : Math.floor(Number(totalsItem.fruitCount));
339
+ }
340
+
341
+ return Number.isInteger(totalsItem.fruitCount) ? totalsItem.fruitCount : Math.floor(totalsItem.fruitCount);
342
+ }();
343
+ } else {
344
+ totalsItemObject.fruitCount = 0;
345
+ }
346
+
347
+ if (_typeof(totalsItem) === 'object' && 'packCount' in totalsItem) {
348
+ totalsItemObject.packCount = function () {
349
+ if (totalsItem.packCount === null) {
350
+ return null;
351
+ }
352
+
353
+ if (typeof totalsItem.packCount !== 'number') {
354
+ return Number(totalsItem.packCount);
355
+ }
356
+
357
+ return totalsItem.packCount;
358
+ }();
359
+ } else {
360
+ totalsItemObject.packCount = null;
361
+ }
362
+
363
+ return totalsItemObject;
364
+ }();
365
+ });
366
+ }();
367
+ } else {
368
+ outletSummariesItemObject.totals = [];
369
+ }
370
+
371
+ return outletSummariesItemObject;
372
+ }();
373
+ });
374
+ }();
375
+ }
376
+
377
+ if ('initialOutletProducts' in jsonObject) {
378
+ model.initialOutletProducts = function () {
379
+ if (Array.isArray(jsonObject['initialOutletProducts']) !== true) {
380
+ return [];
381
+ }
382
+
383
+ return jsonObject['initialOutletProducts'].map(function (initialOutletProductsItem) {
384
+ return function () {
385
+ var initialOutletProductsItemObject = {};
386
+
387
+ if (_typeof(initialOutletProductsItem) === 'object' && 'outletNumber' in initialOutletProductsItem) {
388
+ initialOutletProductsItemObject.outletNumber = function () {
389
+ if (typeof initialOutletProductsItem.outletNumber !== 'number') {
390
+ return Number.isInteger(Number(initialOutletProductsItem.outletNumber)) ? Number(initialOutletProductsItem.outletNumber) : Math.floor(Number(initialOutletProductsItem.outletNumber));
391
+ }
392
+
393
+ return Number.isInteger(initialOutletProductsItem.outletNumber) ? initialOutletProductsItem.outletNumber : Math.floor(initialOutletProductsItem.outletNumber);
394
+ }();
395
+ } else {
396
+ initialOutletProductsItemObject.outletNumber = 0;
397
+ }
398
+
399
+ if (_typeof(initialOutletProductsItem) === 'object' && 'productId' in initialOutletProductsItem) {
400
+ initialOutletProductsItemObject.productId = function () {
401
+ if (initialOutletProductsItem.productId === null) {
402
+ return null;
403
+ }
404
+
405
+ if (typeof initialOutletProductsItem.productId !== 'number') {
406
+ return Number.isInteger(Number(initialOutletProductsItem.productId)) ? Number(initialOutletProductsItem.productId) : Math.floor(Number(initialOutletProductsItem.productId));
407
+ }
408
+
409
+ return Number.isInteger(initialOutletProductsItem.productId) ? initialOutletProductsItem.productId : Math.floor(initialOutletProductsItem.productId);
410
+ }();
411
+ } else {
412
+ initialOutletProductsItemObject.productId = null;
413
+ }
414
+
415
+ if (_typeof(initialOutletProductsItem) === 'object' && 'productName' in initialOutletProductsItem) {
416
+ initialOutletProductsItemObject.productName = function () {
417
+ if (typeof initialOutletProductsItem.productName !== 'string') {
418
+ return String(initialOutletProductsItem.productName);
419
+ }
420
+
421
+ return initialOutletProductsItem.productName;
422
+ }();
423
+ } else {
424
+ initialOutletProductsItemObject.productName = "";
425
+ }
426
+
427
+ return initialOutletProductsItemObject;
428
+ }();
429
+ });
430
+ }();
431
+ }
432
+
433
+ if ('deleted' in jsonObject) {
434
+ model.deleted = function () {
435
+ if (typeof jsonObject['deleted'] !== 'boolean') {
436
+ return Boolean(jsonObject['deleted']);
437
+ }
438
+
439
+ return jsonObject['deleted'];
440
+ }();
441
+ }
442
+
443
+ if ('updateTimestamp' in jsonObject) {
444
+ model.updateTimestamp = function () {
445
+ if (typeof jsonObject['updateTimestamp'] !== 'string') {
446
+ return new Date(String(jsonObject['updateTimestamp']));
447
+ }
448
+
449
+ return new Date(jsonObject['updateTimestamp']);
450
+ }();
451
+ }
452
+
453
+ return model;
454
+ }
455
+ }]);
456
+
457
+ return ReemoonSizerPackrunSummaryModel;
458
+ }(_BaseModel2.default);
459
+
460
+ var _default = ReemoonSizerPackrunSummaryModel;
461
+ exports.default = _default;
@@ -57,6 +57,14 @@ var _PackrunModel = _interopRequireDefault(require("./PackrunModel"));
57
57
 
58
58
  var _PrePackSampleModel = _interopRequireDefault(require("./PrePackSampleModel"));
59
59
 
60
+ var _ReemoonSizerBatchModel = _interopRequireDefault(require("./ReemoonSizerBatchModel"));
61
+
62
+ var _ReemoonSizerModel = _interopRequireDefault(require("./ReemoonSizerModel"));
63
+
64
+ var _ReemoonSizerOutletProductChangeModel = _interopRequireDefault(require("./ReemoonSizerOutletProductChangeModel"));
65
+
66
+ var _ReemoonSizerPackrunSummaryModel = _interopRequireDefault(require("./ReemoonSizerPackrunSummaryModel"));
67
+
60
68
  var _RejectBinModel = _interopRequireDefault(require("./RejectBinModel"));
61
69
 
62
70
  var _RejectBinScaleModel = _interopRequireDefault(require("./RejectBinScaleModel"));
@@ -121,6 +129,10 @@ var Site = {
121
129
  PackingLineModel: _PackingLineModel.default,
122
130
  PackrunModel: _PackrunModel.default,
123
131
  PrePackSampleModel: _PrePackSampleModel.default,
132
+ ReemoonSizerBatchModel: _ReemoonSizerBatchModel.default,
133
+ ReemoonSizerModel: _ReemoonSizerModel.default,
134
+ ReemoonSizerOutletProductChangeModel: _ReemoonSizerOutletProductChangeModel.default,
135
+ ReemoonSizerPackrunSummaryModel: _ReemoonSizerPackrunSummaryModel.default,
124
136
  RejectBinModel: _RejectBinModel.default,
125
137
  RejectBinScaleModel: _RejectBinScaleModel.default,
126
138
  RejectBinWeightModel: _RejectBinWeightModel.default,
@@ -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.6.0';
8
+ var version = '2.7.0';
9
9
  exports.version = version;