@ricado/api-client 2.3.9 → 2.3.10
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/MAFSizerBatchController.js +926 -0
- package/lib/Controllers/Packhouse/Site/MAFSizerController.js +217 -0
- package/lib/Controllers/Packhouse/Site/MAFSizerOutletArticleChangeController.js +879 -0
- package/lib/Controllers/Packhouse/Site/MAFSizerPackrunSummaryController.js +922 -0
- package/lib/Controllers/Packhouse/Site/PackrunController.js +54 -33
- package/lib/Controllers/Packhouse/Site/ShiftController.js +23 -0
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +13 -7
- package/lib/Controllers/Packhouse/Site/SoftSortBeltController.js +1 -0
- package/lib/Controllers/Packhouse/Site/index.js +12 -0
- package/lib/Models/Packhouse/Site/MAFSizerBatchModel.js +555 -0
- package/lib/Models/Packhouse/Site/MAFSizerModel.js +445 -0
- package/lib/Models/Packhouse/Site/MAFSizerOutletArticleChangeModel.js +253 -0
- package/lib/Models/Packhouse/Site/MAFSizerPackrunSummaryModel.js +473 -0
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +75 -5
- package/lib/Models/Packhouse/Site/index.js +12 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +4911 -3164
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/MAFSizerBatchController.js +1057 -0
- package/src/Controllers/Packhouse/Site/MAFSizerController.js +194 -0
- package/src/Controllers/Packhouse/Site/MAFSizerOutletArticleChangeController.js +1010 -0
- package/src/Controllers/Packhouse/Site/MAFSizerPackrunSummaryController.js +1053 -0
- package/src/Controllers/Packhouse/Site/PackrunController.js +59 -33
- package/src/Controllers/Packhouse/Site/ShiftController.js +22 -0
- package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +13 -7
- package/src/Controllers/Packhouse/Site/SoftSortBeltController.js +1 -0
- package/src/Controllers/Packhouse/Site/index.js +8 -0
- package/src/Models/Packhouse/Site/MAFSizerBatchModel.js +598 -0
- package/src/Models/Packhouse/Site/MAFSizerModel.js +450 -0
- package/src/Models/Packhouse/Site/MAFSizerOutletArticleChangeModel.js +235 -0
- package/src/Models/Packhouse/Site/MAFSizerPackrunSummaryModel.js +511 -0
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +85 -5
- package/src/Models/Packhouse/Site/index.js +8 -0
- package/src/PackageVersion.js +1 -1
|
@@ -0,0 +1,450 @@
|
|
|
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 MAF Sizer
|
|
11
|
+
*
|
|
12
|
+
* @class
|
|
13
|
+
* @hideconstructor
|
|
14
|
+
* @extends BaseModel
|
|
15
|
+
*/
|
|
16
|
+
class MAFSizerModel extends BaseModel
|
|
17
|
+
{
|
|
18
|
+
/**
|
|
19
|
+
* MAFSizerModel Constructor
|
|
20
|
+
*
|
|
21
|
+
* @protected
|
|
22
|
+
* @param {number} siteId The Site ID associated with this MAF Sizer
|
|
23
|
+
*/
|
|
24
|
+
constructor(siteId)
|
|
25
|
+
{
|
|
26
|
+
super();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The MAF Sizer ID
|
|
30
|
+
*
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
this.id = "";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The RTU this MAF Sizer belongs to
|
|
38
|
+
*
|
|
39
|
+
* @type {?number}
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
this.rtuId = null;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The MAF Sizer Name
|
|
46
|
+
*
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
this.name = "";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The Lanes defined for this MAF Sizer
|
|
54
|
+
*
|
|
55
|
+
* @type {Object[]}
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
this.lanes = [];
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The Points used by this MAF Sizer
|
|
62
|
+
*
|
|
63
|
+
* @type {Object}
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
this.points = {}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The Outlets defined for this MAF Sizer
|
|
70
|
+
*
|
|
71
|
+
* @type {Object[]}
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
this.outlets = [];
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The Sizer Type
|
|
78
|
+
*
|
|
79
|
+
* @type {string}
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
this.sizerType = "";
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The Auto Create Batch Delay in Seconds for this MAF Sizer
|
|
86
|
+
*
|
|
87
|
+
* @type {number}
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
this.autoCreateBatchDelay = 0;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The Fruit Sizes defined and handled by this MAF Sizer
|
|
94
|
+
*
|
|
95
|
+
* @type {Object[]}
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
this.fruitSizes = [];
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The Packing Line ID that manages this MAF Sizer
|
|
102
|
+
*
|
|
103
|
+
* @type {string}
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
this.packingLineId = "";
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* The FreshPack Integration Configuration for this MAF Sizer
|
|
110
|
+
*
|
|
111
|
+
* @type {?Object}
|
|
112
|
+
* @public
|
|
113
|
+
*/
|
|
114
|
+
this.freshPackIntegration = null;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The MAF Integration Configuration for this MAF Sizer
|
|
118
|
+
*
|
|
119
|
+
* @type {?Object}
|
|
120
|
+
* @public
|
|
121
|
+
*/
|
|
122
|
+
this.mafIntegration = null;
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* An Array of Sources that deliver Fruit to this MAF Sizer
|
|
126
|
+
*
|
|
127
|
+
* @type {Object[]}
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
this.sources = [];
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* An Array of Article to Class Type Maps for this MAF Sizer
|
|
134
|
+
*
|
|
135
|
+
* @type {Object[]}
|
|
136
|
+
* @public
|
|
137
|
+
*/
|
|
138
|
+
this.articleClassTypes = [];
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Whether the MAF Sizer has been deleted
|
|
142
|
+
*
|
|
143
|
+
* @type {boolean}
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
this.deleted = false;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* When the MAF Sizer was last updated
|
|
150
|
+
*
|
|
151
|
+
* @type {Date}
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
154
|
+
this.updateTimestamp = new Date();
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* The Site ID associated with this MAF Sizer
|
|
158
|
+
*
|
|
159
|
+
* @type {number}
|
|
160
|
+
* @public
|
|
161
|
+
*/
|
|
162
|
+
this.siteId = siteId;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Create a new **MAFSizerModel** from a JSON Object or JSON String
|
|
167
|
+
*
|
|
168
|
+
* @static
|
|
169
|
+
* @public
|
|
170
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
171
|
+
* @param {number} siteId The Site ID associated with this MAF Sizer
|
|
172
|
+
* @return {MAFSizerModel}
|
|
173
|
+
*/
|
|
174
|
+
static fromJSON(json, siteId)
|
|
175
|
+
{
|
|
176
|
+
let model = new MAFSizerModel(siteId);
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* The JSON Object
|
|
180
|
+
*
|
|
181
|
+
* @type {Object<string, any>}
|
|
182
|
+
*/
|
|
183
|
+
let jsonObject = {};
|
|
184
|
+
|
|
185
|
+
if(typeof json === 'string')
|
|
186
|
+
{
|
|
187
|
+
jsonObject = JSON.parse(json);
|
|
188
|
+
}
|
|
189
|
+
else if(typeof json === 'object')
|
|
190
|
+
{
|
|
191
|
+
jsonObject = json;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
if('id' in jsonObject)
|
|
195
|
+
{
|
|
196
|
+
model.id = (function(){
|
|
197
|
+
if(typeof jsonObject['id'] !== 'string')
|
|
198
|
+
{
|
|
199
|
+
return String(jsonObject['id']);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return jsonObject['id'];
|
|
203
|
+
}());
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
if('rtuId' in jsonObject)
|
|
207
|
+
{
|
|
208
|
+
model.rtuId = (function(){
|
|
209
|
+
if(jsonObject['rtuId'] === null)
|
|
210
|
+
{
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
if(typeof jsonObject['rtuId'] !== 'number')
|
|
215
|
+
{
|
|
216
|
+
return Number.isInteger(Number(jsonObject['rtuId'])) ? Number(jsonObject['rtuId']) : Math.floor(Number(jsonObject['rtuId']));
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return Number.isInteger(jsonObject['rtuId']) ? jsonObject['rtuId'] : Math.floor(jsonObject['rtuId']);
|
|
220
|
+
}());
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if('name' in jsonObject)
|
|
224
|
+
{
|
|
225
|
+
model.name = (function(){
|
|
226
|
+
if(typeof jsonObject['name'] !== 'string')
|
|
227
|
+
{
|
|
228
|
+
return String(jsonObject['name']);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return jsonObject['name'];
|
|
232
|
+
}());
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
if('lanes' in jsonObject)
|
|
236
|
+
{
|
|
237
|
+
model.lanes = (function(){
|
|
238
|
+
if(Array.isArray(jsonObject['lanes']) !== true)
|
|
239
|
+
{
|
|
240
|
+
return [];
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return jsonObject['lanes'].map((lanesItem) => {
|
|
244
|
+
return (function(){
|
|
245
|
+
if(typeof lanesItem !== 'object')
|
|
246
|
+
{
|
|
247
|
+
return Object(lanesItem);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return lanesItem;
|
|
251
|
+
}());
|
|
252
|
+
});
|
|
253
|
+
}());
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
if('points' in jsonObject)
|
|
257
|
+
{
|
|
258
|
+
model.points = (function(){
|
|
259
|
+
if(typeof jsonObject['points'] !== 'object')
|
|
260
|
+
{
|
|
261
|
+
return Object(jsonObject['points']);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
return jsonObject['points'];
|
|
265
|
+
}());
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if('outlets' in jsonObject)
|
|
269
|
+
{
|
|
270
|
+
model.outlets = (function(){
|
|
271
|
+
if(Array.isArray(jsonObject['outlets']) !== true)
|
|
272
|
+
{
|
|
273
|
+
return [];
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
return jsonObject['outlets'].map((outletsItem) => {
|
|
277
|
+
return (function(){
|
|
278
|
+
if(typeof outletsItem !== 'object')
|
|
279
|
+
{
|
|
280
|
+
return Object(outletsItem);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
return outletsItem;
|
|
284
|
+
}());
|
|
285
|
+
});
|
|
286
|
+
}());
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
if('sizerType' in jsonObject)
|
|
290
|
+
{
|
|
291
|
+
model.sizerType = (function(){
|
|
292
|
+
if(typeof jsonObject['sizerType'] !== 'string')
|
|
293
|
+
{
|
|
294
|
+
return String(jsonObject['sizerType']);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
return jsonObject['sizerType'];
|
|
298
|
+
}());
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
if('autoCreateBatchDelay' in jsonObject)
|
|
302
|
+
{
|
|
303
|
+
model.autoCreateBatchDelay = (function(){
|
|
304
|
+
if(typeof jsonObject['autoCreateBatchDelay'] !== 'number')
|
|
305
|
+
{
|
|
306
|
+
return Number.isInteger(Number(jsonObject['autoCreateBatchDelay'])) ? Number(jsonObject['autoCreateBatchDelay']) : Math.floor(Number(jsonObject['autoCreateBatchDelay']));
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return Number.isInteger(jsonObject['autoCreateBatchDelay']) ? jsonObject['autoCreateBatchDelay'] : Math.floor(jsonObject['autoCreateBatchDelay']);
|
|
310
|
+
}());
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if('fruitSizes' in jsonObject)
|
|
314
|
+
{
|
|
315
|
+
model.fruitSizes = (function(){
|
|
316
|
+
if(Array.isArray(jsonObject['fruitSizes']) !== true)
|
|
317
|
+
{
|
|
318
|
+
return [];
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
return jsonObject['fruitSizes'].map((fruitSizesItem) => {
|
|
322
|
+
return (function(){
|
|
323
|
+
if(typeof fruitSizesItem !== 'object')
|
|
324
|
+
{
|
|
325
|
+
return Object(fruitSizesItem);
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
return fruitSizesItem;
|
|
329
|
+
}());
|
|
330
|
+
});
|
|
331
|
+
}());
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
if('packingLineId' in jsonObject)
|
|
335
|
+
{
|
|
336
|
+
model.packingLineId = (function(){
|
|
337
|
+
if(typeof jsonObject['packingLineId'] !== 'string')
|
|
338
|
+
{
|
|
339
|
+
return String(jsonObject['packingLineId']);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return jsonObject['packingLineId'];
|
|
343
|
+
}());
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
if('freshPackIntegration' in jsonObject)
|
|
347
|
+
{
|
|
348
|
+
model.freshPackIntegration = (function(){
|
|
349
|
+
if(jsonObject['freshPackIntegration'] === null)
|
|
350
|
+
{
|
|
351
|
+
return null;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
if(typeof jsonObject['freshPackIntegration'] !== 'object')
|
|
355
|
+
{
|
|
356
|
+
return Object(jsonObject['freshPackIntegration']);
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
return jsonObject['freshPackIntegration'];
|
|
360
|
+
}());
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
if('mafIntegration' in jsonObject)
|
|
364
|
+
{
|
|
365
|
+
model.mafIntegration = (function(){
|
|
366
|
+
if(jsonObject['mafIntegration'] === null)
|
|
367
|
+
{
|
|
368
|
+
return null;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
if(typeof jsonObject['mafIntegration'] !== 'object')
|
|
372
|
+
{
|
|
373
|
+
return Object(jsonObject['mafIntegration']);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return jsonObject['mafIntegration'];
|
|
377
|
+
}());
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
if('sources' in jsonObject)
|
|
381
|
+
{
|
|
382
|
+
model.sources = (function(){
|
|
383
|
+
if(Array.isArray(jsonObject['sources']) !== true)
|
|
384
|
+
{
|
|
385
|
+
return [];
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
return jsonObject['sources'].map((sourcesItem) => {
|
|
389
|
+
return (function(){
|
|
390
|
+
if(typeof sourcesItem !== 'object')
|
|
391
|
+
{
|
|
392
|
+
return Object(sourcesItem);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
return sourcesItem;
|
|
396
|
+
}());
|
|
397
|
+
});
|
|
398
|
+
}());
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
if('articleClassTypes' in jsonObject)
|
|
402
|
+
{
|
|
403
|
+
model.articleClassTypes = (function(){
|
|
404
|
+
if(Array.isArray(jsonObject['articleClassTypes']) !== true)
|
|
405
|
+
{
|
|
406
|
+
return [];
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return jsonObject['articleClassTypes'].map((articleClassTypesItem) => {
|
|
410
|
+
return (function(){
|
|
411
|
+
if(typeof articleClassTypesItem !== 'object')
|
|
412
|
+
{
|
|
413
|
+
return Object(articleClassTypesItem);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
return articleClassTypesItem;
|
|
417
|
+
}());
|
|
418
|
+
});
|
|
419
|
+
}());
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if('deleted' in jsonObject)
|
|
423
|
+
{
|
|
424
|
+
model.deleted = (function(){
|
|
425
|
+
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
426
|
+
{
|
|
427
|
+
return Boolean(jsonObject['deleted']);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
return jsonObject['deleted'];
|
|
431
|
+
}());
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
if('updateTimestamp' in jsonObject)
|
|
435
|
+
{
|
|
436
|
+
model.updateTimestamp = (function(){
|
|
437
|
+
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
438
|
+
{
|
|
439
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
443
|
+
}());
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
return model;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
export default MAFSizerModel;
|
|
@@ -0,0 +1,235 @@
|
|
|
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 MAF Sizer Outlet Article Change
|
|
11
|
+
*
|
|
12
|
+
* @class
|
|
13
|
+
* @hideconstructor
|
|
14
|
+
* @extends BaseModel
|
|
15
|
+
*/
|
|
16
|
+
class MAFSizerOutletArticleChangeModel extends BaseModel
|
|
17
|
+
{
|
|
18
|
+
/**
|
|
19
|
+
* MAFSizerOutletArticleChangeModel Constructor
|
|
20
|
+
*
|
|
21
|
+
* @protected
|
|
22
|
+
* @param {number} siteId The Site ID associated with this MAF Sizer Outlet Article Change
|
|
23
|
+
*/
|
|
24
|
+
constructor(siteId)
|
|
25
|
+
{
|
|
26
|
+
super();
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The MAF Sizer Outlet Article Change ID
|
|
30
|
+
*
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
this.id = "";
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The MAF Sizer ID this Outlet Change is associated with
|
|
38
|
+
*
|
|
39
|
+
* @type {string}
|
|
40
|
+
* @public
|
|
41
|
+
*/
|
|
42
|
+
this.mafSizerId = "";
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The Sizer Outlet Number this Outlet Change is associated with
|
|
46
|
+
*
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
50
|
+
this.outletNumber = "";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* When this Outlet Change occurred
|
|
54
|
+
*
|
|
55
|
+
* @type {Date}
|
|
56
|
+
* @public
|
|
57
|
+
*/
|
|
58
|
+
this.createdTimestamp = new Date();
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The Name of the Previous Article that was active on the Outlet
|
|
62
|
+
*
|
|
63
|
+
* @type {?string}
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
this.previousArticleName = null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* The Name of the New Article that is now active on the Outlet
|
|
70
|
+
*
|
|
71
|
+
* @type {string}
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
this.newArticleName = "";
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Whether the MAF Sizer Outlet Article Change has been deleted
|
|
78
|
+
*
|
|
79
|
+
* @type {boolean}
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
this.deleted = false;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* When the MAF Sizer Outlet Article Change was last updated
|
|
86
|
+
*
|
|
87
|
+
* @type {Date}
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
this.updateTimestamp = new Date();
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The Site ID associated with this MAF Sizer Outlet Article Change
|
|
94
|
+
*
|
|
95
|
+
* @type {number}
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
this.siteId = siteId;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Create a new **MAFSizerOutletArticleChangeModel** from a JSON Object or JSON String
|
|
103
|
+
*
|
|
104
|
+
* @static
|
|
105
|
+
* @public
|
|
106
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
107
|
+
* @param {number} siteId The Site ID associated with this MAF Sizer Outlet Article Change
|
|
108
|
+
* @return {MAFSizerOutletArticleChangeModel}
|
|
109
|
+
*/
|
|
110
|
+
static fromJSON(json, siteId)
|
|
111
|
+
{
|
|
112
|
+
let model = new MAFSizerOutletArticleChangeModel(siteId);
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* The JSON Object
|
|
116
|
+
*
|
|
117
|
+
* @type {Object<string, any>}
|
|
118
|
+
*/
|
|
119
|
+
let jsonObject = {};
|
|
120
|
+
|
|
121
|
+
if(typeof json === 'string')
|
|
122
|
+
{
|
|
123
|
+
jsonObject = JSON.parse(json);
|
|
124
|
+
}
|
|
125
|
+
else if(typeof json === 'object')
|
|
126
|
+
{
|
|
127
|
+
jsonObject = json;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if('id' in jsonObject)
|
|
131
|
+
{
|
|
132
|
+
model.id = (function(){
|
|
133
|
+
if(typeof jsonObject['id'] !== 'string')
|
|
134
|
+
{
|
|
135
|
+
return String(jsonObject['id']);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
return jsonObject['id'];
|
|
139
|
+
}());
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if('mafSizerId' in jsonObject)
|
|
143
|
+
{
|
|
144
|
+
model.mafSizerId = (function(){
|
|
145
|
+
if(typeof jsonObject['mafSizerId'] !== 'string')
|
|
146
|
+
{
|
|
147
|
+
return String(jsonObject['mafSizerId']);
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
return jsonObject['mafSizerId'];
|
|
151
|
+
}());
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if('outletNumber' in jsonObject)
|
|
155
|
+
{
|
|
156
|
+
model.outletNumber = (function(){
|
|
157
|
+
if(typeof jsonObject['outletNumber'] !== 'string')
|
|
158
|
+
{
|
|
159
|
+
return String(jsonObject['outletNumber']);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return jsonObject['outletNumber'];
|
|
163
|
+
}());
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if('createdTimestamp' in jsonObject)
|
|
167
|
+
{
|
|
168
|
+
model.createdTimestamp = (function(){
|
|
169
|
+
if(typeof jsonObject['createdTimestamp'] !== 'string')
|
|
170
|
+
{
|
|
171
|
+
return new Date(String(jsonObject['createdTimestamp']));
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
return new Date(jsonObject['createdTimestamp']);
|
|
175
|
+
}());
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
if('previousArticleName' in jsonObject)
|
|
179
|
+
{
|
|
180
|
+
model.previousArticleName = (function(){
|
|
181
|
+
if(jsonObject['previousArticleName'] === null)
|
|
182
|
+
{
|
|
183
|
+
return null;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
if(typeof jsonObject['previousArticleName'] !== 'string')
|
|
187
|
+
{
|
|
188
|
+
return String(jsonObject['previousArticleName']);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return jsonObject['previousArticleName'];
|
|
192
|
+
}());
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if('newArticleName' in jsonObject)
|
|
196
|
+
{
|
|
197
|
+
model.newArticleName = (function(){
|
|
198
|
+
if(typeof jsonObject['newArticleName'] !== 'string')
|
|
199
|
+
{
|
|
200
|
+
return String(jsonObject['newArticleName']);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
return jsonObject['newArticleName'];
|
|
204
|
+
}());
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
if('deleted' in jsonObject)
|
|
208
|
+
{
|
|
209
|
+
model.deleted = (function(){
|
|
210
|
+
if(typeof jsonObject['deleted'] !== 'boolean')
|
|
211
|
+
{
|
|
212
|
+
return Boolean(jsonObject['deleted']);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return jsonObject['deleted'];
|
|
216
|
+
}());
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if('updateTimestamp' in jsonObject)
|
|
220
|
+
{
|
|
221
|
+
model.updateTimestamp = (function(){
|
|
222
|
+
if(typeof jsonObject['updateTimestamp'] !== 'string')
|
|
223
|
+
{
|
|
224
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
228
|
+
}());
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return model;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export default MAFSizerOutletArticleChangeModel;
|