@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
@@ -57,6 +57,14 @@ var _PackrunController = _interopRequireDefault(require("./PackrunController"));
57
57
 
58
58
  var _PrePackSampleController = _interopRequireDefault(require("./PrePackSampleController"));
59
59
 
60
+ var _ReemoonSizerBatchController = _interopRequireDefault(require("./ReemoonSizerBatchController"));
61
+
62
+ var _ReemoonSizerController = _interopRequireDefault(require("./ReemoonSizerController"));
63
+
64
+ var _ReemoonSizerOutletProductChangeController = _interopRequireDefault(require("./ReemoonSizerOutletProductChangeController"));
65
+
66
+ var _ReemoonSizerPackrunSummaryController = _interopRequireDefault(require("./ReemoonSizerPackrunSummaryController"));
67
+
60
68
  var _RejectBinController = _interopRequireDefault(require("./RejectBinController"));
61
69
 
62
70
  var _RejectBinScaleController = _interopRequireDefault(require("./RejectBinScaleController"));
@@ -121,6 +129,10 @@ var Site = {
121
129
  PackingLineController: _PackingLineController.default,
122
130
  PackrunController: _PackrunController.default,
123
131
  PrePackSampleController: _PrePackSampleController.default,
132
+ ReemoonSizerBatchController: _ReemoonSizerBatchController.default,
133
+ ReemoonSizerController: _ReemoonSizerController.default,
134
+ ReemoonSizerOutletProductChangeController: _ReemoonSizerOutletProductChangeController.default,
135
+ ReemoonSizerPackrunSummaryController: _ReemoonSizerPackrunSummaryController.default,
124
136
  RejectBinController: _RejectBinController.default,
125
137
  RejectBinScaleController: _RejectBinScaleController.default,
126
138
  RejectBinWeightController: _RejectBinWeightController.default,
@@ -221,7 +221,7 @@ var PackingLineModel = /*#__PURE__*/function (_BaseModel) {
221
221
  /**
222
222
  * The FreshQuality Integration Configuration for this Packing Line
223
223
  *
224
- * @type {?{points: {currentPackrunSamples: number, apiCommunicationStatus: number, currentPackrunMajorPackingDefects: number, currentPackrunMinorPackingDefects: number, currentPackrunTotalPackingDefects: number, currentPackrunFutureStorageDefects: number, currentPackrunMajorPackingDefectsCount: number, currentPackrunMinorPackingDefectsCount: number, currentPackrunTotalPackingDefectsCount: number, currentPackrunFutureStorageDefectsCount: number, currentPackrunRejectAnalysisSamples: ?number, currentPackrunMaturityAreaSamples: ?number, sampleTypes: ?number}, enabled: boolean, username: string, password: string, apiBaseUrl: string, sampleTypeIds: number[], rejectAnalysisSampleTypeIds: number[], maturityAreaSampleTypeIds: number[]}}
224
+ * @type {?{points: {currentPackrunSamples: number, apiCommunicationStatus: number, currentPackrunMajorPackingDefects: number, currentPackrunMinorPackingDefects: number, currentPackrunTotalPackingDefects: number, currentPackrunFutureStorageDefects: number, currentPackrunMajorPackingDefectsCount: number, currentPackrunMinorPackingDefectsCount: number, currentPackrunTotalPackingDefectsCount: number, currentPackrunFutureStorageDefectsCount: number, currentPackrunRejectAnalysisSamples: ?number, currentPackrunMaturityAreaSamples: ?number, currentPackrunCustomSamples: ?number, sampleTypes: ?number}, enabled: boolean, username: string, password: string, apiBaseUrl: string, sampleTypeIds: number[], rejectAnalysisSampleTypeIds: number[], maturityAreaSampleTypeIds: number[], customSampleTypeIds: number[]}}
225
225
  * @public
226
226
  */
227
227
 
@@ -4922,6 +4922,22 @@ var PackingLineModel = /*#__PURE__*/function (_BaseModel) {
4922
4922
  pointsObject.currentPackrunMaturityAreaSamples = null;
4923
4923
  }
4924
4924
 
4925
+ if (_typeof(jsonObject['freshQualityIntegration'].points) === 'object' && 'currentPackrunCustomSamples' in jsonObject['freshQualityIntegration'].points) {
4926
+ pointsObject.currentPackrunCustomSamples = function () {
4927
+ if (jsonObject['freshQualityIntegration'].points.currentPackrunCustomSamples === null) {
4928
+ return null;
4929
+ }
4930
+
4931
+ if (typeof jsonObject['freshQualityIntegration'].points.currentPackrunCustomSamples !== 'number') {
4932
+ return Number.isInteger(Number(jsonObject['freshQualityIntegration'].points.currentPackrunCustomSamples)) ? Number(jsonObject['freshQualityIntegration'].points.currentPackrunCustomSamples) : Math.floor(Number(jsonObject['freshQualityIntegration'].points.currentPackrunCustomSamples));
4933
+ }
4934
+
4935
+ return Number.isInteger(jsonObject['freshQualityIntegration'].points.currentPackrunCustomSamples) ? jsonObject['freshQualityIntegration'].points.currentPackrunCustomSamples : Math.floor(jsonObject['freshQualityIntegration'].points.currentPackrunCustomSamples);
4936
+ }();
4937
+ } else {
4938
+ pointsObject.currentPackrunCustomSamples = null;
4939
+ }
4940
+
4925
4941
  if (_typeof(jsonObject['freshQualityIntegration'].points) === 'object' && 'sampleTypes' in jsonObject['freshQualityIntegration'].points) {
4926
4942
  pointsObject.sampleTypes = function () {
4927
4943
  if (jsonObject['freshQualityIntegration'].points.sampleTypes === null) {
@@ -4955,6 +4971,7 @@ var PackingLineModel = /*#__PURE__*/function (_BaseModel) {
4955
4971
  pointsDefaultValue.currentPackrunFutureStorageDefectsCount = 0;
4956
4972
  pointsDefaultValue.currentPackrunRejectAnalysisSamples = null;
4957
4973
  pointsDefaultValue.currentPackrunMaturityAreaSamples = null;
4974
+ pointsDefaultValue.currentPackrunCustomSamples = null;
4958
4975
  pointsDefaultValue.sampleTypes = null;
4959
4976
  return pointsDefaultValue;
4960
4977
  }();
@@ -5068,6 +5085,26 @@ var PackingLineModel = /*#__PURE__*/function (_BaseModel) {
5068
5085
  freshQualityIntegrationObject.maturityAreaSampleTypeIds = [];
5069
5086
  }
5070
5087
 
5088
+ if (_typeof(jsonObject['freshQualityIntegration']) === 'object' && 'customSampleTypeIds' in jsonObject['freshQualityIntegration']) {
5089
+ freshQualityIntegrationObject.customSampleTypeIds = function () {
5090
+ if (Array.isArray(jsonObject['freshQualityIntegration'].customSampleTypeIds) !== true) {
5091
+ return [];
5092
+ }
5093
+
5094
+ return jsonObject['freshQualityIntegration'].customSampleTypeIds.map(function (customSampleTypeIdsItem) {
5095
+ return function () {
5096
+ if (typeof customSampleTypeIdsItem !== 'number') {
5097
+ return Number.isInteger(Number(customSampleTypeIdsItem)) ? Number(customSampleTypeIdsItem) : Math.floor(Number(customSampleTypeIdsItem));
5098
+ }
5099
+
5100
+ return Number.isInteger(customSampleTypeIdsItem) ? customSampleTypeIdsItem : Math.floor(customSampleTypeIdsItem);
5101
+ }();
5102
+ });
5103
+ }();
5104
+ } else {
5105
+ freshQualityIntegrationObject.customSampleTypeIds = [];
5106
+ }
5107
+
5071
5108
  return freshQualityIntegrationObject;
5072
5109
  }();
5073
5110
  }
@@ -0,0 +1,547 @@
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 Batch
36
+ *
37
+ * @class
38
+ * @hideconstructor
39
+ * @extends BaseModel
40
+ */
41
+ var ReemoonSizerBatchModel = /*#__PURE__*/function (_BaseModel) {
42
+ _inherits(ReemoonSizerBatchModel, _BaseModel);
43
+
44
+ var _super = _createSuper(ReemoonSizerBatchModel);
45
+
46
+ /**
47
+ * ReemoonSizerBatchModel Constructor
48
+ *
49
+ * @protected
50
+ * @param {number} siteId The Site ID associated with this Reemoon Sizer Batch
51
+ */
52
+ function ReemoonSizerBatchModel(siteId) {
53
+ var _this;
54
+
55
+ _classCallCheck(this, ReemoonSizerBatchModel);
56
+
57
+ _this = _super.call(this);
58
+ /**
59
+ * The Reemoon Sizer Batch ID
60
+ *
61
+ * @type {string}
62
+ * @public
63
+ */
64
+
65
+ _this.id = "";
66
+ /**
67
+ * The Reemoon Sizer ID this Batch is associated with
68
+ *
69
+ * @type {string}
70
+ * @public
71
+ */
72
+
73
+ _this.reemoonSizerId = "";
74
+ /**
75
+ * The Numeric Reemoon Batch ID
76
+ *
77
+ * @type {string}
78
+ * @public
79
+ */
80
+
81
+ _this.batchId = "";
82
+ /**
83
+ * When this Batch was Created
84
+ *
85
+ * @type {Date}
86
+ * @public
87
+ */
88
+
89
+ _this.createdTimestamp = new Date();
90
+ /**
91
+ * The Batch Name
92
+ *
93
+ * @type {?string}
94
+ * @public
95
+ */
96
+
97
+ _this.batchName = null;
98
+ /**
99
+ * When this Batch was Started
100
+ *
101
+ * @type {?Date}
102
+ * @public
103
+ */
104
+
105
+ _this.startTimestamp = null;
106
+ /**
107
+ * When this Batch was Finished
108
+ *
109
+ * @type {?Date}
110
+ * @public
111
+ */
112
+
113
+ _this.finishTimestamp = null;
114
+ /**
115
+ * The Variety Code
116
+ *
117
+ * @type {?string}
118
+ * @public
119
+ */
120
+
121
+ _this.varietyCode = null;
122
+ /**
123
+ * The Packrun ID associated with this Batch
124
+ *
125
+ * @type {?string}
126
+ * @public
127
+ */
128
+
129
+ _this.packrunId = null;
130
+ /**
131
+ * An Array of Products for this Batch
132
+ *
133
+ * @type {Array<{id: number, name: string, fruitSizes: string[], packType: ?string, grades: string[], qualities: string[]}>}
134
+ * @public
135
+ */
136
+
137
+ _this.products = [];
138
+ /**
139
+ * An Array of Summary Data Objects for each Outlet by Fruit Size and Product
140
+ *
141
+ * @type {Array<{outletNumber: number, fruitSize: string, productId: ?number, productName: string, fruitCount: number, fruitWeight: number}>}
142
+ * @public
143
+ */
144
+
145
+ _this.outletSummaries = [];
146
+ /**
147
+ * Whether the Reemoon Sizer Batch has been deleted
148
+ *
149
+ * @type {boolean}
150
+ * @public
151
+ */
152
+
153
+ _this.deleted = false;
154
+ /**
155
+ * When the Reemoon Sizer Batch was last updated
156
+ *
157
+ * @type {Date}
158
+ * @public
159
+ */
160
+
161
+ _this.updateTimestamp = new Date();
162
+ /**
163
+ * The Site ID associated with this Reemoon Sizer Batch
164
+ *
165
+ * @type {number}
166
+ * @public
167
+ */
168
+
169
+ _this.siteId = siteId;
170
+ return _this;
171
+ }
172
+ /**
173
+ * Create a new **ReemoonSizerBatchModel** from a JSON Object or JSON String
174
+ *
175
+ * @static
176
+ * @public
177
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
178
+ * @param {number} siteId The Site ID associated with this Reemoon Sizer Batch
179
+ * @return {ReemoonSizerBatchModel}
180
+ */
181
+
182
+
183
+ _createClass(ReemoonSizerBatchModel, null, [{
184
+ key: "fromJSON",
185
+ value: function fromJSON(json, siteId) {
186
+ var model = new ReemoonSizerBatchModel(siteId);
187
+ /**
188
+ * The JSON Object
189
+ *
190
+ * @type {Object<string, any>}
191
+ */
192
+
193
+ var jsonObject = {};
194
+
195
+ if (typeof json === 'string') {
196
+ jsonObject = JSON.parse(json);
197
+ } else if (_typeof(json) === 'object') {
198
+ jsonObject = json;
199
+ }
200
+
201
+ if ('id' in jsonObject) {
202
+ model.id = function () {
203
+ if (typeof jsonObject['id'] !== 'string') {
204
+ return String(jsonObject['id']);
205
+ }
206
+
207
+ return jsonObject['id'];
208
+ }();
209
+ }
210
+
211
+ if ('reemoonSizerId' in jsonObject) {
212
+ model.reemoonSizerId = function () {
213
+ if (typeof jsonObject['reemoonSizerId'] !== 'string') {
214
+ return String(jsonObject['reemoonSizerId']);
215
+ }
216
+
217
+ return jsonObject['reemoonSizerId'];
218
+ }();
219
+ }
220
+
221
+ if ('batchId' in jsonObject) {
222
+ model.batchId = function () {
223
+ if (typeof jsonObject['batchId'] !== 'string') {
224
+ return String(jsonObject['batchId']);
225
+ }
226
+
227
+ return jsonObject['batchId'];
228
+ }();
229
+ }
230
+
231
+ if ('createdTimestamp' in jsonObject) {
232
+ model.createdTimestamp = function () {
233
+ if (typeof jsonObject['createdTimestamp'] !== 'string') {
234
+ return new Date(String(jsonObject['createdTimestamp']));
235
+ }
236
+
237
+ return new Date(jsonObject['createdTimestamp']);
238
+ }();
239
+ }
240
+
241
+ if ('batchName' in jsonObject) {
242
+ model.batchName = function () {
243
+ if (jsonObject['batchName'] === null) {
244
+ return null;
245
+ }
246
+
247
+ if (typeof jsonObject['batchName'] !== 'string') {
248
+ return String(jsonObject['batchName']);
249
+ }
250
+
251
+ return jsonObject['batchName'];
252
+ }();
253
+ }
254
+
255
+ if ('startTimestamp' in jsonObject) {
256
+ model.startTimestamp = function () {
257
+ if (jsonObject['startTimestamp'] === null) {
258
+ return null;
259
+ }
260
+
261
+ if (typeof jsonObject['startTimestamp'] !== 'string') {
262
+ return new Date(String(jsonObject['startTimestamp']));
263
+ }
264
+
265
+ return new Date(jsonObject['startTimestamp']);
266
+ }();
267
+ }
268
+
269
+ if ('finishTimestamp' in jsonObject) {
270
+ model.finishTimestamp = function () {
271
+ if (jsonObject['finishTimestamp'] === null) {
272
+ return null;
273
+ }
274
+
275
+ if (typeof jsonObject['finishTimestamp'] !== 'string') {
276
+ return new Date(String(jsonObject['finishTimestamp']));
277
+ }
278
+
279
+ return new Date(jsonObject['finishTimestamp']);
280
+ }();
281
+ }
282
+
283
+ if ('varietyCode' in jsonObject) {
284
+ model.varietyCode = function () {
285
+ if (jsonObject['varietyCode'] === null) {
286
+ return null;
287
+ }
288
+
289
+ if (typeof jsonObject['varietyCode'] !== 'string') {
290
+ return String(jsonObject['varietyCode']);
291
+ }
292
+
293
+ return jsonObject['varietyCode'];
294
+ }();
295
+ }
296
+
297
+ if ('packrunId' in jsonObject) {
298
+ model.packrunId = function () {
299
+ if (jsonObject['packrunId'] === null) {
300
+ return null;
301
+ }
302
+
303
+ if (typeof jsonObject['packrunId'] !== 'string') {
304
+ return String(jsonObject['packrunId']);
305
+ }
306
+
307
+ return jsonObject['packrunId'];
308
+ }();
309
+ }
310
+
311
+ if ('products' in jsonObject) {
312
+ model.products = function () {
313
+ if (Array.isArray(jsonObject['products']) !== true) {
314
+ return [];
315
+ }
316
+
317
+ return jsonObject['products'].map(function (productsItem) {
318
+ return function () {
319
+ var productsItemObject = {};
320
+
321
+ if (_typeof(productsItem) === 'object' && 'id' in productsItem) {
322
+ productsItemObject.id = function () {
323
+ if (typeof productsItem.id !== 'number') {
324
+ return Number.isInteger(Number(productsItem.id)) ? Number(productsItem.id) : Math.floor(Number(productsItem.id));
325
+ }
326
+
327
+ return Number.isInteger(productsItem.id) ? productsItem.id : Math.floor(productsItem.id);
328
+ }();
329
+ } else {
330
+ productsItemObject.id = 0;
331
+ }
332
+
333
+ if (_typeof(productsItem) === 'object' && 'name' in productsItem) {
334
+ productsItemObject.name = function () {
335
+ if (typeof productsItem.name !== 'string') {
336
+ return String(productsItem.name);
337
+ }
338
+
339
+ return productsItem.name;
340
+ }();
341
+ } else {
342
+ productsItemObject.name = "";
343
+ }
344
+
345
+ if (_typeof(productsItem) === 'object' && 'fruitSizes' in productsItem) {
346
+ productsItemObject.fruitSizes = function () {
347
+ if (Array.isArray(productsItem.fruitSizes) !== true) {
348
+ return [];
349
+ }
350
+
351
+ return productsItem.fruitSizes.map(function (fruitSizesItem) {
352
+ return function () {
353
+ if (typeof fruitSizesItem !== 'string') {
354
+ return String(fruitSizesItem);
355
+ }
356
+
357
+ return fruitSizesItem;
358
+ }();
359
+ });
360
+ }();
361
+ } else {
362
+ productsItemObject.fruitSizes = [];
363
+ }
364
+
365
+ if (_typeof(productsItem) === 'object' && 'packType' in productsItem) {
366
+ productsItemObject.packType = function () {
367
+ if (productsItem.packType === null) {
368
+ return null;
369
+ }
370
+
371
+ if (typeof productsItem.packType !== 'string') {
372
+ return String(productsItem.packType);
373
+ }
374
+
375
+ return productsItem.packType;
376
+ }();
377
+ } else {
378
+ productsItemObject.packType = null;
379
+ }
380
+
381
+ if (_typeof(productsItem) === 'object' && 'grades' in productsItem) {
382
+ productsItemObject.grades = function () {
383
+ if (Array.isArray(productsItem.grades) !== true) {
384
+ return [];
385
+ }
386
+
387
+ return productsItem.grades.map(function (gradesItem) {
388
+ return function () {
389
+ if (typeof gradesItem !== 'string') {
390
+ return String(gradesItem);
391
+ }
392
+
393
+ return gradesItem;
394
+ }();
395
+ });
396
+ }();
397
+ } else {
398
+ productsItemObject.grades = [];
399
+ }
400
+
401
+ if (_typeof(productsItem) === 'object' && 'qualities' in productsItem) {
402
+ productsItemObject.qualities = function () {
403
+ if (Array.isArray(productsItem.qualities) !== true) {
404
+ return [];
405
+ }
406
+
407
+ return productsItem.qualities.map(function (qualitiesItem) {
408
+ return function () {
409
+ if (typeof qualitiesItem !== 'string') {
410
+ return String(qualitiesItem);
411
+ }
412
+
413
+ return qualitiesItem;
414
+ }();
415
+ });
416
+ }();
417
+ } else {
418
+ productsItemObject.qualities = [];
419
+ }
420
+
421
+ return productsItemObject;
422
+ }();
423
+ });
424
+ }();
425
+ }
426
+
427
+ if ('outletSummaries' in jsonObject) {
428
+ model.outletSummaries = function () {
429
+ if (Array.isArray(jsonObject['outletSummaries']) !== true) {
430
+ return [];
431
+ }
432
+
433
+ return jsonObject['outletSummaries'].map(function (outletSummariesItem) {
434
+ return function () {
435
+ var outletSummariesItemObject = {};
436
+
437
+ if (_typeof(outletSummariesItem) === 'object' && 'outletNumber' in outletSummariesItem) {
438
+ outletSummariesItemObject.outletNumber = function () {
439
+ if (typeof outletSummariesItem.outletNumber !== 'number') {
440
+ return Number.isInteger(Number(outletSummariesItem.outletNumber)) ? Number(outletSummariesItem.outletNumber) : Math.floor(Number(outletSummariesItem.outletNumber));
441
+ }
442
+
443
+ return Number.isInteger(outletSummariesItem.outletNumber) ? outletSummariesItem.outletNumber : Math.floor(outletSummariesItem.outletNumber);
444
+ }();
445
+ } else {
446
+ outletSummariesItemObject.outletNumber = 0;
447
+ }
448
+
449
+ if (_typeof(outletSummariesItem) === 'object' && 'fruitSize' in outletSummariesItem) {
450
+ outletSummariesItemObject.fruitSize = function () {
451
+ if (typeof outletSummariesItem.fruitSize !== 'string') {
452
+ return String(outletSummariesItem.fruitSize);
453
+ }
454
+
455
+ return outletSummariesItem.fruitSize;
456
+ }();
457
+ } else {
458
+ outletSummariesItemObject.fruitSize = "";
459
+ }
460
+
461
+ if (_typeof(outletSummariesItem) === 'object' && 'productId' in outletSummariesItem) {
462
+ outletSummariesItemObject.productId = function () {
463
+ if (outletSummariesItem.productId === null) {
464
+ return null;
465
+ }
466
+
467
+ if (typeof outletSummariesItem.productId !== 'number') {
468
+ return Number.isInteger(Number(outletSummariesItem.productId)) ? Number(outletSummariesItem.productId) : Math.floor(Number(outletSummariesItem.productId));
469
+ }
470
+
471
+ return Number.isInteger(outletSummariesItem.productId) ? outletSummariesItem.productId : Math.floor(outletSummariesItem.productId);
472
+ }();
473
+ } else {
474
+ outletSummariesItemObject.productId = null;
475
+ }
476
+
477
+ if (_typeof(outletSummariesItem) === 'object' && 'productName' in outletSummariesItem) {
478
+ outletSummariesItemObject.productName = function () {
479
+ if (typeof outletSummariesItem.productName !== 'string') {
480
+ return String(outletSummariesItem.productName);
481
+ }
482
+
483
+ return outletSummariesItem.productName;
484
+ }();
485
+ } else {
486
+ outletSummariesItemObject.productName = "";
487
+ }
488
+
489
+ if (_typeof(outletSummariesItem) === 'object' && 'fruitCount' in outletSummariesItem) {
490
+ outletSummariesItemObject.fruitCount = function () {
491
+ if (typeof outletSummariesItem.fruitCount !== 'number') {
492
+ return Number.isInteger(Number(outletSummariesItem.fruitCount)) ? Number(outletSummariesItem.fruitCount) : Math.floor(Number(outletSummariesItem.fruitCount));
493
+ }
494
+
495
+ return Number.isInteger(outletSummariesItem.fruitCount) ? outletSummariesItem.fruitCount : Math.floor(outletSummariesItem.fruitCount);
496
+ }();
497
+ } else {
498
+ outletSummariesItemObject.fruitCount = 0;
499
+ }
500
+
501
+ if (_typeof(outletSummariesItem) === 'object' && 'fruitWeight' in outletSummariesItem) {
502
+ outletSummariesItemObject.fruitWeight = function () {
503
+ if (typeof outletSummariesItem.fruitWeight !== 'number') {
504
+ return Number(outletSummariesItem.fruitWeight);
505
+ }
506
+
507
+ return outletSummariesItem.fruitWeight;
508
+ }();
509
+ } else {
510
+ outletSummariesItemObject.fruitWeight = 0;
511
+ }
512
+
513
+ return outletSummariesItemObject;
514
+ }();
515
+ });
516
+ }();
517
+ }
518
+
519
+ if ('deleted' in jsonObject) {
520
+ model.deleted = function () {
521
+ if (typeof jsonObject['deleted'] !== 'boolean') {
522
+ return Boolean(jsonObject['deleted']);
523
+ }
524
+
525
+ return jsonObject['deleted'];
526
+ }();
527
+ }
528
+
529
+ if ('updateTimestamp' in jsonObject) {
530
+ model.updateTimestamp = function () {
531
+ if (typeof jsonObject['updateTimestamp'] !== 'string') {
532
+ return new Date(String(jsonObject['updateTimestamp']));
533
+ }
534
+
535
+ return new Date(jsonObject['updateTimestamp']);
536
+ }();
537
+ }
538
+
539
+ return model;
540
+ }
541
+ }]);
542
+
543
+ return ReemoonSizerBatchModel;
544
+ }(_BaseModel2.default);
545
+
546
+ var _default = ReemoonSizerBatchModel;
547
+ exports.default = _default;