@ricado/api-client 2.3.19 → 2.3.20

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.
@@ -49,29 +49,57 @@ class BinTipBarcodeScannerModel extends BaseModel
49
49
  */
50
50
  this.name = "";
51
51
 
52
+ /**
53
+ * The Bin Tip that owns this Barcode Scanner
54
+ *
55
+ * @type {string}
56
+ * @public
57
+ */
58
+ this.binTipId = "";
59
+
52
60
  /**
53
61
  * The Points used by this Bin Tip Barcode Scanner
54
62
  *
55
- * @type {{scannerErrorBeepRequest: number, restartServiceRequest: number}}
63
+ * @type {{scannerCommunicationStatus: number, scannerChargingStatus: number, scannerChargingTimeRemaining: number, scannerBatteryTemperature: number, scannerBatteryPercentage: number, scannerBatteryCurrent: number, scannerBatteryVoltage: number, scannerErrorBeepRequest: number, serviceCommunicationStatus: number, serviceCommunicationLatency: number, restartServiceRequest: number, recentScanResults: number}}
56
64
  * @public
57
65
  */
58
66
  this.points = (function(){
59
67
  let pointsDefaultValue = {};
60
68
 
69
+ pointsDefaultValue.scannerCommunicationStatus = 0;
70
+
71
+ pointsDefaultValue.scannerChargingStatus = 0;
72
+
73
+ pointsDefaultValue.scannerChargingTimeRemaining = 0;
74
+
75
+ pointsDefaultValue.scannerBatteryTemperature = 0;
76
+
77
+ pointsDefaultValue.scannerBatteryPercentage = 0;
78
+
79
+ pointsDefaultValue.scannerBatteryCurrent = 0;
80
+
81
+ pointsDefaultValue.scannerBatteryVoltage = 0;
82
+
61
83
  pointsDefaultValue.scannerErrorBeepRequest = 0;
62
84
 
85
+ pointsDefaultValue.serviceCommunicationStatus = 0;
86
+
87
+ pointsDefaultValue.serviceCommunicationLatency = 0;
88
+
63
89
  pointsDefaultValue.restartServiceRequest = 0;
64
90
 
91
+ pointsDefaultValue.recentScanResults = 0;
92
+
65
93
  return pointsDefaultValue;
66
94
  }());
67
95
 
68
96
  /**
69
- * The Bin Tip that owns this Barcode Scanner
97
+ * The Mode for this Bin Tip Barcode Scanner
70
98
  *
71
99
  * @type {string}
72
100
  * @public
73
101
  */
74
- this.binTipId = "";
102
+ this.mode = "";
75
103
 
