@ricado/api-client 2.1.1 → 2.2.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 (41) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/Packhouse/Site/BinTipBinController.js +622 -0
  3. package/lib/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
  4. package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +657 -0
  5. package/lib/Controllers/Packhouse/Site/PackingLineController.js +25 -1
  6. package/lib/Controllers/Packhouse/Site/PackrunController.js +42 -0
  7. package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
  8. package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +661 -0
  9. package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +628 -0
  10. package/lib/Controllers/Packhouse/Site/index.js +12 -0
  11. package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
  12. package/lib/Models/Packhouse/Site/CompacSizerModel.js +1 -1
  13. package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
  14. package/lib/Models/Packhouse/Site/PackingLineModel.js +524 -1
  15. package/lib/Models/Packhouse/Site/PackrunModel.js +66 -0
  16. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +167 -1
  17. package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
  18. package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
  19. package/lib/Models/Packhouse/Site/index.js +12 -0
  20. package/lib/PackageVersion.js +1 -1
  21. package/lib/index.d.ts +2241 -146
  22. package/package.json +1 -1
  23. package/src/Controllers/Packhouse/Site/BinTipBinController.js +665 -0
  24. package/src/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
  25. package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +700 -0
  26. package/src/Controllers/Packhouse/Site/PackingLineController.js +25 -1
  27. package/src/Controllers/Packhouse/Site/PackrunController.js +52 -0
  28. package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
  29. package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +704 -0
  30. package/src/Controllers/Packhouse/Site/ShiftTaskController.js +671 -0
  31. package/src/Controllers/Packhouse/Site/index.js +8 -0
  32. package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
  33. package/src/Models/Packhouse/Site/CompacSizerModel.js +1 -1
  34. package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
  35. package/src/Models/Packhouse/Site/PackingLineModel.js +705 -1
  36. package/src/Models/Packhouse/Site/PackrunModel.js +75 -0
  37. package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +192 -1
  38. package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
  39. package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
  40. package/src/Models/Packhouse/Site/index.js +8 -0
  41. package/src/PackageVersion.js +1 -1
