@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,1272 @@
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
36
+ *
37
+ * @class
38
+ * @hideconstructor
39
+ * @extends BaseModel
40
+ */
41
+ var ReemoonSizerModel = /*#__PURE__*/function (_BaseModel) {
42
+ _inherits(ReemoonSizerModel, _BaseModel);
43
+
44
+ var _super = _createSuper(ReemoonSizerModel);
45
+
46
+ /**
47
+ * ReemoonSizerModel Constructor
48
+ *
49
+ * @protected
50
+ * @param {number} siteId The Site ID associated with this Reemoon Sizer
51
+ */
52
+ function ReemoonSizerModel(siteId) {
53
+ var _this;
54
+
55
+ _classCallCheck(this, ReemoonSizerModel);
56
+
57
+ _this = _super.call(this);
58
+ /**
59
+ * The Reemoon Sizer ID
60
+ *
61
+ * @type {string}
62
+ * @public
63
+ */
64
+
65
+ _this.id = "";
66
+ /**
67
+ * The RTU this Reemoon Sizer belongs to
68
+ *
69
+ * @type {?number}
70
+ * @public
71
+ */
72
+
73
+ _this.rtuId = null;
74
+ /**
75
+ * The Reemoon Sizer Name
76
+ *
77
+ * @type {string}
78
+ * @public
79
+ */
80
+
81
+ _this.name = "";
82
+ /**
83
+ * The Packing Line ID that manages this Reemoon Sizer
84
+ *
85
+ * @type {string}
86
+ * @public
87
+ */
88
+
89
+ _this.packingLineId = "";
90
+ /**
91
+ * The Sizer Type
92
+ *
93
+ * @type {string}
94
+ * @public
95
+ */
96
+
97
+ _this.sizerType = "";
98
+ /**
99
+ * The Auto Create Batch Delay in Seconds for this Reemoon Sizer
100
+ *
101
+ * @type {number}
102
+ * @public
103
+ */
104
+
105
+ _this.autoCreateBatchDelay = 0;
106
+ /**
107
+ * The Points used by this Reemoon Sizer
108
+ *
109
+ * @type {{currentBatchId: number, currentBatchName: number, currentBatchVarietyCode: number, currentBatchStartTimestamp: number, currentBatchPackrunId: number, currentBatchPackrunName: number, machineAverageFruitWeight: number, machineAverageFruitSize: number, machineCupFill: number, machineIncomingFruitPerMinute: number, machineRecycledFruitPerMinute: number, machineTraysPerHour: number, machineTonnesPerHour: number, machineRodsPerMinute: number, machineIncomingFruitPerMinuteBySize: ?number, machineRecycledFruitPerMinuteBySize: ?number, machineLanesFruitPerMinuteBySize: ?number, createNewBatchRequest: number, createBatchOnPackrunChange: number, createBatchOnTimeBatchChange: number, outletGroupSummaries: number, products: number, packTypeOutletUtilizationTargets: number, class1TraysPerHour: ?number}}
110
+ * @public
111
+ */
112
+
113
+ _this.points = function () {
114
+ var pointsDefaultValue = {};
115
+ pointsDefaultValue.currentBatchId = 0;
116
+ pointsDefaultValue.currentBatchName = 0;
117
+ pointsDefaultValue.currentBatchVarietyCode = 0;
118
+ pointsDefaultValue.currentBatchStartTimestamp = 0;
119
+ pointsDefaultValue.currentBatchPackrunId = 0;
120
+ pointsDefaultValue.currentBatchPackrunName = 0;
121
+ pointsDefaultValue.machineAverageFruitWeight = 0;
122
+ pointsDefaultValue.machineAverageFruitSize = 0;
123
+ pointsDefaultValue.machineCupFill = 0;
124
+ pointsDefaultValue.machineIncomingFruitPerMinute = 0;
125
+ pointsDefaultValue.machineRecycledFruitPerMinute = 0;
126
+ pointsDefaultValue.machineTraysPerHour = 0;
127
+ pointsDefaultValue.machineTonnesPerHour = 0;
128
+ pointsDefaultValue.machineRodsPerMinute = 0;
129
+ pointsDefaultValue.machineIncomingFruitPerMinuteBySize = null;
130
+ pointsDefaultValue.machineRecycledFruitPerMinuteBySize = null;
131
+ pointsDefaultValue.machineLanesFruitPerMinuteBySize = null;
132
+ pointsDefaultValue.createNewBatchRequest = 0;
133
+ pointsDefaultValue.createBatchOnPackrunChange = 0;
134
+ pointsDefaultValue.createBatchOnTimeBatchChange = 0;
135
+ pointsDefaultValue.outletGroupSummaries = 0;
136
+ pointsDefaultValue.products = 0;
137
+ pointsDefaultValue.packTypeOutletUtilizationTargets = 0;
138
+ pointsDefaultValue.class1TraysPerHour = null;
139
+ return pointsDefaultValue;
140
+ }();
141
+ /**
142
+ * The Lanes defined for this Reemoon Sizer
143
+ *
144
+ * @type {Array<{id: string, number: number, points: {cupFill: number}}>}
145
+ * @public
146
+ */
147
+
148
+
149
+ _this.lanes = [];
150
+ /**
151
+ * The Outlets defined for this Reemoon Sizer
152
+ *
153
+ * @type {Array<{id: string, number: number, type: string, points: {name: number, fruitPerMinute: number, packsPerMinute: number, utilization: number, status: number, productId: number, productName: number}}>}
154
+ * @public
155
+ */
156
+
157
+ _this.outlets = [];
158
+ /**
159
+ * The Fruit Sizes defined and handled by this Reemoon Sizer
160
+ *
161
+ * @type {Array<{fruitSize: string, points: {incomingFruitPerMinute: number, recycledFruitPerMinute: number, allocatedFruitPerMinute: number}}>}
162
+ * @public
163
+ */
164
+
165
+ _this.fruitSizes = [];
166
+ /**
167
+ * The FreshPack Integration Configuration for this Reemoon Sizer
168
+ *
169
+ * @type {?{points: Object, enabled: boolean, materialGroupId: number, binTypeId: number, bulkWeightClassTypes: string[]}}
170
+ * @public
171
+ */
172
+
173
+ _this.freshPackIntegration = null;
174
+ /**
175
+ * The Reemoon Integration Configuration for this Reemoon Sizer
176
+ *
177
+ * @type {{points: {apiCommunicationStatus: number, machineId: number, machineName: number, machineLaneCount: number, machineOutletCount: number, machineOutletDetails: number}, enabled: boolean, username: string, password: string, apiBaseUrl: string}}
178
+ * @public
179
+ */
180
+
181
+ _this.reemoonIntegration = function () {
182
+ var reemoonIntegrationDefaultValue = {};
183
+
184
+ reemoonIntegrationDefaultValue.points = function () {
185
+ var pointsDefaultValue = {};
186
+ pointsDefaultValue.apiCommunicationStatus = 0;
187
+ pointsDefaultValue.machineId = 0;
188
+ pointsDefaultValue.machineName = 0;
189
+ pointsDefaultValue.machineLaneCount = 0;
190
+ pointsDefaultValue.machineOutletCount = 0;
191
+ pointsDefaultValue.machineOutletDetails = 0;
192
+ return pointsDefaultValue;
193
+ }();
194
+
195
+ reemoonIntegrationDefaultValue.enabled = false;
196
+ reemoonIntegrationDefaultValue.username = "";
197
+ reemoonIntegrationDefaultValue.password = "";
198
+ reemoonIntegrationDefaultValue.apiBaseUrl = "";
199
+ return reemoonIntegrationDefaultValue;
200
+ }();
201
+ /**
202
+ * An Array of Sources that deliver Fruit to this Reemoon Sizer
203
+ *
204
+ * @type {Array<{type: string, riserId: string}|{type: string, sizerId: string, outletNumbers: number[]}>}
205
+ * @public
206
+ */
207
+
208
+
209
+ _this.sources = [];
210
+ /**
211
+ * An Array of Product to Class Type Maps for this Reemoon Sizer
212
+ *
213
+ * @type {Array<{productName: string, classType: string, matchType: string}>}
214
+ * @public
215
+ */
216
+
217
+ _this.productClassTypes = [];
218
+ /**
219
+ * Whether the Reemoon Sizer has been deleted
220
+ *
221
+ * @type {boolean}
222
+ * @public
223
+ */
224
+
225
+ _this.deleted = false;
226
+ /**
227
+ * When the Reemoon Sizer was last updated
228
+ *
229
+ * @type {Date}
230
+ * @public
231
+ */
232
+
233
+ _this.updateTimestamp = new Date();
234
+ /**
235
+ * The Site ID associated with this Reemoon Sizer
236
+ *
237
+ * @type {number}
238
+ * @public
239
+ */
240
+
241
+ _this.siteId = siteId;
242
+ return _this;
243
+ }
244
+ /**
245
+ * Create a new **ReemoonSizerModel** from a JSON Object or JSON String
246
+ *
247
+ * @static
248
+ * @public
249
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
250
+ * @param {number} siteId The Site ID associated with this Reemoon Sizer
251
+ * @return {ReemoonSizerModel}
252
+ */
253
+
254
+
255
+ _createClass(ReemoonSizerModel, null, [{
256
+ key: "fromJSON",
257
+ value: function fromJSON(json, siteId) {
258
+ var model = new ReemoonSizerModel(siteId);
259
+ /**
260
+ * The JSON Object
261
+ *
262
+ * @type {Object<string, any>}
263
+ */
264
+
265
+ var jsonObject = {};
266
+
267
+ if (typeof json === 'string') {
268
+ jsonObject = JSON.parse(json);
269
+ } else if (_typeof(json) === 'object') {
270
+ jsonObject = json;
271
+ }
272
+
273
+ if ('id' in jsonObject) {
274
+ model.id = function () {
275
+ if (typeof jsonObject['id'] !== 'string') {
276
+ return String(jsonObject['id']);
277
+ }
278
+
279
+ return jsonObject['id'];
280
+ }();
281
+ }
282
+
283
+ if ('rtuId' in jsonObject) {
284
+ model.rtuId = function () {
285
+ if (jsonObject['rtuId'] === null) {
286
+ return null;
287
+ }
288
+
289
+ if (typeof jsonObject['rtuId'] !== 'number') {
290
+ return Number.isInteger(Number(jsonObject['rtuId'])) ? Number(jsonObject['rtuId']) : Math.floor(Number(jsonObject['rtuId']));
291
+ }
292
+
293
+ return Number.isInteger(jsonObject['rtuId']) ? jsonObject['rtuId'] : Math.floor(jsonObject['rtuId']);
294
+ }();
295
+ }
296
+
297
+ if ('name' in jsonObject) {
298
+ model.name = function () {
299
+ if (typeof jsonObject['name'] !== 'string') {
300
+ return String(jsonObject['name']);
301
+ }
302
+
303
+ return jsonObject['name'];
304
+ }();
305
+ }
306
+
307
+ if ('packingLineId' in jsonObject) {
308
+ model.packingLineId = function () {
309
+ if (typeof jsonObject['packingLineId'] !== 'string') {
310
+ return String(jsonObject['packingLineId']);
311
+ }
312
+
313
+ return jsonObject['packingLineId'];
314
+ }();
315
+ }
316
+
317
+ if ('sizerType' in jsonObject) {
318
+ model.sizerType = function () {
319
+ if (typeof jsonObject['sizerType'] !== 'string') {
320
+ return String(jsonObject['sizerType']);
321
+ }
322
+
323
+ return jsonObject['sizerType'];
324
+ }();
325
+ }
326
+
327
+ if ('autoCreateBatchDelay' in jsonObject) {
328
+ model.autoCreateBatchDelay = function () {
329
+ if (typeof jsonObject['autoCreateBatchDelay'] !== 'number') {
330
+ return Number.isInteger(Number(jsonObject['autoCreateBatchDelay'])) ? Number(jsonObject['autoCreateBatchDelay']) : Math.floor(Number(jsonObject['autoCreateBatchDelay']));
331
+ }
332
+
333
+ return Number.isInteger(jsonObject['autoCreateBatchDelay']) ? jsonObject['autoCreateBatchDelay'] : Math.floor(jsonObject['autoCreateBatchDelay']);
334
+ }();
335
+ }
336
+
337
+ if ('points' in jsonObject) {
338
+ model.points = function () {
339
+ var pointsObject = {};
340
+
341
+ if (_typeof(jsonObject['points']) === 'object' && 'currentBatchId' in jsonObject['points']) {
342
+ pointsObject.currentBatchId = function () {
343
+ if (typeof jsonObject['points'].currentBatchId !== 'number') {
344
+ return Number.isInteger(Number(jsonObject['points'].currentBatchId)) ? Number(jsonObject['points'].currentBatchId) : Math.floor(Number(jsonObject['points'].currentBatchId));
345
+ }
346
+
347
+ return Number.isInteger(jsonObject['points'].currentBatchId) ? jsonObject['points'].currentBatchId : Math.floor(jsonObject['points'].currentBatchId);
348
+ }();
349
+ } else {
350
+ pointsObject.currentBatchId = 0;
351
+ }
352
+
353
+ if (_typeof(jsonObject['points']) === 'object' && 'currentBatchName' in jsonObject['points']) {
354
+ pointsObject.currentBatchName = function () {
355
+ if (typeof jsonObject['points'].currentBatchName !== 'number') {
356
+ return Number.isInteger(Number(jsonObject['points'].currentBatchName)) ? Number(jsonObject['points'].currentBatchName) : Math.floor(Number(jsonObject['points'].currentBatchName));
357
+ }
358
+
359
+ return Number.isInteger(jsonObject['points'].currentBatchName) ? jsonObject['points'].currentBatchName : Math.floor(jsonObject['points'].currentBatchName);
360
+ }();
361
+ } else {
362
+ pointsObject.currentBatchName = 0;
363
+ }
364
+
365
+ if (_typeof(jsonObject['points']) === 'object' && 'currentBatchVarietyCode' in jsonObject['points']) {
366
+ pointsObject.currentBatchVarietyCode = function () {
367
+ if (typeof jsonObject['points'].currentBatchVarietyCode !== 'number') {
368
+ return Number.isInteger(Number(jsonObject['points'].currentBatchVarietyCode)) ? Number(jsonObject['points'].currentBatchVarietyCode) : Math.floor(Number(jsonObject['points'].currentBatchVarietyCode));
369
+ }
370
+
371
+ return Number.isInteger(jsonObject['points'].currentBatchVarietyCode) ? jsonObject['points'].currentBatchVarietyCode : Math.floor(jsonObject['points'].currentBatchVarietyCode);
372
+ }();
373
+ } else {
374
+ pointsObject.currentBatchVarietyCode = 0;
375
+ }
376
+
377
+ if (_typeof(jsonObject['points']) === 'object' && 'currentBatchStartTimestamp' in jsonObject['points']) {
378
+ pointsObject.currentBatchStartTimestamp = function () {
379
+ if (typeof jsonObject['points'].currentBatchStartTimestamp !== 'number') {
380
+ return Number.isInteger(Number(jsonObject['points'].currentBatchStartTimestamp)) ? Number(jsonObject['points'].currentBatchStartTimestamp) : Math.floor(Number(jsonObject['points'].currentBatchStartTimestamp));
381
+ }
382
+
383
+ return Number.isInteger(jsonObject['points'].currentBatchStartTimestamp) ? jsonObject['points'].currentBatchStartTimestamp : Math.floor(jsonObject['points'].currentBatchStartTimestamp);
384
+ }();
385
+ } else {
386
+ pointsObject.currentBatchStartTimestamp = 0;
387
+ }
388
+
389
+ if (_typeof(jsonObject['points']) === 'object' && 'currentBatchPackrunId' in jsonObject['points']) {
390
+ pointsObject.currentBatchPackrunId = function () {
391
+ if (typeof jsonObject['points'].currentBatchPackrunId !== 'number') {
392
+ return Number.isInteger(Number(jsonObject['points'].currentBatchPackrunId)) ? Number(jsonObject['points'].currentBatchPackrunId) : Math.floor(Number(jsonObject['points'].currentBatchPackrunId));
393
+ }
394
+
395
+ return Number.isInteger(jsonObject['points'].currentBatchPackrunId) ? jsonObject['points'].currentBatchPackrunId : Math.floor(jsonObject['points'].currentBatchPackrunId);
396
+ }();
397
+ } else {
398
+ pointsObject.currentBatchPackrunId = 0;
399
+ }
400
+
401
+ if (_typeof(jsonObject['points']) === 'object' && 'currentBatchPackrunName' in jsonObject['points']) {
402
+ pointsObject.currentBatchPackrunName = function () {
403
+ if (typeof jsonObject['points'].currentBatchPackrunName !== 'number') {
404
+ return Number.isInteger(Number(jsonObject['points'].currentBatchPackrunName)) ? Number(jsonObject['points'].currentBatchPackrunName) : Math.floor(Number(jsonObject['points'].currentBatchPackrunName));
405
+ }
406
+
407
+ return Number.isInteger(jsonObject['points'].currentBatchPackrunName) ? jsonObject['points'].currentBatchPackrunName : Math.floor(jsonObject['points'].currentBatchPackrunName);
408
+ }();
409
+ } else {
410
+ pointsObject.currentBatchPackrunName = 0;
411
+ }
412
+
413
+ if (_typeof(jsonObject['points']) === 'object' && 'machineAverageFruitWeight' in jsonObject['points']) {
414
+ pointsObject.machineAverageFruitWeight = function () {
415
+ if (typeof jsonObject['points'].machineAverageFruitWeight !== 'number') {
416
+ return Number.isInteger(Number(jsonObject['points'].machineAverageFruitWeight)) ? Number(jsonObject['points'].machineAverageFruitWeight) : Math.floor(Number(jsonObject['points'].machineAverageFruitWeight));
417
+ }
418
+
419
+ return Number.isInteger(jsonObject['points'].machineAverageFruitWeight) ? jsonObject['points'].machineAverageFruitWeight : Math.floor(jsonObject['points'].machineAverageFruitWeight);
420
+ }();
421
+ } else {
422
+ pointsObject.machineAverageFruitWeight = 0;
423
+ }
424
+
425
+ if (_typeof(jsonObject['points']) === 'object' && 'machineAverageFruitSize' in jsonObject['points']) {
426
+ pointsObject.machineAverageFruitSize = function () {
427
+ if (typeof jsonObject['points'].machineAverageFruitSize !== 'number') {
428
+ return Number.isInteger(Number(jsonObject['points'].machineAverageFruitSize)) ? Number(jsonObject['points'].machineAverageFruitSize) : Math.floor(Number(jsonObject['points'].machineAverageFruitSize));
429
+ }
430
+
431
+ return Number.isInteger(jsonObject['points'].machineAverageFruitSize) ? jsonObject['points'].machineAverageFruitSize : Math.floor(jsonObject['points'].machineAverageFruitSize);
432
+ }();
433
+ } else {
434
+ pointsObject.machineAverageFruitSize = 0;
435
+ }
436
+
437
+ if (_typeof(jsonObject['points']) === 'object' && 'machineCupFill' in jsonObject['points']) {
438
+ pointsObject.machineCupFill = function () {
439
+ if (typeof jsonObject['points'].machineCupFill !== 'number') {
440
+ return Number.isInteger(Number(jsonObject['points'].machineCupFill)) ? Number(jsonObject['points'].machineCupFill) : Math.floor(Number(jsonObject['points'].machineCupFill));
441
+ }
442
+
443
+ return Number.isInteger(jsonObject['points'].machineCupFill) ? jsonObject['points'].machineCupFill : Math.floor(jsonObject['points'].machineCupFill);
444
+ }();
445
+ } else {
446
+ pointsObject.machineCupFill = 0;
447
+ }
448
+
449
+ if (_typeof(jsonObject['points']) === 'object' && 'machineIncomingFruitPerMinute' in jsonObject['points']) {
450
+ pointsObject.machineIncomingFruitPerMinute = function () {
451
+ if (typeof jsonObject['points'].machineIncomingFruitPerMinute !== 'number') {
452
+ return Number.isInteger(Number(jsonObject['points'].machineIncomingFruitPerMinute)) ? Number(jsonObject['points'].machineIncomingFruitPerMinute) : Math.floor(Number(jsonObject['points'].machineIncomingFruitPerMinute));
453
+ }
454
+
455
+ return Number.isInteger(jsonObject['points'].machineIncomingFruitPerMinute) ? jsonObject['points'].machineIncomingFruitPerMinute : Math.floor(jsonObject['points'].machineIncomingFruitPerMinute);
456
+ }();
457
+ } else {
458
+ pointsObject.machineIncomingFruitPerMinute = 0;
459
+ }
460
+
461
+ if (_typeof(jsonObject['points']) === 'object' && 'machineRecycledFruitPerMinute' in jsonObject['points']) {
462
+ pointsObject.machineRecycledFruitPerMinute = function () {
463
+ if (typeof jsonObject['points'].machineRecycledFruitPerMinute !== 'number') {
464
+ return Number.isInteger(Number(jsonObject['points'].machineRecycledFruitPerMinute)) ? Number(jsonObject['points'].machineRecycledFruitPerMinute) : Math.floor(Number(jsonObject['points'].machineRecycledFruitPerMinute));
465
+ }
466
+
467
+ return Number.isInteger(jsonObject['points'].machineRecycledFruitPerMinute) ? jsonObject['points'].machineRecycledFruitPerMinute : Math.floor(jsonObject['points'].machineRecycledFruitPerMinute);
468
+ }();
469
+ } else {
470
+ pointsObject.machineRecycledFruitPerMinute = 0;
471
+ }
472
+
473
+ if (_typeof(jsonObject['points']) === 'object' && 'machineTraysPerHour' in jsonObject['points']) {
474
+ pointsObject.machineTraysPerHour = function () {
475
+ if (typeof jsonObject['points'].machineTraysPerHour !== 'number') {
476
+ return Number.isInteger(Number(jsonObject['points'].machineTraysPerHour)) ? Number(jsonObject['points'].machineTraysPerHour) : Math.floor(Number(jsonObject['points'].machineTraysPerHour));
477
+ }
478
+
479
+ return Number.isInteger(jsonObject['points'].machineTraysPerHour) ? jsonObject['points'].machineTraysPerHour : Math.floor(jsonObject['points'].machineTraysPerHour);
480
+ }();
481
+ } else {
482
+ pointsObject.machineTraysPerHour = 0;
483
+ }
484
+
485
+ if (_typeof(jsonObject['points']) === 'object' && 'machineTonnesPerHour' in jsonObject['points']) {
486
+ pointsObject.machineTonnesPerHour = function () {
487
+ if (typeof jsonObject['points'].machineTonnesPerHour !== 'number') {
488
+ return Number.isInteger(Number(jsonObject['points'].machineTonnesPerHour)) ? Number(jsonObject['points'].machineTonnesPerHour) : Math.floor(Number(jsonObject['points'].machineTonnesPerHour));
489
+ }
490
+
491
+ return Number.isInteger(jsonObject['points'].machineTonnesPerHour) ? jsonObject['points'].machineTonnesPerHour : Math.floor(jsonObject['points'].machineTonnesPerHour);
492
+ }();
493
+ } else {
494
+ pointsObject.machineTonnesPerHour = 0;
495
+ }
496
+
497
+ if (_typeof(jsonObject['points']) === 'object' && 'machineRodsPerMinute' in jsonObject['points']) {
498
+ pointsObject.machineRodsPerMinute = function () {
499
+ if (typeof jsonObject['points'].machineRodsPerMinute !== 'number') {
500
+ return Number.isInteger(Number(jsonObject['points'].machineRodsPerMinute)) ? Number(jsonObject['points'].machineRodsPerMinute) : Math.floor(Number(jsonObject['points'].machineRodsPerMinute));
501
+ }
502
+
503
+ return Number.isInteger(jsonObject['points'].machineRodsPerMinute) ? jsonObject['points'].machineRodsPerMinute : Math.floor(jsonObject['points'].machineRodsPerMinute);
504
+ }();
505
+ } else {
506
+ pointsObject.machineRodsPerMinute = 0;
507
+ }
508
+
509
+ if (_typeof(jsonObject['points']) === 'object' && 'machineIncomingFruitPerMinuteBySize' in jsonObject['points']) {
510
+ pointsObject.machineIncomingFruitPerMinuteBySize = function () {
511
+ if (jsonObject['points'].machineIncomingFruitPerMinuteBySize === null) {
512
+ return null;
513
+ }
514
+
515
+ if (typeof jsonObject['points'].machineIncomingFruitPerMinuteBySize !== 'number') {
516
+ return Number.isInteger(Number(jsonObject['points'].machineIncomingFruitPerMinuteBySize)) ? Number(jsonObject['points'].machineIncomingFruitPerMinuteBySize) : Math.floor(Number(jsonObject['points'].machineIncomingFruitPerMinuteBySize));
517
+ }
518
+
519
+ return Number.isInteger(jsonObject['points'].machineIncomingFruitPerMinuteBySize) ? jsonObject['points'].machineIncomingFruitPerMinuteBySize : Math.floor(jsonObject['points'].machineIncomingFruitPerMinuteBySize);
520
+ }();
521
+ } else {
522
+ pointsObject.machineIncomingFruitPerMinuteBySize = null;
523
+ }
524
+
525
+ if (_typeof(jsonObject['points']) === 'object' && 'machineRecycledFruitPerMinuteBySize' in jsonObject['points']) {
526
+ pointsObject.machineRecycledFruitPerMinuteBySize = function () {
527
+ if (jsonObject['points'].machineRecycledFruitPerMinuteBySize === null) {
528
+ return null;
529
+ }
530
+
531
+ if (typeof jsonObject['points'].machineRecycledFruitPerMinuteBySize !== 'number') {
532
+ return Number.isInteger(Number(jsonObject['points'].machineRecycledFruitPerMinuteBySize)) ? Number(jsonObject['points'].machineRecycledFruitPerMinuteBySize) : Math.floor(Number(jsonObject['points'].machineRecycledFruitPerMinuteBySize));
533
+ }
534
+
535
+ return Number.isInteger(jsonObject['points'].machineRecycledFruitPerMinuteBySize) ? jsonObject['points'].machineRecycledFruitPerMinuteBySize : Math.floor(jsonObject['points'].machineRecycledFruitPerMinuteBySize);
536
+ }();
537
+ } else {
538
+ pointsObject.machineRecycledFruitPerMinuteBySize = null;
539
+ }
540
+
541
+ if (_typeof(jsonObject['points']) === 'object' && 'machineLanesFruitPerMinuteBySize' in jsonObject['points']) {
542
+ pointsObject.machineLanesFruitPerMinuteBySize = function () {
543
+ if (jsonObject['points'].machineLanesFruitPerMinuteBySize === null) {
544
+ return null;
545
+ }
546
+
547
+ if (typeof jsonObject['points'].machineLanesFruitPerMinuteBySize !== 'number') {
548
+ return Number.isInteger(Number(jsonObject['points'].machineLanesFruitPerMinuteBySize)) ? Number(jsonObject['points'].machineLanesFruitPerMinuteBySize) : Math.floor(Number(jsonObject['points'].machineLanesFruitPerMinuteBySize));
549
+ }
550
+
551
+ return Number.isInteger(jsonObject['points'].machineLanesFruitPerMinuteBySize) ? jsonObject['points'].machineLanesFruitPerMinuteBySize : Math.floor(jsonObject['points'].machineLanesFruitPerMinuteBySize);
552
+ }();
553
+ } else {
554
+ pointsObject.machineLanesFruitPerMinuteBySize = null;
555
+ }
556
+
557
+ if (_typeof(jsonObject['points']) === 'object' && 'createNewBatchRequest' in jsonObject['points']) {
558
+ pointsObject.createNewBatchRequest = function () {
559
+ if (typeof jsonObject['points'].createNewBatchRequest !== 'number') {
560
+ return Number.isInteger(Number(jsonObject['points'].createNewBatchRequest)) ? Number(jsonObject['points'].createNewBatchRequest) : Math.floor(Number(jsonObject['points'].createNewBatchRequest));
561
+ }
562
+
563
+ return Number.isInteger(jsonObject['points'].createNewBatchRequest) ? jsonObject['points'].createNewBatchRequest : Math.floor(jsonObject['points'].createNewBatchRequest);
564
+ }();
565
+ } else {
566
+ pointsObject.createNewBatchRequest = 0;
567
+ }
568
+
569
+ if (_typeof(jsonObject['points']) === 'object' && 'createBatchOnPackrunChange' in jsonObject['points']) {
570
+ pointsObject.createBatchOnPackrunChange = function () {
571
+ if (typeof jsonObject['points'].createBatchOnPackrunChange !== 'number') {
572
+ return Number.isInteger(Number(jsonObject['points'].createBatchOnPackrunChange)) ? Number(jsonObject['points'].createBatchOnPackrunChange) : Math.floor(Number(jsonObject['points'].createBatchOnPackrunChange));
573
+ }
574
+
575
+ return Number.isInteger(jsonObject['points'].createBatchOnPackrunChange) ? jsonObject['points'].createBatchOnPackrunChange : Math.floor(jsonObject['points'].createBatchOnPackrunChange);
576
+ }();
577
+ } else {
578
+ pointsObject.createBatchOnPackrunChange = 0;
579
+ }
580
+
581
+ if (_typeof(jsonObject['points']) === 'object' && 'createBatchOnTimeBatchChange' in jsonObject['points']) {
582
+ pointsObject.createBatchOnTimeBatchChange = function () {
583
+ if (typeof jsonObject['points'].createBatchOnTimeBatchChange !== 'number') {
584
+ return Number.isInteger(Number(jsonObject['points'].createBatchOnTimeBatchChange)) ? Number(jsonObject['points'].createBatchOnTimeBatchChange) : Math.floor(Number(jsonObject['points'].createBatchOnTimeBatchChange));
585
+ }
586
+
587
+ return Number.isInteger(jsonObject['points'].createBatchOnTimeBatchChange) ? jsonObject['points'].createBatchOnTimeBatchChange : Math.floor(jsonObject['points'].createBatchOnTimeBatchChange);
588
+ }();
589
+ } else {
590
+ pointsObject.createBatchOnTimeBatchChange = 0;
591
+ }
592
+
593
+ if (_typeof(jsonObject['points']) === 'object' && 'outletGroupSummaries' in jsonObject['points']) {
594
+ pointsObject.outletGroupSummaries = function () {
595
+ if (typeof jsonObject['points'].outletGroupSummaries !== 'number') {
596
+ return Number.isInteger(Number(jsonObject['points'].outletGroupSummaries)) ? Number(jsonObject['points'].outletGroupSummaries) : Math.floor(Number(jsonObject['points'].outletGroupSummaries));
597
+ }
598
+
599
+ return Number.isInteger(jsonObject['points'].outletGroupSummaries) ? jsonObject['points'].outletGroupSummaries : Math.floor(jsonObject['points'].outletGroupSummaries);
600
+ }();
601
+ } else {
602
+ pointsObject.outletGroupSummaries = 0;
603
+ }
604
+
605
+ if (_typeof(jsonObject['points']) === 'object' && 'products' in jsonObject['points']) {
606
+ pointsObject.products = function () {
607
+ if (typeof jsonObject['points'].products !== 'number') {
608
+ return Number.isInteger(Number(jsonObject['points'].products)) ? Number(jsonObject['points'].products) : Math.floor(Number(jsonObject['points'].products));
609
+ }
610
+
611
+ return Number.isInteger(jsonObject['points'].products) ? jsonObject['points'].products : Math.floor(jsonObject['points'].products);
612
+ }();
613
+ } else {
614
+ pointsObject.products = 0;
615
+ }
616
+
617
+ if (_typeof(jsonObject['points']) === 'object' && 'packTypeOutletUtilizationTargets' in jsonObject['points']) {
618
+ pointsObject.packTypeOutletUtilizationTargets = function () {
619
+ if (typeof jsonObject['points'].packTypeOutletUtilizationTargets !== 'number') {
620
+ return Number.isInteger(Number(jsonObject['points'].packTypeOutletUtilizationTargets)) ? Number(jsonObject['points'].packTypeOutletUtilizationTargets) : Math.floor(Number(jsonObject['points'].packTypeOutletUtilizationTargets));
621
+ }
622
+
623
+ return Number.isInteger(jsonObject['points'].packTypeOutletUtilizationTargets) ? jsonObject['points'].packTypeOutletUtilizationTargets : Math.floor(jsonObject['points'].packTypeOutletUtilizationTargets);
624
+ }();
625
+ } else {
626
+ pointsObject.packTypeOutletUtilizationTargets = 0;
627
+ }
628
+
629
+ if (_typeof(jsonObject['points']) === 'object' && 'class1TraysPerHour' in jsonObject['points']) {
630
+ pointsObject.class1TraysPerHour = function () {
631
+ if (jsonObject['points'].class1TraysPerHour === null) {
632
+ return null;
633
+ }
634
+
635
+ if (typeof jsonObject['points'].class1TraysPerHour !== 'number') {
636
+ return Number.isInteger(Number(jsonObject['points'].class1TraysPerHour)) ? Number(jsonObject['points'].class1TraysPerHour) : Math.floor(Number(jsonObject['points'].class1TraysPerHour));
637
+ }
638
+
639
+ return Number.isInteger(jsonObject['points'].class1TraysPerHour) ? jsonObject['points'].class1TraysPerHour : Math.floor(jsonObject['points'].class1TraysPerHour);
640
+ }();
641
+ } else {
642
+ pointsObject.class1TraysPerHour = null;
643
+ }
644
+
645
+ return pointsObject;
646
+ }();
647
+ }
648
+
649
+ if ('lanes' in jsonObject) {
650
+ model.lanes = function () {
651
+ if (Array.isArray(jsonObject['lanes']) !== true) {
652
+ return [];
653
+ }
654
+
655
+ return jsonObject['lanes'].map(function (lanesItem) {
656
+ return function () {
657
+ var lanesItemObject = {};
658
+
659
+ if (_typeof(lanesItem) === 'object' && 'id' in lanesItem) {
660
+ lanesItemObject.id = function () {
661
+ if (typeof lanesItem.id !== 'string') {
662
+ return String(lanesItem.id);
663
+ }
664
+
665
+ return lanesItem.id;
666
+ }();
667
+ } else {
668
+ lanesItemObject.id = "";
669
+ }
670
+
671
+ if (_typeof(lanesItem) === 'object' && 'number' in lanesItem) {
672
+ lanesItemObject.number = function () {
673
+ if (typeof lanesItem.number !== 'number') {
674
+ return Number.isInteger(Number(lanesItem.number)) ? Number(lanesItem.number) : Math.floor(Number(lanesItem.number));
675
+ }
676
+
677
+ return Number.isInteger(lanesItem.number) ? lanesItem.number : Math.floor(lanesItem.number);
678
+ }();
679
+ } else {
680
+ lanesItemObject.number = 0;
681
+ }
682
+
683
+ if (_typeof(lanesItem) === 'object' && 'points' in lanesItem) {
684
+ lanesItemObject.points = function () {
685
+ var pointsObject = {};
686
+
687
+ if (_typeof(lanesItem.points) === 'object' && 'cupFill' in lanesItem.points) {
688
+ pointsObject.cupFill = function () {
689
+ if (typeof lanesItem.points.cupFill !== 'number') {
690
+ return Number.isInteger(Number(lanesItem.points.cupFill)) ? Number(lanesItem.points.cupFill) : Math.floor(Number(lanesItem.points.cupFill));
691
+ }
692
+
693
+ return Number.isInteger(lanesItem.points.cupFill) ? lanesItem.points.cupFill : Math.floor(lanesItem.points.cupFill);
694
+ }();
695
+ } else {
696
+ pointsObject.cupFill = 0;
697
+ }
698
+
699
+ return pointsObject;
700
+ }();
701
+ } else {
702
+ lanesItemObject.points = function () {
703
+ var pointsDefaultValue = {};
704
+ pointsDefaultValue.cupFill = 0;
705
+ return pointsDefaultValue;
706
+ }();
707
+ }
708
+
709
+ return lanesItemObject;
710
+ }();
711
+ });
712
+ }();
713
+ }
714
+
715
+ if ('outlets' in jsonObject) {
716
+ model.outlets = function () {
717
+ if (Array.isArray(jsonObject['outlets']) !== true) {
718
+ return [];
719
+ }
720
+
721
+ return jsonObject['outlets'].map(function (outletsItem) {
722
+ return function () {
723
+ var outletsItemObject = {};
724
+
725
+ if (_typeof(outletsItem) === 'object' && 'id' in outletsItem) {
726
+ outletsItemObject.id = function () {
727
+ if (typeof outletsItem.id !== 'string') {
728
+ return String(outletsItem.id);
729
+ }
730
+
731
+ return outletsItem.id;
732
+ }();
733
+ } else {
734
+ outletsItemObject.id = "";
735
+ }
736
+
737
+ if (_typeof(outletsItem) === 'object' && 'number' in outletsItem) {
738
+ outletsItemObject.number = function () {
739
+ if (typeof outletsItem.number !== 'number') {
740
+ return Number.isInteger(Number(outletsItem.number)) ? Number(outletsItem.number) : Math.floor(Number(outletsItem.number));
741
+ }
742
+
743
+ return Number.isInteger(outletsItem.number) ? outletsItem.number : Math.floor(outletsItem.number);
744
+ }();
745
+ } else {
746
+ outletsItemObject.number = 0;
747
+ }
748
+
749
+ if (_typeof(outletsItem) === 'object' && 'type' in outletsItem) {
750
+ outletsItemObject.type = function () {
751
+ if (typeof outletsItem.type !== 'string') {
752
+ return String(outletsItem.type);
753
+ }
754
+
755
+ return outletsItem.type;
756
+ }();
757
+ } else {
758
+ outletsItemObject.type = "";
759
+ }
760
+
761
+ if (_typeof(outletsItem) === 'object' && 'points' in outletsItem) {
762
+ outletsItemObject.points = function () {
763
+ var pointsObject = {};
764
+
765
+ if (_typeof(outletsItem.points) === 'object' && 'name' in outletsItem.points) {
766
+ pointsObject.name = function () {
767
+ if (typeof outletsItem.points.name !== 'number') {
768
+ return Number.isInteger(Number(outletsItem.points.name)) ? Number(outletsItem.points.name) : Math.floor(Number(outletsItem.points.name));
769
+ }
770
+
771
+ return Number.isInteger(outletsItem.points.name) ? outletsItem.points.name : Math.floor(outletsItem.points.name);
772
+ }();
773
+ } else {
774
+ pointsObject.name = 0;
775
+ }
776
+
777
+ if (_typeof(outletsItem.points) === 'object' && 'fruitPerMinute' in outletsItem.points) {
778
+ pointsObject.fruitPerMinute = function () {
779
+ if (typeof outletsItem.points.fruitPerMinute !== 'number') {
780
+ return Number.isInteger(Number(outletsItem.points.fruitPerMinute)) ? Number(outletsItem.points.fruitPerMinute) : Math.floor(Number(outletsItem.points.fruitPerMinute));
781
+ }
782
+
783
+ return Number.isInteger(outletsItem.points.fruitPerMinute) ? outletsItem.points.fruitPerMinute : Math.floor(outletsItem.points.fruitPerMinute);
784
+ }();
785
+ } else {
786
+ pointsObject.fruitPerMinute = 0;
787
+ }
788
+
789
+ if (_typeof(outletsItem.points) === 'object' && 'packsPerMinute' in outletsItem.points) {
790
+ pointsObject.packsPerMinute = function () {
791
+ if (typeof outletsItem.points.packsPerMinute !== 'number') {
792
+ return Number.isInteger(Number(outletsItem.points.packsPerMinute)) ? Number(outletsItem.points.packsPerMinute) : Math.floor(Number(outletsItem.points.packsPerMinute));
793
+ }
794
+
795
+ return Number.isInteger(outletsItem.points.packsPerMinute) ? outletsItem.points.packsPerMinute : Math.floor(outletsItem.points.packsPerMinute);
796
+ }();
797
+ } else {
798
+ pointsObject.packsPerMinute = 0;
799
+ }
800
+
801
+ if (_typeof(outletsItem.points) === 'object' && 'utilization' in outletsItem.points) {
802
+ pointsObject.utilization = function () {
803
+ if (typeof outletsItem.points.utilization !== 'number') {
804
+ return Number.isInteger(Number(outletsItem.points.utilization)) ? Number(outletsItem.points.utilization) : Math.floor(Number(outletsItem.points.utilization));
805
+ }
806
+
807
+ return Number.isInteger(outletsItem.points.utilization) ? outletsItem.points.utilization : Math.floor(outletsItem.points.utilization);
808
+ }();
809
+ } else {
810
+ pointsObject.utilization = 0;
811
+ }
812
+
813
+ if (_typeof(outletsItem.points) === 'object' && 'status' in outletsItem.points) {
814
+ pointsObject.status = function () {
815
+ if (typeof outletsItem.points.status !== 'number') {
816
+ return Number.isInteger(Number(outletsItem.points.status)) ? Number(outletsItem.points.status) : Math.floor(Number(outletsItem.points.status));
817
+ }
818
+
819
+ return Number.isInteger(outletsItem.points.status) ? outletsItem.points.status : Math.floor(outletsItem.points.status);
820
+ }();
821
+ } else {
822
+ pointsObject.status = 0;
823
+ }
824
+
825
+ if (_typeof(outletsItem.points) === 'object' && 'productId' in outletsItem.points) {
826
+ pointsObject.productId = function () {
827
+ if (typeof outletsItem.points.productId !== 'number') {
828
+ return Number.isInteger(Number(outletsItem.points.productId)) ? Number(outletsItem.points.productId) : Math.floor(Number(outletsItem.points.productId));
829
+ }
830
+
831
+ return Number.isInteger(outletsItem.points.productId) ? outletsItem.points.productId : Math.floor(outletsItem.points.productId);
832
+ }();
833
+ } else {
834
+ pointsObject.productId = 0;
835
+ }
836
+
837
+ if (_typeof(outletsItem.points) === 'object' && 'productName' in outletsItem.points) {
838
+ pointsObject.productName = function () {
839
+ if (typeof outletsItem.points.productName !== 'number') {
840
+ return Number.isInteger(Number(outletsItem.points.productName)) ? Number(outletsItem.points.productName) : Math.floor(Number(outletsItem.points.productName));
841
+ }
842
+
843
+ return Number.isInteger(outletsItem.points.productName) ? outletsItem.points.productName : Math.floor(outletsItem.points.productName);
844
+ }();
845
+ } else {
846
+ pointsObject.productName = 0;
847
+ }
848
+
849
+ return pointsObject;
850
+ }();
851
+ } else {
852
+ outletsItemObject.points = function () {
853
+ var pointsDefaultValue = {};
854
+ pointsDefaultValue.name = 0;
855
+ pointsDefaultValue.fruitPerMinute = 0;
856
+ pointsDefaultValue.packsPerMinute = 0;
857
+ pointsDefaultValue.utilization = 0;
858
+ pointsDefaultValue.status = 0;
859
+ pointsDefaultValue.productId = 0;
860
+ pointsDefaultValue.productName = 0;
861
+ return pointsDefaultValue;
862
+ }();
863
+ }
864
+
865
+ return outletsItemObject;
866
+ }();
867
+ });
868
+ }();
869
+ }
870
+
871
+ if ('fruitSizes' in jsonObject) {
872
+ model.fruitSizes = function () {
873
+ if (Array.isArray(jsonObject['fruitSizes']) !== true) {
874
+ return [];
875
+ }
876
+
877
+ return jsonObject['fruitSizes'].map(function (fruitSizesItem) {
878
+ return function () {
879
+ var fruitSizesItemObject = {};
880
+
881
+ if (_typeof(fruitSizesItem) === 'object' && 'fruitSize' in fruitSizesItem) {
882
+ fruitSizesItemObject.fruitSize = function () {
883
+ if (typeof fruitSizesItem.fruitSize !== 'string') {
884
+ return String(fruitSizesItem.fruitSize);
885
+ }
886
+
887
+ return fruitSizesItem.fruitSize;
888
+ }();
889
+ } else {
890
+ fruitSizesItemObject.fruitSize = "";
891
+ }
892
+
893
+ if (_typeof(fruitSizesItem) === 'object' && 'points' in fruitSizesItem) {
894
+ fruitSizesItemObject.points = function () {
895
+ var pointsObject = {};
896
+
897
+ if (_typeof(fruitSizesItem.points) === 'object' && 'incomingFruitPerMinute' in fruitSizesItem.points) {
898
+ pointsObject.incomingFruitPerMinute = function () {
899
+ if (typeof fruitSizesItem.points.incomingFruitPerMinute !== 'number') {
900
+ return Number.isInteger(Number(fruitSizesItem.points.incomingFruitPerMinute)) ? Number(fruitSizesItem.points.incomingFruitPerMinute) : Math.floor(Number(fruitSizesItem.points.incomingFruitPerMinute));
901
+ }
902
+
903
+ return Number.isInteger(fruitSizesItem.points.incomingFruitPerMinute) ? fruitSizesItem.points.incomingFruitPerMinute : Math.floor(fruitSizesItem.points.incomingFruitPerMinute);
904
+ }();
905
+ } else {
906
+ pointsObject.incomingFruitPerMinute = 0;
907
+ }
908
+
909
+ if (_typeof(fruitSizesItem.points) === 'object' && 'recycledFruitPerMinute' in fruitSizesItem.points) {
910
+ pointsObject.recycledFruitPerMinute = function () {
911
+ if (typeof fruitSizesItem.points.recycledFruitPerMinute !== 'number') {
912
+ return Number.isInteger(Number(fruitSizesItem.points.recycledFruitPerMinute)) ? Number(fruitSizesItem.points.recycledFruitPerMinute) : Math.floor(Number(fruitSizesItem.points.recycledFruitPerMinute));
913
+ }
914
+
915
+ return Number.isInteger(fruitSizesItem.points.recycledFruitPerMinute) ? fruitSizesItem.points.recycledFruitPerMinute : Math.floor(fruitSizesItem.points.recycledFruitPerMinute);
916
+ }();
917
+ } else {
918
+ pointsObject.recycledFruitPerMinute = 0;
919
+ }
920
+
921
+ if (_typeof(fruitSizesItem.points) === 'object' && 'allocatedFruitPerMinute' in fruitSizesItem.points) {
922
+ pointsObject.allocatedFruitPerMinute = function () {
923
+ if (typeof fruitSizesItem.points.allocatedFruitPerMinute !== 'number') {
924
+ return Number.isInteger(Number(fruitSizesItem.points.allocatedFruitPerMinute)) ? Number(fruitSizesItem.points.allocatedFruitPerMinute) : Math.floor(Number(fruitSizesItem.points.allocatedFruitPerMinute));
925
+ }
926
+
927
+ return Number.isInteger(fruitSizesItem.points.allocatedFruitPerMinute) ? fruitSizesItem.points.allocatedFruitPerMinute : Math.floor(fruitSizesItem.points.allocatedFruitPerMinute);
928
+ }();
929
+ } else {
930
+ pointsObject.allocatedFruitPerMinute = 0;
931
+ }
932
+
933
+ return pointsObject;
934
+ }();
935
+ } else {
936
+ fruitSizesItemObject.points = function () {
937
+ var pointsDefaultValue = {};
938
+ pointsDefaultValue.incomingFruitPerMinute = 0;
939
+ pointsDefaultValue.recycledFruitPerMinute = 0;
940
+ pointsDefaultValue.allocatedFruitPerMinute = 0;
941
+ return pointsDefaultValue;
942
+ }();
943
+ }
944
+
945
+ return fruitSizesItemObject;
946
+ }();
947
+ });
948
+ }();
949
+ }
950
+
951
+ if ('freshPackIntegration' in jsonObject) {
952
+ model.freshPackIntegration = function () {
953
+ if (jsonObject['freshPackIntegration'] === null) {
954
+ return null;
955
+ }
956
+
957
+ var freshPackIntegrationObject = {};
958
+
959
+ if (_typeof(jsonObject['freshPackIntegration']) === 'object' && 'points' in jsonObject['freshPackIntegration']) {
960
+ freshPackIntegrationObject.points = function () {
961
+ if (_typeof(jsonObject['freshPackIntegration'].points) !== 'object') {
962
+ return Object(jsonObject['freshPackIntegration'].points);
963
+ }
964
+
965
+ return jsonObject['freshPackIntegration'].points;
966
+ }();
967
+ } else {
968
+ freshPackIntegrationObject.points = {};
969
+ }
970
+
971
+ if (_typeof(jsonObject['freshPackIntegration']) === 'object' && 'enabled' in jsonObject['freshPackIntegration']) {
972
+ freshPackIntegrationObject.enabled = function () {
973
+ if (typeof jsonObject['freshPackIntegration'].enabled !== 'boolean') {
974
+ return Boolean(jsonObject['freshPackIntegration'].enabled);
975
+ }
976
+
977
+ return jsonObject['freshPackIntegration'].enabled;
978
+ }();
979
+ } else {
980
+ freshPackIntegrationObject.enabled = false;
981
+ }
982
+
983
+ if (_typeof(jsonObject['freshPackIntegration']) === 'object' && 'materialGroupId' in jsonObject['freshPackIntegration']) {
984
+ freshPackIntegrationObject.materialGroupId = function () {
985
+ if (typeof jsonObject['freshPackIntegration'].materialGroupId !== 'number') {
986
+ return Number.isInteger(Number(jsonObject['freshPackIntegration'].materialGroupId)) ? Number(jsonObject['freshPackIntegration'].materialGroupId) : Math.floor(Number(jsonObject['freshPackIntegration'].materialGroupId));
987
+ }
988
+
989
+ return Number.isInteger(jsonObject['freshPackIntegration'].materialGroupId) ? jsonObject['freshPackIntegration'].materialGroupId : Math.floor(jsonObject['freshPackIntegration'].materialGroupId);
990
+ }();
991
+ } else {
992
+ freshPackIntegrationObject.materialGroupId = 0;
993
+ }
994
+
995
+ if (_typeof(jsonObject['freshPackIntegration']) === 'object' && 'binTypeId' in jsonObject['freshPackIntegration']) {
996
+ freshPackIntegrationObject.binTypeId = function () {
997
+ if (typeof jsonObject['freshPackIntegration'].binTypeId !== 'number') {
998
+ return Number.isInteger(Number(jsonObject['freshPackIntegration'].binTypeId)) ? Number(jsonObject['freshPackIntegration'].binTypeId) : Math.floor(Number(jsonObject['freshPackIntegration'].binTypeId));
999
+ }
1000
+
1001
+ return Number.isInteger(jsonObject['freshPackIntegration'].binTypeId) ? jsonObject['freshPackIntegration'].binTypeId : Math.floor(jsonObject['freshPackIntegration'].binTypeId);
1002
+ }();
1003
+ } else {
1004
+ freshPackIntegrationObject.binTypeId = 0;
1005
+ }
1006
+
1007
+ if (_typeof(jsonObject['freshPackIntegration']) === 'object' && 'bulkWeightClassTypes' in jsonObject['freshPackIntegration']) {
1008
+ freshPackIntegrationObject.bulkWeightClassTypes = function () {
1009
+ if (Array.isArray(jsonObject['freshPackIntegration'].bulkWeightClassTypes) !== true) {
1010
+ return [];
1011
+ }
1012
+
1013
+ return jsonObject['freshPackIntegration'].bulkWeightClassTypes.map(function (bulkWeightClassTypesItem) {
1014
+ return function () {
1015
+ if (typeof bulkWeightClassTypesItem !== 'string') {
1016
+ return String(bulkWeightClassTypesItem);
1017
+ }
1018
+
1019
+ return bulkWeightClassTypesItem;
1020
+ }();
1021
+ });
1022
+ }();
1023
+ } else {
1024
+ freshPackIntegrationObject.bulkWeightClassTypes = [];
1025
+ }
1026
+
1027
+ return freshPackIntegrationObject;
1028
+ }();
1029
+ }
1030
+
1031
+ if ('reemoonIntegration' in jsonObject) {
1032
+ model.reemoonIntegration = function () {
1033
+ var reemoonIntegrationObject = {};
1034
+
1035
+ if (_typeof(jsonObject['reemoonIntegration']) === 'object' && 'points' in jsonObject['reemoonIntegration']) {
1036
+ reemoonIntegrationObject.points = function () {
1037
+ var pointsObject = {};
1038
+
1039
+ if (_typeof(jsonObject['reemoonIntegration'].points) === 'object' && 'apiCommunicationStatus' in jsonObject['reemoonIntegration'].points) {
1040
+ pointsObject.apiCommunicationStatus = function () {
1041
+ if (typeof jsonObject['reemoonIntegration'].points.apiCommunicationStatus !== 'number') {
1042
+ return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.apiCommunicationStatus)) ? Number(jsonObject['reemoonIntegration'].points.apiCommunicationStatus) : Math.floor(Number(jsonObject['reemoonIntegration'].points.apiCommunicationStatus));
1043
+ }
1044
+
1045
+ return Number.isInteger(jsonObject['reemoonIntegration'].points.apiCommunicationStatus) ? jsonObject['reemoonIntegration'].points.apiCommunicationStatus : Math.floor(jsonObject['reemoonIntegration'].points.apiCommunicationStatus);
1046
+ }();
1047
+ } else {
1048
+ pointsObject.apiCommunicationStatus = 0;
1049
+ }
1050
+
1051
+ if (_typeof(jsonObject['reemoonIntegration'].points) === 'object' && 'machineId' in jsonObject['reemoonIntegration'].points) {
1052
+ pointsObject.machineId = function () {
1053
+ if (typeof jsonObject['reemoonIntegration'].points.machineId !== 'number') {
1054
+ return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineId)) ? Number(jsonObject['reemoonIntegration'].points.machineId) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineId));
1055
+ }
1056
+
1057
+ return Number.isInteger(jsonObject['reemoonIntegration'].points.machineId) ? jsonObject['reemoonIntegration'].points.machineId : Math.floor(jsonObject['reemoonIntegration'].points.machineId);
1058
+ }();
1059
+ } else {
1060
+ pointsObject.machineId = 0;
1061
+ }
1062
+
1063
+ if (_typeof(jsonObject['reemoonIntegration'].points) === 'object' && 'machineName' in jsonObject['reemoonIntegration'].points) {
1064
+ pointsObject.machineName = function () {
1065
+ if (typeof jsonObject['reemoonIntegration'].points.machineName !== 'number') {
1066
+ return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineName)) ? Number(jsonObject['reemoonIntegration'].points.machineName) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineName));
1067
+ }
1068
+
1069
+ return Number.isInteger(jsonObject['reemoonIntegration'].points.machineName) ? jsonObject['reemoonIntegration'].points.machineName : Math.floor(jsonObject['reemoonIntegration'].points.machineName);
1070
+ }();
1071
+ } else {
1072
+ pointsObject.machineName = 0;
1073
+ }
1074
+
1075
+ if (_typeof(jsonObject['reemoonIntegration'].points) === 'object' && 'machineLaneCount' in jsonObject['reemoonIntegration'].points) {
1076
+ pointsObject.machineLaneCount = function () {
1077
+ if (typeof jsonObject['reemoonIntegration'].points.machineLaneCount !== 'number') {
1078
+ return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineLaneCount)) ? Number(jsonObject['reemoonIntegration'].points.machineLaneCount) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineLaneCount));
1079
+ }
1080
+
1081
+ return Number.isInteger(jsonObject['reemoonIntegration'].points.machineLaneCount) ? jsonObject['reemoonIntegration'].points.machineLaneCount : Math.floor(jsonObject['reemoonIntegration'].points.machineLaneCount);
1082
+ }();
1083
+ } else {
1084
+ pointsObject.machineLaneCount = 0;
1085
+ }
1086
+
1087
+ if (_typeof(jsonObject['reemoonIntegration'].points) === 'object' && 'machineOutletCount' in jsonObject['reemoonIntegration'].points) {
1088
+ pointsObject.machineOutletCount = function () {
1089
+ if (typeof jsonObject['reemoonIntegration'].points.machineOutletCount !== 'number') {
1090
+ return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineOutletCount)) ? Number(jsonObject['reemoonIntegration'].points.machineOutletCount) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineOutletCount));
1091
+ }
1092
+
1093
+ return Number.isInteger(jsonObject['reemoonIntegration'].points.machineOutletCount) ? jsonObject['reemoonIntegration'].points.machineOutletCount : Math.floor(jsonObject['reemoonIntegration'].points.machineOutletCount);
1094
+ }();
1095
+ } else {
1096
+ pointsObject.machineOutletCount = 0;
1097
+ }
1098
+
1099
+ if (_typeof(jsonObject['reemoonIntegration'].points) === 'object' && 'machineOutletDetails' in jsonObject['reemoonIntegration'].points) {
1100
+ pointsObject.machineOutletDetails = function () {
1101
+ if (typeof jsonObject['reemoonIntegration'].points.machineOutletDetails !== 'number') {
1102
+ return Number.isInteger(Number(jsonObject['reemoonIntegration'].points.machineOutletDetails)) ? Number(jsonObject['reemoonIntegration'].points.machineOutletDetails) : Math.floor(Number(jsonObject['reemoonIntegration'].points.machineOutletDetails));
1103
+ }
1104
+
1105
+ return Number.isInteger(jsonObject['reemoonIntegration'].points.machineOutletDetails) ? jsonObject['reemoonIntegration'].points.machineOutletDetails : Math.floor(jsonObject['reemoonIntegration'].points.machineOutletDetails);
1106
+ }();
1107
+ } else {
1108
+ pointsObject.machineOutletDetails = 0;
1109
+ }
1110
+
1111
+ return pointsObject;
1112
+ }();
1113
+ } else {
1114
+ reemoonIntegrationObject.points = function () {
1115
+ var pointsDefaultValue = {};
1116
+ pointsDefaultValue.apiCommunicationStatus = 0;
1117
+ pointsDefaultValue.machineId = 0;
1118
+ pointsDefaultValue.machineName = 0;
1119
+ pointsDefaultValue.machineLaneCount = 0;
1120
+ pointsDefaultValue.machineOutletCount = 0;
1121
+ pointsDefaultValue.machineOutletDetails = 0;
1122
+ return pointsDefaultValue;
1123
+ }();
1124
+ }
1125
+
1126
+ if (_typeof(jsonObject['reemoonIntegration']) === 'object' && 'enabled' in jsonObject['reemoonIntegration']) {
1127
+ reemoonIntegrationObject.enabled = function () {
1128
+ if (typeof jsonObject['reemoonIntegration'].enabled !== 'boolean') {
1129
+ return Boolean(jsonObject['reemoonIntegration'].enabled);
1130
+ }
1131
+
1132
+ return jsonObject['reemoonIntegration'].enabled;
1133
+ }();
1134
+ } else {
1135
+ reemoonIntegrationObject.enabled = false;
1136
+ }
1137
+
1138
+ if (_typeof(jsonObject['reemoonIntegration']) === 'object' && 'username' in jsonObject['reemoonIntegration']) {
1139
+ reemoonIntegrationObject.username = function () {
1140
+ if (typeof jsonObject['reemoonIntegration'].username !== 'string') {
1141
+ return String(jsonObject['reemoonIntegration'].username);
1142
+ }
1143
+
1144
+ return jsonObject['reemoonIntegration'].username;
1145
+ }();
1146
+ } else {
1147
+ reemoonIntegrationObject.username = "";
1148
+ }
1149
+
1150
+ if (_typeof(jsonObject['reemoonIntegration']) === 'object' && 'password' in jsonObject['reemoonIntegration']) {
1151
+ reemoonIntegrationObject.password = function () {
1152
+ if (typeof jsonObject['reemoonIntegration'].password !== 'string') {
1153
+ return String(jsonObject['reemoonIntegration'].password);
1154
+ }
1155
+
1156
+ return jsonObject['reemoonIntegration'].password;
1157
+ }();
1158
+ } else {
1159
+ reemoonIntegrationObject.password = "";
1160
+ }
1161
+
1162
+ if (_typeof(jsonObject['reemoonIntegration']) === 'object' && 'apiBaseUrl' in jsonObject['reemoonIntegration']) {
1163
+ reemoonIntegrationObject.apiBaseUrl = function () {
1164
+ if (typeof jsonObject['reemoonIntegration'].apiBaseUrl !== 'string') {
1165
+ return String(jsonObject['reemoonIntegration'].apiBaseUrl);
1166
+ }
1167
+
1168
+ return jsonObject['reemoonIntegration'].apiBaseUrl;
1169
+ }();
1170
+ } else {
1171
+ reemoonIntegrationObject.apiBaseUrl = "";
1172
+ }
1173
+
1174
+ return reemoonIntegrationObject;
1175
+ }();
1176
+ }
1177
+
1178
+ if ('sources' in jsonObject) {
1179
+ model.sources = function () {
1180
+ if (Array.isArray(jsonObject['sources']) !== true) {
1181
+ return [];
1182
+ }
1183
+
1184
+ return jsonObject['sources'].map(function (sourcesItem) {
1185
+ return function () {
1186
+ return sourcesItem;
1187
+ }();
1188
+ });
1189
+ }();
1190
+ }
1191
+
1192
+ if ('productClassTypes' in jsonObject) {
1193
+ model.productClassTypes = function () {
1194
+ if (Array.isArray(jsonObject['productClassTypes']) !== true) {
1195
+ return [];
1196
+ }
1197
+
1198
+ return jsonObject['productClassTypes'].map(function (productClassTypesItem) {
1199
+ return function () {
1200
+ var productClassTypesItemObject = {};
1201
+
1202
+ if (_typeof(productClassTypesItem) === 'object' && 'productName' in productClassTypesItem) {
1203
+ productClassTypesItemObject.productName = function () {
1204
+ if (typeof productClassTypesItem.productName !== 'string') {
1205
+ return String(productClassTypesItem.productName);
1206
+ }
1207
+
1208
+ return productClassTypesItem.productName;
1209
+ }();
1210
+ } else {
1211
+ productClassTypesItemObject.productName = "";
1212
+ }
1213
+
1214
+ if (_typeof(productClassTypesItem) === 'object' && 'classType' in productClassTypesItem) {
1215
+ productClassTypesItemObject.classType = function () {
1216
+ if (typeof productClassTypesItem.classType !== 'string') {
1217
+ return String(productClassTypesItem.classType);
1218
+ }
1219
+
1220
+ return productClassTypesItem.classType;
1221
+ }();
1222
+ } else {
1223
+ productClassTypesItemObject.classType = "";
1224
+ }
1225
+
1226
+ if (_typeof(productClassTypesItem) === 'object' && 'matchType' in productClassTypesItem) {
1227
+ productClassTypesItemObject.matchType = function () {
1228
+ if (typeof productClassTypesItem.matchType !== 'string') {
1229
+ return String(productClassTypesItem.matchType);
1230
+ }
1231
+
1232
+ return productClassTypesItem.matchType;
1233
+ }();
1234
+ } else {
1235
+ productClassTypesItemObject.matchType = "";
1236
+ }
1237
+
1238
+ return productClassTypesItemObject;
1239
+ }();
1240
+ });
1241
+ }();
1242
+ }
1243
+
1244
+ if ('deleted' in jsonObject) {
1245
+ model.deleted = function () {
1246
+ if (typeof jsonObject['deleted'] !== 'boolean') {
1247
+ return Boolean(jsonObject['deleted']);
1248
+ }
1249
+
1250
+ return jsonObject['deleted'];
1251
+ }();
1252
+ }
1253
+
1254
+ if ('updateTimestamp' in jsonObject) {
1255
+ model.updateTimestamp = function () {
1256
+ if (typeof jsonObject['updateTimestamp'] !== 'string') {
1257
+ return new Date(String(jsonObject['updateTimestamp']));
1258
+ }
1259
+
1260
+ return new Date(jsonObject['updateTimestamp']);
1261
+ }();
1262
+ }
1263
+
1264
+ return model;
1265
+ }
1266
+ }]);
1267
+
1268
+ return ReemoonSizerModel;
1269
+ }(_BaseModel2.default);
1270
+
1271
+ var _default = ReemoonSizerModel;
1272
+ exports.default = _default;