@ricado/api-client 2.6.1 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/MAFSizerController.js +1 -0
- package/lib/Controllers/Packhouse/Site/PackrunController.js +139 -0
- package/lib/Controllers/Packhouse/Site/ReemoonSizerBatchController.js +915 -0
- package/lib/Controllers/Packhouse/Site/ReemoonSizerController.js +300 -0
- package/lib/Controllers/Packhouse/Site/ReemoonSizerOutletProductChangeController.js +885 -0
- package/lib/Controllers/Packhouse/Site/ReemoonSizerPackrunSummaryController.js +914 -0
- package/lib/Controllers/Packhouse/Site/index.js +12 -0
- package/lib/Models/Packhouse/Site/MAFSizerModel.js +13 -1
- package/lib/Models/Packhouse/Site/ReemoonSizerBatchModel.js +547 -0
- package/lib/Models/Packhouse/Site/ReemoonSizerModel.js +1272 -0
- package/lib/Models/Packhouse/Site/ReemoonSizerOutletProductChangeModel.js +293 -0
- package/lib/Models/Packhouse/Site/ReemoonSizerPackrunSummaryModel.js +461 -0
- package/lib/Models/Packhouse/Site/index.js +12 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +7155 -5149
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/MAFSizerController.js +1 -0
- package/src/Controllers/Packhouse/Site/PackrunController.js +150 -0
- package/src/Controllers/Packhouse/Site/ReemoonSizerBatchController.js +1046 -0
- package/src/Controllers/Packhouse/Site/ReemoonSizerController.js +277 -0
- package/src/Controllers/Packhouse/Site/ReemoonSizerOutletProductChangeController.js +1016 -0
- package/src/Controllers/Packhouse/Site/ReemoonSizerPackrunSummaryController.js +1045 -0
- package/src/Controllers/Packhouse/Site/index.js +8 -0
- package/src/Models/Packhouse/Site/MAFSizerModel.js +17 -1
- package/src/Models/Packhouse/Site/ReemoonSizerBatchModel.js +596 -0
- package/src/Models/Packhouse/Site/ReemoonSizerModel.js +1576 -0
- package/src/Models/Packhouse/Site/ReemoonSizerOutletProductChangeModel.js +280 -0
- package/src/Models/Packhouse/Site/ReemoonSizerPackrunSummaryModel.js +501 -0
- package/src/Models/Packhouse/Site/index.js +8 -0
- package/src/PackageVersion.js +1 -1
|
@@ -33,6 +33,10 @@ import PackTypeController from './PackTypeController';
|
|
|
33
33
|
import PackingLineController from './PackingLineController';
|
|
34
34
|
import PackrunController from './PackrunController';
|
|
35
35
|
import PrePackSampleController from './PrePackSampleController';
|
|
36
|
+
import ReemoonSizerBatchController from './ReemoonSizerBatchController';
|
|
37
|
+
import ReemoonSizerController from './ReemoonSizerController';
|
|
38
|
+
import ReemoonSizerOutletProductChangeController from './ReemoonSizerOutletProductChangeController';
|
|
39
|
+
import ReemoonSizerPackrunSummaryController from './ReemoonSizerPackrunSummaryController';
|
|
36
40
|
import RejectBinController from './RejectBinController';
|
|
37
41
|
import RejectBinScaleController from './RejectBinScaleController';
|
|
38
42
|
import RejectBinWeightController from './RejectBinWeightController';
|
|
@@ -74,6 +78,10 @@ const Site = {
|
|
|
74
78
|
PackingLineController,
|
|
75
79
|
PackrunController,
|
|
76
80
|
PrePackSampleController,
|
|
81
|
+
ReemoonSizerBatchController,
|
|
82
|
+
ReemoonSizerController,
|
|
83
|
+
ReemoonSizerOutletProductChangeController,
|
|
84
|
+
ReemoonSizerPackrunSummaryController,
|
|
77
85
|
RejectBinController,
|
|
78
86
|
RejectBinScaleController,
|
|
79
87
|
RejectBinWeightController,
|
|
@@ -182,7 +182,7 @@ class MAFSizerModel extends BaseModel
|
|
|
182
182
|
/**
|
|
183
183
|
* An Array of Article to Class Type Maps for this MAF Sizer
|
|
184
184
|
*
|
|
185
|
-
* @type {Array<{articleName: string, classType: string}>}
|
|
185
|
+
* @type {Array<{articleName: string, classType: string, matchType: string}>}
|
|
186
186
|
* @public
|
|
187
187
|
*/
|
|
188
188
|
this.articleClassTypes = [];
|
|
@@ -1340,6 +1340,22 @@ class MAFSizerModel extends BaseModel
|
|
|
1340
1340
|
{
|
|
1341
1341
|
articleClassTypesItemObject.classType = "";
|
|
1342
1342
|
}
|
|
1343
|
+
|
|
1344
|
+
if(typeof articleClassTypesItem === 'object' && 'matchType' in articleClassTypesItem)
|
|
1345
|
+
{
|
|
1346
|
+
articleClassTypesItemObject.matchType = (function(){
|
|
1347
|
+
if(typeof articleClassTypesItem.matchType !== 'string')
|
|
1348
|
+
{
|
|
1349
|
+
return String(articleClassTypesItem.matchType);
|
|
1350
|
+
}
|
|
1351
|
+
|
|
1352
|
+
return articleClassTypesItem.matchType;
|
|
1353
|
+
}());
|
|
1354
|
+
}
|
|
1355
|
+
else
|
|
1356
|
+
{
|
|
1357
|
+
articleClassTypesItemObject.matchType = "";
|
|
1358
|
+
}
|
|
1343
1359
|
|
|
1344
1360
|
return articleClassTypesItemObject;
|
|
1345
1361
|
}());
|
|
@@ -0,0 +1,596 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File Auto-Generated by the RICADO Gen 4 PHP API Project
|
|
3
|
+
*
|
|
4
|
+
* Do Not Edit this File Manually!
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import BaseModel from '../../../Models/BaseModel';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Model Class for a Reemoon Sizer Batch
|
|
11
|
+
*
|
|
12
|
+
* @class
|
|
13
|
+
* @hideconstructor
|
|
14
|
+
* @extends BaseModel
|
|
15
|
+
*/
|
|
16
|
+
class ReemoonSizerBatchModel extends BaseModel
|
|
17
|
+
{
|
|
18
|
+
/**
|
|
19
|
+
* ReemoonSizerBatchModel Constructor
|
|
20
|
+
*
|
|
21
|
+
* @protected
|
|
22
|
+
* @param {number} siteId The Site ID associated with this Reemoon Sizer Batch
|
|
23
|
+
*/
|
|
24
|
+
constructor(siteId)
|
|
25
|
+
{
|
|
26
|
+
super();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The Reemoon Sizer Batch ID
|
|
30
|
+
*
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
this.id = "";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The Reemoon Sizer ID this Batch is associated with
|
|
38
|
+
*
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
this.reemoonSizerId = "";
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The Numeric Reemoon Batch ID
|
|
46
|
+
*
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
this.batchId = "";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* When this Batch was Created
|
|
54
|
+
*
|
|
55
|
+
* @type {Date}
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
this.createdTimestamp = new Date();
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The Batch Name
|
|
62
|
+
*
|
|
63
|
+
* @type {?string}
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
this.batchName = null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* When this Batch was Started
|
|
70
|
+
*
|
|
71
|
+
* @type {?Date}
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
this.startTimestamp = null;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* When this Batch was Finished
|
|
78
|
+
*
|
|
79
|
+
* @type {?Date}
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
this.finishTimestamp = null;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The Variety Code
|
|
86
|
+
*
|
|
87
|
+
* @type {?string}
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
this.varietyCode = null;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The Packrun ID associated with this Batch
|
|
94
|
+
*
|
|
95
|
+
* @type {?string}
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
this.packrunId = null;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* An Array of Products for this Batch
|
|
102
|
+
*
|
|
103
|
+
* @type {Array<{id: number, name: string, fruitSizes: string[], packType: ?string, grades: string[], qualities: string[]}>}
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
this.products = [];
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* An Array of Summary Data Objects for each Outlet by Fruit Size and Product
|
|
110
|
+
*
|
|
111
|
+
* @type {Array<{outletNumber: number, fruitSize: string, productId: ?number, productName: string, fruitCount: number, fruitWeight: number}>}
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
this.outletSummaries = [];
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Whether the Reemoon Sizer Batch has been deleted
|
|
118
|
+
*
|
|
119
|
+
* @type {boolean}
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
122
|
+
this.deleted = false;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* When the Reemoon Sizer Batch was last updated
|
|
126
|
+
*
|
|
127
|
+
* @type {Date}
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
this.updateTimestamp = new Date();
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The Site ID associated with this Reemoon Sizer Batch
|
|
134
|
+
*
|
|
135
|
+
* @type {number}
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
this.siteId = siteId;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Create a new **ReemoonSizerBatchModel** from a JSON Object or JSON String
|
|
143
|
+
*
|
|
144
|
+
* @static
|
|
145
|
+
* @public
|
|
146
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
147
|
+
* @param {number} siteId The Site ID associated with this Reemoon Sizer Batch
|
|
148
|
+
* @return {ReemoonSizerBatchModel}
|
|
149
|
+
*/
|
|
150
|
+
static fromJSON(json, siteId)
|
|
151
|
+
{
|
|
152
|
+
let model = new ReemoonSizerBatchModel(siteId);
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* The JSON Object
|
|
156
|
+
*
|
|
157
|
+
* @type {Object<string, any>}
|
|
158
|
+
*/
|
|
159
|
+
let jsonObject = {};
|
|
160
|
+
|
|
161
|
+
if(typeof json === 'string')
|
|
162
|
+
{
|
|
163
|
+
jsonObject = JSON.parse(json);
|
|
164
|
+
}
|
|
165
|
+
else if(typeof json === 'object')
|
|
166
|
+
{
|
|
167
|
+
jsonObject = json;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
if('id' in jsonObject)
|
|
171
|
+
{
|
|
172
|
+
model.id = (function(){
|
|
173
|
+
if(typeof jsonObject['id'] !== 'string')
|
|
174
|
+
{
|
|
175
|
+
return String(jsonObject['id']);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return jsonObject['id'];
|
|
179
|
+
}());
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
if('reemoonSizerId' in jsonObject)
|
|
183
|
+
{
|
|
184
|
+
model.reemoonSizerId = (function(){
|
|
185
|
+
if(typeof jsonObject['reemoonSizerId'] !== 'string')
|
|
186
|
+
{
|
|
187
|
+
return String(jsonObject['reemoonSizerId']);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return jsonObject['reemoonSizerId'];
|
|
191
|
+
}());
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if('batchId' in jsonObject)
|
|
195
|
+
{
|
|
196
|
+
model.batchId = (function(){
|
|
197
|
+
if(typeof jsonObject['batchId'] !== 'string')
|
|
198
|
+
{
|
|
199
|
+
return String(jsonObject['batchId']);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return jsonObject['batchId'];
|
|
203
|
+
}());
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if('createdTimestamp' in jsonObject)
|
|
207
|
+
{
|
|
208
|
+
model.createdTimestamp = (function(){
|
|
209
|
+
if(typeof jsonObject['createdTimestamp'] !== 'string')
|
|
210
|
+
{
|
|
211
|
+
return new Date(String(jsonObject['createdTimestamp']));
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return new Date(jsonObject['createdTimestamp']);
|
|
215
|
+
}());
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
if('batchName' in jsonObject)
|
|
219
|
+
{
|
|
220
|
+
model.batchName = (function(){
|
|
221
|
+
if(jsonObject['batchName'] === null)
|
|
222
|
+
{
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if(typeof jsonObject['batchName'] !== 'string')
|
|
227
|
+
{
|
|
228
|
+
return String(jsonObject['batchName']);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return jsonObject['batchName'];
|
|
232
|
+
}());
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if('startTimestamp' in jsonObject)
|
|
236
|
+
{
|
|
237
|
+
model.startTimestamp = (function(){
|
|
238
|
+
if(jsonObject['startTimestamp'] === null)
|
|
239
|
+
{
|
|
240
|
+
return null;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
if(typeof jsonObject['startTimestamp'] !== 'string')
|
|
244
|
+
{
|
|
245
|
+
return new Date(String(jsonObject['startTimestamp']));
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
return new Date(jsonObject['startTimestamp']);
|
|
249
|
+
}());
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if('finishTimestamp' in jsonObject)
|
|
253
|
+
{
|
|
254
|
+
model.finishTimestamp = (function(){
|
|
255
|
+
if(jsonObject['finishTimestamp'] === null)
|
|
256
|
+
{
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
if(typeof jsonObject['finishTimestamp'] !== 'string')
|
|
261
|
+
{
|
|
262
|
+
return new Date(String(jsonObject['finishTimestamp']));
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
return new Date(jsonObject['finishTimestamp']);
|
|
266
|
+
}());
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if('varietyCode' in jsonObject)
|
|
270
|
+
{
|
|
271
|
+
model.varietyCode = (function(){
|
|
272
|
+
if(jsonObject['varietyCode'] === null)
|
|
273
|
+
{
|
|
274
|
+
return null;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
if(typeof jsonObject['varietyCode'] !== 'string')
|
|
278
|
+
{
|
|
279
|
+
return String(jsonObject['varietyCode']);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return jsonObject['varietyCode'];
|
|
283
|
+
}());
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if('packrunId' in jsonObject)
|
|
287
|
+
{
|
|
288
|
+
model.packrunId = (function(){
|
|
289
|
+
if(jsonObject['packrunId'] === null)
|
|
290
|
+
{
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
if(typeof jsonObject['packrunId'] !== 'string')
|
|
295
|
+
{
|
|
296
|
+
return String(jsonObject['packrunId']);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
return jsonObject['packrunId'];
|
|
300
|
+
}());
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if('products' in jsonObject)
|
|
304
|
+
{
|
|
305
|
+
model.products = (function(){
|
|
306
|
+
if(Array.isArray(jsonObject['products']) !== true)
|
|
307
|
+
{
|
|
308
|
+
return [];
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return jsonObject['products'].map((productsItem) => {
|
|
312
|
+
return (function(){
|
|
313
|
+
let productsItemObject = {};
|
|
314
|
+
|
|
315
|
+
if(typeof productsItem === 'object' && 'id' in productsItem)
|
|
316
|
+
{
|
|
317
|
+
productsItemObject.id = (function(){
|
|
318
|
+
if(typeof productsItem.id !== 'number')
|
|
319
|
+
{
|
|
320
|
+
return Number.isInteger(Number(productsItem.id)) ? Number(productsItem.id) : Math.floor(Number(productsItem.id));
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
return Number.isInteger(productsItem.id) ? productsItem.id : Math.floor(productsItem.id);
|
|
324
|
+
}());
|
|
325
|
+
}
|
|
326
|
+
else
|
|
327
|
+
{
|
|
328
|
+
productsItemObject.id = 0;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if(typeof productsItem === 'object' && 'name' in productsItem)
|
|
332
|
+
{
|
|
333
|
+
productsItemObject.name = (function(){
|
|
334
|
+
if(typeof productsItem.name !== 'string')
|
|
335
|
+
{
|
|
336
|
+
return String(productsItem.name);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
return productsItem.name;
|
|
340
|
+
}());
|
|
341
|
+
}
|
|
342
|
+
else
|
|
343
|
+
{
|
|
344
|
+
productsItemObject.name = "";
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
if(typeof productsItem === 'object' && 'fruitSizes' in productsItem)
|
|
348
|
+
{
|
|
349
|
+
productsItemObject.fruitSizes = (function(){
|
|
350
|
+
if(Array.isArray(productsItem.fruitSizes) !== true)
|
|
351
|
+
{
|
|
352
|
+
return [];
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
return productsItem.fruitSizes.map((fruitSizesItem) => {
|
|
356
|
+
return (function(){
|
|
357
|
+
if(typeof fruitSizesItem !== 'string')
|
|
358
|
+
{
|
|
359
|
+
return String(fruitSizesItem);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
return fruitSizesItem;
|
|
363
|
+
}());
|
|
364
|
+
});
|
|
365
|
+
}());
|
|
366
|
+
}
|
|
367
|
+
else
|
|
368
|
+
{
|
|
369
|
+
productsItemObject.fruitSizes = [];
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
if(typeof productsItem === 'object' && 'packType' in productsItem)
|
|
373
|
+
{
|
|
374
|
+
productsItemObject.packType = (function(){
|
|
375
|
+
if(productsItem.packType === null)
|
|
376
|
+
{
|
|
377
|
+
return null;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
if(typeof productsItem.packType !== 'string')
|
|
381
|
+
{
|
|
382
|
+
return String(productsItem.packType);
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
return productsItem.packType;
|
|
386
|
+
}());
|
|
387
|
+
}
|
|
388
|
+
else
|
|
389
|
+
{
|
|
390
|
+
productsItemObject.packType = null;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
if(typeof productsItem === 'object' && 'grades' in productsItem)
|
|
394
|
+
{
|
|
395
|
+
productsItemObject.grades = (function(){
|
|
396
|
+
if(Array.isArray(productsItem.grades) !== true)
|
|
397
|
+
{
|
|
398
|
+
return [];
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
return productsItem.grades.map((gradesItem) => {
|
|
402
|
+
return (function(){
|
|
403
|
+
if(typeof gradesItem !== 'string')
|
|
404
|
+
{
|
|
405
|
+
return String(gradesItem);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
return gradesItem;
|
|
409
|
+
}());
|
|
410
|
+
});
|
|
411
|
+
}());
|
|
412
|
+
}
|
|
413
|
+
else
|
|
414
|
+
{
|
|
415
|
+
productsItemObject.grades = [];
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
if(typeof productsItem === 'object' && 'qualities' in productsItem)
|
|
419
|
+
{
|
|
420
|
+
productsItemObject.qualities = (function(){
|
|
421
|
+
if(Array.isArray(productsItem.qualities) !== true)
|
|
422
|
+
{
|
|
423
|
+
return [];
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
return productsItem.qualities.map((qualitiesItem) => {
|
|
427
|
+
return (function(){
|
|
428
|
+
if(typeof qualitiesItem !== 'string')
|
|
429
|
+
{
|
|
430
|
+
return String(qualitiesItem);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
return qualitiesItem;
|
|
434
|
+
}());
|
|
435
|
+
});
|
|
436
|
+
}());
|
|
437
|
+
}
|
|
438
|
+
else
|
|
439
|
+
{
|
|
440
|
+
productsItemObject.qualities = [];
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
return productsItemObject;
|
|
444
|
+
}());
|
|
445
|
+
});
|
|
446
|
+
}());
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
if('outletSummaries' in jsonObject)
|
|
450
|
+
{
|
|
451
|
+
model.outletSummaries = (function(){
|
|
452
|
+
if(Array.isArray(jsonObject['outletSummaries']) !== true)
|
|
453
|
+
{
|
|
454
|
+
return [];
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
return jsonObject['outletSummaries'].map((outletSummariesItem) => {
|
|
458
|
+
return (function(){
|
|
459
|
+
let outletSummariesItemObject = {};
|
|
460
|
+
|
|
461
|
+
if(typeof outletSummariesItem === 'object' && 'outletNumber' in outletSummariesItem)
|
|
462
|
+
{
|
|
463
|
+
outletSummariesItemObject.outletNumber = (function(){
|
|
464
|
+
if(typeof outletSummariesItem.outletNumber !== 'number')
|
|
465
|
+
{
|
|
466
|
+
return Number.isInteger(Number(outletSummariesItem.outletNumber)) ? Number(outletSummariesItem.outletNumber) : Math.floor(Number(outletSummariesItem.outletNumber));
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
return Number.isInteger(outletSummariesItem.outletNumber) ? outletSummariesItem.outletNumber : Math.floor(outletSummariesItem.outletNumber);
|
|
470
|
+
}());
|
|
471
|
+
}
|
|
472
|
+
else
|
|
473
|
+
{
|
|
474
|
+
outletSummariesItemObject.outletNumber = 0;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if(typeof outletSummariesItem === 'object' && 'fruitSize' in outletSummariesItem)
|
|
478
|
+
{
|
|
479
|
+
outletSummariesItemObject.fruitSize = (function(){
|
|
480
|
+
if(typeof outletSummariesItem.fruitSize !== 'string')
|
|
481
|
+
{
|
|
482
|
+
return String(outletSummariesItem.fruitSize);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
return outletSummariesItem.fruitSize;
|
|
486
|
+
}());
|
|
487
|
+
}
|
|
488
|
+
else
|
|
489
|
+
{
|
|
490
|
+
outletSummariesItemObject.fruitSize = "";
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
if(typeof outletSummariesItem === 'object' && 'productId' in outletSummariesItem)
|
|
494
|
+
{
|
|
495
|
+
outletSummariesItemObject.productId = (function(){
|
|
496
|
+
if(outletSummariesItem.productId === null)
|
|
497
|
+
{
|
|
498
|
+
return null;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
if(typeof outletSummariesItem.productId !== 'number')
|
|
502
|
+
{
|
|
503
|
+
return Number.isInteger(Number(outletSummariesItem.productId)) ? Number(outletSummariesItem.productId) : Math.floor(Number(outletSummariesItem.productId));
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
return Number.isInteger(outletSummariesItem.productId) ? outletSummariesItem.productId : Math.floor(outletSummariesItem.productId);
|
|
507
|
+
}());
|
|
508
|
+
}
|
|
509
|
+
else
|
|
510
|
+
{
|
|
511
|
+
outletSummariesItemObject.productId = null;
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
if(typeof outletSummariesItem === 'object' && 'productName' in outletSummariesItem)
|
|
515
|
+
{
|
|
516
|
+
outletSummariesItemObject.productName = (function(){
|
|
517
|
+
if(typeof outletSummariesItem.productName !== 'string')
|
|
518
|
+
{
|
|
519
|
+
return String(outletSummariesItem.productName);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
return outletSummariesItem.productName;
|
|
523
|
+
}());
|
|
524
|
+
}
|
|
525
|
+
else
|
|
526
|
+
{
|
|
527
|
+
outletSummariesItemObject.productName = "";
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
if(typeof outletSummariesItem === 'object' && 'fruitCount' in outletSummariesItem)
|
|
531
|
+
{
|
|
532
|
+
outletSummariesItemObject.fruitCount = (function(){
|
|
533
|
+
if(typeof outletSummariesItem.fruitCount !== 'number')
|
|
534
|
+
{
|
|
535
|
+
return Number.isInteger(Number(outletSummariesItem.fruitCount)) ? Number(outletSummariesItem.fruitCount) : Math.floor(Number(outletSummariesItem.fruitCount));
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
return Number.isInteger(outletSummariesItem.fruitCount) ? outletSummariesItem.fruitCount : Math.floor(outletSummariesItem.fruitCount);
|
|
539
|
+
}());
|
|
540
|
+
}
|
|
541
|
+
else
|
|
542
|
+
{
|
|
543
|
+
outletSummariesItemObject.fruitCount = 0;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
if(typeof outletSummariesItem === 'object' && 'fruitWeight' in outletSummariesItem)
|
|
547
|
+
{
|
|
548
|
+
outletSummariesItemObject.fruitWeight = (function(){
|
|
549
|
+
if(typeof outletSummariesItem.fruitWeight !== 'number')
|
|
550
|
+
{
|
|
551
|
+
return Number(outletSummariesItem.fruitWeight);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
return outletSummariesItem.fruitWeight;
|
|
555
|
+
}());
|
|
556
|
+
}
|
|
557
|
+
else
|
|
558
|
+
{
|
|
559
|
+
outletSummariesItemObject.fruitWeight = 0;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
return outletSummariesItemObject;
|
|
563
|
+
}());
|
|
564
|
+
});
|
|
565
|
+
}());
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
if('deleted' in jsonObject)
|
|
569
|
+
{
|
|
570
|
+
model.deleted = (function(){
|
|
571
|
+
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
572
|
+
{
|
|
573
|
+
return Boolean(jsonObject['deleted']);
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
return jsonObject['deleted'];
|
|
577
|
+
}());
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
if('updateTimestamp' in jsonObject)
|
|
581
|
+
{
|
|
582
|
+
model.updateTimestamp = (function(){
|
|
583
|
+
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
584
|
+
{
|
|
585
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
589
|
+
}());
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
return model;
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
export default ReemoonSizerBatchModel;
|