76
104
  /**
77
105
  * Whether the Bin Tip Barcode Scanner has been deleted
@@ -168,11 +196,135 @@ class BinTipBarcodeScannerModel extends BaseModel
168
196
  }());
169
197
  }
170
198
 
199
+ if('binTipId' in jsonObject)
200
+ {
201
+ model.binTipId = (function(){
202
+ if(typeof jsonObject['binTipId'] !== 'string')
203
+ {
204
+ return String(jsonObject['binTipId']);
205
+ }
206
+
207
+ return jsonObject['binTipId'];
208
+ }());
209
+ }
210
+
171
211
  if('points' in jsonObject)
172
212
  {
173
213
  model.points = (function(){
174
214
  let pointsObject = {};
175
215
 
216
+ if(typeof jsonObject['points'] === 'object' && 'scannerCommunicationStatus' in jsonObject['points'])
217
+ {
218
+ pointsObject.scannerCommunicationStatus = (function(){
219
+ if(typeof jsonObject['points'].scannerCommunicationStatus !== 'number')
220
+ {
221
+ return Number.isInteger(Number(jsonObject['points'].scannerCommunicationStatus)) ? Number(jsonObject['points'].scannerCommunicationStatus) : Math.floor(Number(jsonObject['points'].scannerCommunicationStatus));
222
+ }
223
+
224
+ return Number.isInteger(jsonObject['points'].scannerCommunicationStatus) ? jsonObject['points'].scannerCommunicationStatus : Math.floor(jsonObject['points'].scannerCommunicationStatus);
225
+ }());
226
+ }
227
+ else
228
+ {
229
+ pointsObject.scannerCommunicationStatus = 0;
230
+ }
231
+
232
+ if(typeof jsonObject['points'] === 'object' && 'scannerChargingStatus' in jsonObject['points'])
233
+ {
234
+ pointsObject.scannerChargingStatus = (function(){
235
+ if(typeof jsonObject['points'].scannerChargingStatus !== 'number')
236
+ {
237
+ return Number.isInteger(Number(jsonObject['points'].scannerChargingStatus)) ? Number(jsonObject['points'].scannerChargingStatus) : Math.floor(Number(jsonObject['points'].scannerChargingStatus));
238
+ }
239
+
240
+ return Number.isInteger(jsonObject['points'].scannerChargingStatus) ? jsonObject['points'].scannerChargingStatus : Math.floor(jsonObject['points'].scannerChargingStatus);
241
+ }());
242
+ }
243
+ else
244
+ {
245
+ pointsObject.scannerChargingStatus = 0;
246
+ }
247
+
248
+ if(typeof jsonObject['points'] === 'object' && 'scannerChargingTimeRemaining' in jsonObject['points'])
249
+ {
250
+ pointsObject.scannerChargingTimeRemaining = (function(){
251
+ if(typeof jsonObject['points'].scannerChargingTimeRemaining !== 'number')
252
+ {
253
+ return Number.isInteger(Number(jsonObject['points'].scannerChargingTimeRemaining)) ? Number(jsonObject['points'].scannerChargingTimeRemaining) : Math.floor(Number(jsonObject['points'].scannerChargingTimeRemaining));
254
+ }
255
+
256
+ return Number.isInteger(jsonObject['points'].scannerChargingTimeRemaining) ? jsonObject['points'].scannerChargingTimeRemaining : Math.floor(jsonObject['points'].scannerChargingTimeRemaining);
257
+ }());
258
+ }
259
+ else
260
+ {
261
+ pointsObject.scannerChargingTimeRemaining = 0;
262
+ }
263
+
264
+ if(typeof jsonObject['points'] === 'object' && 'scannerBatteryTemperature' in jsonObject['points'])
265
+ {
266
+ pointsObject.scannerBatteryTemperature = (function(){
267
+ if(typeof jsonObject['points'].scannerBatteryTemperature !== 'number')
268
+ {
269
+ return Number.isInteger(Number(jsonObject['points'].scannerBatteryTemperature)) ? Number(jsonObject['points'].scannerBatteryTemperature) : Math.floor(Number(jsonObject['points'].scannerBatteryTemperature));
270
+ }
271
+
272
+ return Number.isInteger(jsonObject['points'].scannerBatteryTemperature) ? jsonObject['points'].scannerBatteryTemperature : Math.floor(jsonObject['points'].scannerBatteryTemperature);
273
+ }());
274
+ }
275
+ else
276
+ {
277
+ pointsObject.scannerBatteryTemperature = 0;
278
+ }
279
+
280
+ if(typeof jsonObject['points'] === 'object' && 'scannerBatteryPercentage' in jsonObject['points'])
281
+ {
282
+ pointsObject.scannerBatteryPercentage = (function(){
283
+ if(typeof jsonObject['points'].scannerBatteryPercentage !== 'number')
284
+ {
285
+ return Number.isInteger(Number(jsonObject['points'].scannerBatteryPercentage)) ? Number(jsonObject['points'].scannerBatteryPercentage) : Math.floor(Number(jsonObject['points'].scannerBatteryPercentage));
286
+ }
287
+
288
+ return Number.isInteger(jsonObject['points'].scannerBatteryPercentage) ? jsonObject['points'].scannerBatteryPercentage : Math.floor(jsonObject['points'].scannerBatteryPercentage);
289
+ }());
290
+ }
291
+ else
292
+ {
293
+ pointsObject.scannerBatteryPercentage = 0;
294
+ }
295
+
296
+ if(typeof jsonObject['points'] === 'object' && 'scannerBatteryCurrent' in jsonObject['points'])
297
+ {
298
+ pointsObject.scannerBatteryCurrent = (function(){
299
+ if(typeof jsonObject['points'].scannerBatteryCurrent !== 'number')
300
+ {
301
+ return Number.isInteger(Number(jsonObject['points'].scannerBatteryCurrent)) ? Number(jsonObject['points'].scannerBatteryCurrent) : Math.floor(Number(jsonObject['points'].scannerBatteryCurrent));
302
+ }
303
+
304
+ return Number.isInteger(jsonObject['points'].scannerBatteryCurrent) ? jsonObject['points'].scannerBatteryCurrent : Math.floor(jsonObject['points'].scannerBatteryCurrent);
305
+ }());
306
+ }
307
+ else
308
+ {
309
+ pointsObject.scannerBatteryCurrent = 0;
310
+ }
311
+
312
+ if(typeof jsonObject['points'] === 'object' && 'scannerBatteryVoltage' in jsonObject['points'])
313
+ {
314
+ pointsObject.scannerBatteryVoltage = (function(){
315
+ if(typeof jsonObject['points'].scannerBatteryVoltage !== 'number')
316
+ {
317
+ return Number.isInteger(Number(jsonObject['points'].scannerBatteryVoltage)) ? Number(jsonObject['points'].scannerBatteryVoltage) : Math.floor(Number(jsonObject['points'].scannerBatteryVoltage));
318
+ }
319
+
320
+ return Number.isInteger(jsonObject['points'].scannerBatteryVoltage) ? jsonObject['points'].scannerBatteryVoltage : Math.floor(jsonObject['points'].scannerBatteryVoltage);
321
+ }());
322
+ }
323
+ else
324
+ {
325
+ pointsObject.scannerBatteryVoltage = 0;
326
+ }
327
+
176
328
  if(typeof jsonObject['points'] === 'object' && 'scannerErrorBeepRequest' in jsonObject['points'])
177
329
  {
178
330
  pointsObject.scannerErrorBeepRequest = (function(){
@@ -189,6 +341,38 @@ class BinTipBarcodeScannerModel extends BaseModel
189
341
  pointsObject.scannerErrorBeepRequest = 0;
190
342
  }
191
343
 
344
+ if(typeof jsonObject['points'] === 'object' && 'serviceCommunicationStatus' in jsonObject['points'])
345
+ {
346
+ pointsObject.serviceCommunicationStatus = (function(){
347
+ if(typeof jsonObject['points'].serviceCommunicationStatus !== 'number')
348
+ {
349
+ return Number.isInteger(Number(jsonObject['points'].serviceCommunicationStatus)) ? Number(jsonObject['points'].serviceCommunicationStatus) : Math.floor(Number(jsonObject['points'].serviceCommunicationStatus));
350
+ }
351
+
352
+ return Number.isInteger(jsonObject['points'].serviceCommunicationStatus) ? jsonObject['points'].serviceCommunicationStatus : Math.floor(jsonObject['points'].serviceCommunicationStatus);
353
+ }());
354
+ }
355
+ else
356
+ {
357
+ pointsObject.serviceCommunicationStatus = 0;
358
+ }
359
+
360
+ if(typeof jsonObject['points'] === 'object' && 'serviceCommunicationLatency' in jsonObject['points'])
361
+ {
362
+ pointsObject.serviceCommunicationLatency = (function(){
363
+ if(typeof jsonObject['points'].serviceCommunicationLatency !== 'number')
364
+ {
365
+ return Number.isInteger(Number(jsonObject['points'].serviceCommunicationLatency)) ? Number(jsonObject['points'].serviceCommunicationLatency) : Math.floor(Number(jsonObject['points'].serviceCommunicationLatency));
366
+ }
367
+
368
+ return Number.isInteger(jsonObject['points'].serviceCommunicationLatency) ? jsonObject['points'].serviceCommunicationLatency : Math.floor(jsonObject['points'].serviceCommunicationLatency);
369
+ }());
370
+ }
371
+ else
372
+ {
373
+ pointsObject.serviceCommunicationLatency = 0;
374
+ }
375
+
192
376
  if(typeof jsonObject['points'] === 'object' && 'restartServiceRequest' in jsonObject['points'])
193
377
  {
194
378
  pointsObject.restartServiceRequest = (function(){
@@ -204,20 +388,36 @@ class BinTipBarcodeScannerModel extends BaseModel
204
388
  {
205
389
  pointsObject.restartServiceRequest = 0;
206
390
  }
391
+
392
+ if(typeof jsonObject['points'] === 'object' && 'recentScanResults' in jsonObject['points'])
393
+ {
394
+ pointsObject.recentScanResults = (function(){
395
+ if(typeof jsonObject['points'].recentScanResults !== 'number')
396
+ {
397
+ return Number.isInteger(Number(jsonObject['points'].recentScanResults)) ? Number(jsonObject['points'].recentScanResults) : Math.floor(Number(jsonObject['points'].recentScanResults));
398
+ }
399
+
400
+ return Number.isInteger(jsonObject['points'].recentScanResults) ? jsonObject['points'].recentScanResults : Math.floor(jsonObject['points'].recentScanResults);
401
+ }());
402
+ }
403
+ else
404
+ {
405
+ pointsObject.recentScanResults = 0;
406
+ }
207
407
 
208
408
  return pointsObject;
209
409
  }());
210
410
  }
211
411
 
212
- if('binTipId' in jsonObject)
412
+ if('mode' in jsonObject)
213
413
  {
214
- model.binTipId = (function(){
215
- if(typeof jsonObject['binTipId'] !== 'string')
414
+ model.mode = (function(){
415
+ if(typeof jsonObject['mode'] !== 'string')
216
416
  {
217
- return String(jsonObject['binTipId']);
417
+ return String(jsonObject['mode']);
218
418
  }
219
419
 
220
- return jsonObject['binTipId'];
420
+ return jsonObject['mode'];
221
421
  }());
222
422
  }
223
423
 
@@ -0,0 +1,305 @@
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 Bin Tip Barcode Scanner Result
11
+ *
12
+ * @class
13
+ * @hideconstructor
14
+ * @extends BaseModel
15
+ */
16
+ class BinTipBarcodeScannerResultModel extends BaseModel
17
+ {
18
+ /**
19
+ * BinTipBarcodeScannerResultModel Constructor
20
+ *
21
+ * @protected
22
+ * @param {number} siteId The Site ID associated with this Bin Tip Barcode Scanner Result
23
+ */
24
+ constructor(siteId)
25
+ {
26
+ super();
27
+
28
+ /**
29
+ * The Bin Tip Barcode Scanner Result ID
30
+ *
31
+ * @type {string}
32
+ * @public
33
+ */
34
+ this.id = "";
35
+
36
+ /**
37
+ * The Bin Tip Barcode Scanner ID associated with this Result
38
+ *
39
+ * @type {string}
40
+ * @public
41
+ */
42
+ this.barcodeScannerId = "";
43
+
44
+ /**
45
+ * A 10-Digit Bin Number made up of a Bin Lot (4-Digits) and a Unique Number (6-Digits)
46
+ *
47
+ * @type {string}
48
+ * @public
49
+ */
50
+ this.binNumber = "";
51
+
52
+ /**
53
+ * When this Barcode Scanner Result was Created
54
+ *
55
+ * @type {Date}
56
+ * @public
57
+ */
58
+ this.createdTimestamp = new Date();
59
+
60
+ /**
61
+ * The Type of this Barcode Scanner Result
62
+ *
63
+ * @type {string}
64
+ * @public
65
+ */
66
+ this.type = "";
67
+
68
+ /**
69
+ * The Packrun ID associated with this Barcode Scanner Result
70
+ *
71
+ * @type {?string}
72
+ * @public
73
+ */
74
+ this.packrunId = null;
75
+
76
+ /**
77
+ * Whether the Bin Number was Valid and could be matched with a Current or Scheduled Packrun
78
+ *
79
+ * @type {boolean}
80
+ * @public
81
+ */
82
+ this.result = false;
83
+
84
+ /**
85
+ * An Optional Message to accompany the Result. Typically only present when the Result is **false**
86
+ *
87
+ * @type {?string}
88
+ * @public
89
+ */
90
+ this.resultMessage = null;
91
+
92
+ /**
93
+ * The Bin Lot Code of this Barcode Scanner Result
94
+ *
95
+ * @type {?string}
96
+ * @public
97
+ */
98
+ this.binLotCode = null;
99
+
100
+ /**
101
+ * Whether the Bin Tip Barcode Scanner Result has been deleted
102
+ *
103
+ * @type {boolean}
104
+ * @public
105
+ */
106
+ this.deleted = false;
107
+
108
+ /**
109
+ * When the Bin Tip Barcode Scanner Result was last updated
110
+ *
111
+ * @type {Date}
112
+ * @public
113
+ */
114
+ this.updateTimestamp = new Date();
115
+
116
+ /**
117
+ * The Site ID associated with this Bin Tip Barcode Scanner Result
118
+ *
119
+ * @type {number}
120
+ * @public
121
+ */
122
+ this.siteId = siteId;
123
+ }
124
+
125
+ /**
126
+ * Create a new **BinTipBarcodeScannerResultModel** from a JSON Object or JSON String
127
+ *
128
+ * @static
129
+ * @public
130
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
131
+ * @param {number} siteId The Site ID associated with this Bin Tip Barcode Scanner Result
132
+ * @return {BinTipBarcodeScannerResultModel}
133
+ */
134
+ static fromJSON(json, siteId)
135
+ {
136
+ let model = new BinTipBarcodeScannerResultModel(siteId);
137
+
138
+ /**
139
+ * The JSON Object
140
+ *
141
+ * @type {Object<string, any>}
142
+ */
143
+ let jsonObject = {};
144
+
145
+ if(typeof json === 'string')
146
+ {
147
+ jsonObject = JSON.parse(json);
148
+ }
149
+ else if(typeof json === 'object')
150
+ {
151
+ jsonObject = json;
152
+ }
153
+
154
+ if('id' in jsonObject)
155
+ {
156
+ model.id = (function(){
157
+ if(typeof jsonObject['id'] !== 'string')
158
+ {
159
+ return String(jsonObject['id']);
160
+ }
161
+
162
+ return jsonObject['id'];
163
+ }());
164
+ }
165
+
166
+ if('barcodeScannerId' in jsonObject)
167
+ {
168
+ model.barcodeScannerId = (function(){
169
+ if(typeof jsonObject['barcodeScannerId'] !== 'string')
170
+ {
171
+ return String(jsonObject['barcodeScannerId']);
172
+ }
173
+
174
+ return jsonObject['barcodeScannerId'];
175
+ }());
176
+ }
177
+
178
+ if('binNumber' in jsonObject)
179
+ {
180
+ model.binNumber = (function(){
181
+ if(typeof jsonObject['binNumber'] !== 'string')
182
+ {
183
+ return String(jsonObject['binNumber']);
184
+ }
185
+
186
+ return jsonObject['binNumber'];
187
+ }());
188
+ }
189
+
190
+ if('createdTimestamp' in jsonObject)
191
+ {
192
+ model.createdTimestamp = (function(){
193
+ if(typeof jsonObject['createdTimestamp'] !== 'string')
194
+ {
195
+ return new Date(String(jsonObject['createdTimestamp']));
196
+ }
197
+
198
+ return new Date(jsonObject['createdTimestamp']);
199
+ }());
200
+ }
201
+
202
+ if('type' in jsonObject)
203
+ {
204
+ model.type = (function(){
205
+ if(typeof jsonObject['type'] !== 'string')
206
+ {
207
+ return String(jsonObject['type']);
208
+ }
209
+
210
+ return jsonObject['type'];
211
+ }());
212
+ }
213
+
214
+ if('packrunId' in jsonObject)
215
+ {
216
+ model.packrunId = (function(){
217
+ if(jsonObject['packrunId'] === null)
218
+ {
219
+ return null;
220
+ }
221
+
222
+ if(typeof jsonObject['packrunId'] !== 'string')
223
+ {
224
+ return String(jsonObject['packrunId']);
225
+ }
226
+
227
+ return jsonObject['packrunId'];
228
+ }());
229
+ }
230
+
231
+ if('result' in jsonObject)
232
+ {
233
+ model.result = (function(){
234
+ if(typeof jsonObject['result'] !== 'boolean')
235
+ {
236
+ return Boolean(jsonObject['result']);
237
+ }
238
+
239
+ return jsonObject['result'];
240
+ }());
241
+ }
242
+
243
+ if('resultMessage' in jsonObject)
244
+ {
245
+ model.resultMessage = (function(){
246
+ if(jsonObject['resultMessage'] === null)
247
+ {
248
+ return null;
249
+ }
250
+
251
+ if(typeof jsonObject['resultMessage'] !== 'string')
252
+ {
253
+ return String(jsonObject['resultMessage']);
254
+ }
255
+
256
+ return jsonObject['resultMessage'];
257
+ }());
258
+ }
259
+
260
+ if('binLotCode' in jsonObject)
261
+ {
262
+ model.binLotCode = (function(){
263
+ if(jsonObject['binLotCode'] === null)
264
+ {
265
+ return null;
266
+ }
267
+
268
+ if(typeof jsonObject['binLotCode'] !== 'string')
269
+ {
270
+ return String(jsonObject['binLotCode']);
271
+ }
272
+
273
+ return jsonObject['binLotCode'];
274
+ }());
275
+ }
276
+
277
+ if('deleted' in jsonObject)
278
+ {
279
+ model.deleted = (function(){
280
+ if(typeof jsonObject['deleted'] !== 'boolean')
281
+ {
282
+ return Boolean(jsonObject['deleted']);
283
+ }
284
+
285
+ return jsonObject['deleted'];
286
+ }());
287
+ }
288
+
289
+ if('updateTimestamp' in jsonObject)
290
+ {
291
+ model.updateTimestamp = (function(){
292
+ if(typeof jsonObject['updateTimestamp'] !== 'string')
293
+ {
294
+ return new Date(String(jsonObject['updateTimestamp']));
295
+ }
296
+
297
+ return new Date(jsonObject['updateTimestamp']);
298
+ }());
299
+ }
300
+
301
+ return model;
302
+ }
303
+ }
304
+
305
+ export default BinTipBarcodeScannerResultModel;
@@ -8,6 +8,7 @@
8
8
  * @namespace Models.Packhouse.Site
9
9
  */
10
10
  import BinTipBarcodeScannerModel from './BinTipBarcodeScannerModel';
11
+ import BinTipBarcodeScannerResultModel from './BinTipBarcodeScannerResultModel';
11
12
  import BinTipBinCardModel from './BinTipBinCardModel';
12
13
  import BinTipBinModel from './BinTipBinModel';
13
14
  import BinTipWeightModel from './BinTipWeightModel';
@@ -44,6 +45,7 @@ import VarietyModel from './VarietyModel';
44
45
 
45
46
  const Site = {
46
47
  BinTipBarcodeScannerModel,
48
+ BinTipBarcodeScannerResultModel,
47
49
  BinTipBinCardModel,
48
50
  BinTipBinModel,
49
51
  BinTipWeightModel,
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '2.3.19';
2
+ export const version = '2.3.20';