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