@@ -0,0 +1,481 @@
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 FreshQuality Packrun Summary
36
+ *
37
+ * @class
38
+ * @hideconstructor
39
+ * @extends BaseModel
40
+ */
41
+ var FreshQualityPackrunSummaryModel = /*#__PURE__*/function (_BaseModel) {
42
+ _inherits(FreshQualityPackrunSummaryModel, _BaseModel);
43
+
44
+ var _super = _createSuper(FreshQualityPackrunSummaryModel);
45
+
46
+ /**
47
+ * FreshQualityPackrunSummaryModel Constructor
48
+ *
49
+ * @protected
50
+ * @param {number} siteId The Site ID associated with this FreshQuality Packrun Summary
51
+ */
52
+ function FreshQualityPackrunSummaryModel(siteId) {
53
+ var _this;
54
+
55
+ _classCallCheck(this, FreshQualityPackrunSummaryModel);
56
+
57
+ _this = _super.call(this);
58
+ /**
59
+ * The FreshQuality Packrun Summary ID
60
+ *
61
+ * @type {string}
62
+ * @public
63
+ */
64
+
65
+ _this.id = undefined;
66
+ /**
67
+ * The Packing Line ID this Summary is associated with
68
+ *
69
+ * @type {string}
70
+ * @public
71
+ */
72
+
73
+ _this.packingLineId = undefined;
74
+ /**
75
+ * The Packrun ID this Summary is associated with
76
+ *
77
+ * @type {string}
78
+ * @public
79
+ */
80
+
81
+ _this.packrunId = undefined;
82
+ /**
83
+ * When this Summary was Created
84
+ *
85
+ * @type {Date}
86
+ * @public
87
+ */
88
+
89
+ _this.createdTimestamp = undefined;
90
+ /**
91
+ * The Time Batch this Summary is associated with
92
+ *
93
+ * @type {?string}
94
+ * @public
95
+ */
96
+
97
+ _this.timeBatchId = undefined;
98
+ /**
99
+ * An Array of Class 1 R600 Samples
100
+ *
101
+ * @type {Array<{fruitSize: string, packType: string, timestamp: Date, fruitCount: number, defects: Array<{name: string, group: string, fruitCount: number}>}>}
102
+ * @public
103
+ */
104
+
105
+ _this.class1R600Samples = undefined;
106
+ /**
107
+ * An Array of Defect Category Summaries (e.g. Minor Packing Defects, Softs)
108
+ *
109
+ * @type {Array<{name: string, percentage: number, defects: Array<{name: string, fruitCount: number, percentage: number}>}>}
110
+ * @public
111
+ */
112
+
113
+ _this.categorySummaries = undefined;
114
+ /**
115
+ * The Total Number of Fruit Sampled in this Packrun Summary
116
+ *
117
+ * @type {number}
118
+ * @public
119
+ */
120
+
121
+ _this.totalFruitSampled = undefined;
122
+ /**
123
+ * Whether the FreshQuality Packrun Summary has been deleted
124
+ *
125
+ * @type {boolean}
126
+ * @public
127
+ */
128
+
129
+ _this.deleted = undefined;
130
+ /**
131
+ * When the FreshQuality Packrun Summary was last updated
132
+ *
133
+ * @type {Date}
134
+ * @public
135
+ */
136
+
137
+ _this.updateTimestamp = undefined;
138
+ /**
139
+ * The Site ID associated with this FreshQuality Packrun Summary
140
+ *
141
+ * @type {number}
142
+ * @public
143
+ */
144
+
145
+ _this.siteId = siteId;
146
+ return _this;
147
+ }
148
+ /**
149
+ * Create a new **FreshQualityPackrunSummaryModel** from a JSON Object or JSON String
150
+ *
151
+ * @static
152
+ * @public
153
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
154
+ * @param {number} siteId The Site ID associated with this FreshQuality Packrun Summary
155
+ * @return {FreshQualityPackrunSummaryModel}
156
+ */
157
+
158
+
159
+ _createClass(FreshQualityPackrunSummaryModel, null, [{
160
+ key: "fromJSON",
161
+ value: function fromJSON(json, siteId) {
162
+ var model = new FreshQualityPackrunSummaryModel(siteId);
163
+ /**
164
+ * The JSON Object
165
+ *
166
+ * @type {Object<string, any>}
167
+ */
168
+
169
+ var jsonObject = {};
170
+
171
+ if (typeof json === 'string') {
172
+ jsonObject = JSON.parse(json);
173
+ } else if (_typeof(json) === 'object') {
174
+ jsonObject = json;
175
+ }
176
+
177
+ if ('id' in jsonObject) {
178
+ model.id = function () {
179
+ if (typeof jsonObject['id'] !== 'string') {
180
+ return String(jsonObject['id']);
181
+ }
182
+
183
+ return jsonObject['id'];
184
+ }();
185
+ }
186
+
187
+ if ('packingLineId' in jsonObject) {
188
+ model.packingLineId = function () {
189
+ if (typeof jsonObject['packingLineId'] !== 'string') {
190
+ return String(jsonObject['packingLineId']);
191
+ }
192
+
193
+ return jsonObject['packingLineId'];
194
+ }();
195
+ }
196
+
197
+ if ('packrunId' in jsonObject) {
198
+ model.packrunId = function () {
199
+ if (typeof jsonObject['packrunId'] !== 'string') {
200
+ return String(jsonObject['packrunId']);
201
+ }
202
+
203
+ return jsonObject['packrunId'];
204
+ }();
205
+ }
206
+
207
+ if ('createdTimestamp' in jsonObject) {
208
+ model.createdTimestamp = function () {
209
+ if (typeof jsonObject['createdTimestamp'] !== 'string') {
210
+ return new Date(String(jsonObject['createdTimestamp']));
211
+ }
212
+
213
+ return new Date(jsonObject['createdTimestamp']);
214
+ }();
215
+ }
216
+
217
+ if ('timeBatchId' in jsonObject) {
218
+ model.timeBatchId = function () {
219
+ if (jsonObject['timeBatchId'] === null) {
220
+ return null;
221
+ }
222
+
223
+ if (typeof jsonObject['timeBatchId'] !== 'string') {
224
+ return String(jsonObject['timeBatchId']);
225
+ }
226
+
227
+ return jsonObject['timeBatchId'];
228
+ }();
229
+ }
230
+
231
+ if ('class1R600Samples' in jsonObject) {
232
+ model.class1R600Samples = function () {
233
+ if (Array.isArray(jsonObject['class1R600Samples']) !== true) {
234
+ return [];
235
+ }
236
+
237
+ return jsonObject['class1R600Samples'].map(function (class1R600SamplesItem) {
238
+ return function () {
239
+ var class1R600SamplesItemObject = {};
240
+
241
+ if (_typeof(class1R600SamplesItem) === 'object' && 'fruitSize' in class1R600SamplesItem) {
242
+ class1R600SamplesItemObject.fruitSize = function () {
243
+ if (typeof class1R600SamplesItem.fruitSize !== 'string') {
244
+ return String(class1R600SamplesItem.fruitSize);
245
+ }
246
+
247
+ return class1R600SamplesItem.fruitSize;
248
+ }();
249
+ } else {
250
+ class1R600SamplesItemObject.fruitSize = "";
251
+ }
252
+
253
+ if (_typeof(class1R600SamplesItem) === 'object' && 'packType' in class1R600SamplesItem) {
254
+ class1R600SamplesItemObject.packType = function () {
255
+ if (typeof class1R600SamplesItem.packType !== 'string') {
256
+ return String(class1R600SamplesItem.packType);
257
+ }
258
+
259
+ return class1R600SamplesItem.packType;
260
+ }();
261
+ } else {
262
+ class1R600SamplesItemObject.packType = "";
263
+ }
264
+
265
+ if (_typeof(class1R600SamplesItem) === 'object' && 'timestamp' in class1R600SamplesItem) {
266
+ class1R600SamplesItemObject.timestamp = function () {
267
+ if (typeof class1R600SamplesItem.timestamp !== 'string') {
268
+ return new Date(String(class1R600SamplesItem.timestamp));
269
+ }
270
+
271
+ return new Date(class1R600SamplesItem.timestamp);
272
+ }();
273
+ } else {
274
+ class1R600SamplesItemObject.timestamp = new Date();
275
+ }
276
+
277
+ if (_typeof(class1R600SamplesItem) === 'object' && 'fruitCount' in class1R600SamplesItem) {
278
+ class1R600SamplesItemObject.fruitCount = function () {
279
+ if (typeof class1R600SamplesItem.fruitCount !== 'number') {
280
+ return Number.isInteger(Number(class1R600SamplesItem.fruitCount)) ? Number(class1R600SamplesItem.fruitCount) : Math.floor(Number(class1R600SamplesItem.fruitCount));
281
+ }
282
+
283
+ return Number.isInteger(class1R600SamplesItem.fruitCount) ? class1R600SamplesItem.fruitCount : Math.floor(class1R600SamplesItem.fruitCount);
284
+ }();
285
+ } else {
286
+ class1R600SamplesItemObject.fruitCount = 0;
287
+ }
288
+
289
+ if (_typeof(class1R600SamplesItem) === 'object' && 'defects' in class1R600SamplesItem) {
290
+ class1R600SamplesItemObject.defects = function () {
291
+ if (Array.isArray(class1R600SamplesItem.defects) !== true) {
292
+ return [];
293
+ }
294
+
295
+ return class1R600SamplesItem.defects.map(function (defectsItem) {
296
+ return function () {
297
+ var defectsItemObject = {};
298
+
299
+ if (_typeof(defectsItem) === 'object' && 'name' in defectsItem) {
300
+ defectsItemObject.name = function () {
301
+ if (typeof defectsItem.name !== 'string') {
302
+ return String(defectsItem.name);
303
+ }
304
+
305
+ return defectsItem.name;
306
+ }();
307
+ } else {
308
+ defectsItemObject.name = "";
309
+ }
310
+
311
+ if (_typeof(defectsItem) === 'object' && 'group' in defectsItem) {
312
+ defectsItemObject.group = function () {
313
+ if (typeof defectsItem.group !== 'string') {
314
+ return String(defectsItem.group);
315
+ }
316
+
317
+ return defectsItem.group;
318
+ }();
319
+ } else {
320
+ defectsItemObject.group = "";
321
+ }
322
+
323
+ if (_typeof(defectsItem) === 'object' && 'fruitCount' in defectsItem) {
324
+ defectsItemObject.fruitCount = function () {
325
+ if (typeof defectsItem.fruitCount !== 'number') {
326
+ return Number.isInteger(Number(defectsItem.fruitCount)) ? Number(defectsItem.fruitCount) : Math.floor(Number(defectsItem.fruitCount));
327
+ }
328
+
329
+ return Number.isInteger(defectsItem.fruitCount) ? defectsItem.fruitCount : Math.floor(defectsItem.fruitCount);
330
+ }();
331
+ } else {
332
+ defectsItemObject.fruitCount = 0;
333
+ }
334
+
335
+ return defectsItemObject;
336
+ }();
337
+ });
338
+ }();
339
+ } else {
340
+ class1R600SamplesItemObject.defects = [];
341
+ }
342
+
343
+ return class1R600SamplesItemObject;
344
+ }();
345
+ });
346
+ }();
347
+ }
348
+
349
+ if ('categorySummaries' in jsonObject) {
350
+ model.categorySummaries = function () {
351
+ if (Array.isArray(jsonObject['categorySummaries']) !== true) {
352
+ return [];
353
+ }
354
+
355
+ return jsonObject['categorySummaries'].map(function (categorySummariesItem) {
356
+ return function () {
357
+ var categorySummariesItemObject = {};
358
+
359
+ if (_typeof(categorySummariesItem) === 'object' && 'name' in categorySummariesItem) {
360
+ categorySummariesItemObject.name = function () {
361
+ if (typeof categorySummariesItem.name !== 'string') {
362
+ return String(categorySummariesItem.name);
363
+ }
364
+
365
+ return categorySummariesItem.name;
366
+ }();
367
+ } else {
368
+ categorySummariesItemObject.name = "";
369
+ }
370
+
371
+ if (_typeof(categorySummariesItem) === 'object' && 'percentage' in categorySummariesItem) {
372
+ categorySummariesItemObject.percentage = function () {
373
+ if (typeof categorySummariesItem.percentage !== 'number') {
374
+ return Number(categorySummariesItem.percentage);
375
+ }
376
+
377
+ return categorySummariesItem.percentage;
378
+ }();
379
+ } else {
380
+ categorySummariesItemObject.percentage = 0;
381
+ }
382
+
383
+ if (_typeof(categorySummariesItem) === 'object' && 'defects' in categorySummariesItem) {
384
+ categorySummariesItemObject.defects = function () {
385
+ if (Array.isArray(categorySummariesItem.defects) !== true) {
386
+ return [];
387
+ }
388
+
389
+ return categorySummariesItem.defects.map(function (defectsItem) {
390
+ return function () {
391
+ var defectsItemObject = {};
392
+
393
+ if (_typeof(defectsItem) === 'object' && 'name' in defectsItem) {
394
+ defectsItemObject.name = function () {
395
+ if (typeof defectsItem.name !== 'string') {
396
+ return String(defectsItem.name);
397
+ }
398
+
399
+ return defectsItem.name;
400
+ }();
401
+ } else {
402
+ defectsItemObject.name = "";
403
+ }
404
+
405
+ if (_typeof(defectsItem) === 'object' && 'fruitCount' in defectsItem) {
406
+ defectsItemObject.fruitCount = function () {
407
+ if (typeof defectsItem.fruitCount !== 'number') {
408
+ return Number.isInteger(Number(defectsItem.fruitCount)) ? Number(defectsItem.fruitCount) : Math.floor(Number(defectsItem.fruitCount));
409
+ }
410
+
411
+ return Number.isInteger(defectsItem.fruitCount) ? defectsItem.fruitCount : Math.floor(defectsItem.fruitCount);
412
+ }();
413
+ } else {
414
+ defectsItemObject.fruitCount = 0;
415
+ }
416
+
417
+ if (_typeof(defectsItem) === 'object' && 'percentage' in defectsItem) {
418
+ defectsItemObject.percentage = function () {
419
+ if (typeof defectsItem.percentage !== 'number') {
420
+ return Number(defectsItem.percentage);
421
+ }
422
+
423
+ return defectsItem.percentage;
424
+ }();
425
+ } else {
426
+ defectsItemObject.percentage = 0;
427
+ }
428
+
429
+ return defectsItemObject;
430
+ }();
431
+ });
432
+ }();
433
+ } else {
434
+ categorySummariesItemObject.defects = [];
435
+ }
436
+
437
+ return categorySummariesItemObject;
438
+ }();
439
+ });
440
+ }();
441
+ }
442
+
443
+ if ('totalFruitSampled' in jsonObject) {
444
+ model.totalFruitSampled = function () {
445
+ if (typeof jsonObject['totalFruitSampled'] !== 'number') {
446
+ return Number.isInteger(Number(jsonObject['totalFruitSampled'])) ? Number(jsonObject['totalFruitSampled']) : Math.floor(Number(jsonObject['totalFruitSampled']));
447
+ }
448
+
449
+ return Number.isInteger(jsonObject['totalFruitSampled']) ? jsonObject['totalFruitSampled'] : Math.floor(jsonObject['totalFruitSampled']);
450
+ }();
451
+ }
452
+
453
+ if ('deleted' in jsonObject) {
454
+ model.deleted = function () {
455
+ if (typeof jsonObject['deleted'] !== 'boolean') {
456
+ return Boolean(jsonObject['deleted']);
457
+ }
458
+
459
+ return jsonObject['deleted'];
460
+ }();
461
+ }
462
+
463
+ if ('updateTimestamp' in jsonObject) {
464
+ model.updateTimestamp = function () {
465
+ if (typeof jsonObject['updateTimestamp'] !== 'string') {
466
+ return new Date(String(jsonObject['updateTimestamp']));
467
+ }
468
+
469
+ return new Date(jsonObject['updateTimestamp']);
470
+ }();
471
+ }
472
+
473
+ return model;
474
+ }
475
+ }]);
476
+
477
+ return FreshQualityPackrunSummaryModel;
478
+ }(_BaseModel2.default);
479
+
480
+ var _default = FreshQualityPackrunSummaryModel;
481
+ exports.default = _default;