@ricado/api-client 2.3.8 → 2.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +2 -0
  3. package/lib/Controllers/Packhouse/Site/MAFSizerBatchController.js +926 -0
  4. package/lib/Controllers/Packhouse/Site/MAFSizerController.js +217 -0
  5. package/lib/Controllers/Packhouse/Site/MAFSizerOutletArticleChangeController.js +879 -0
  6. package/lib/Controllers/Packhouse/Site/MAFSizerPackrunSummaryController.js +922 -0
  7. package/lib/Controllers/Packhouse/Site/PackrunController.js +54 -33
  8. package/lib/Controllers/Packhouse/Site/ShiftController.js +23 -0
  9. package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +13 -7
  10. package/lib/Controllers/Packhouse/Site/SoftSortBeltController.js +1 -0
  11. package/lib/Controllers/Packhouse/Site/index.js +12 -0
  12. package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +26 -0
  13. package/lib/Models/Packhouse/Site/MAFSizerBatchModel.js +555 -0
  14. package/lib/Models/Packhouse/Site/MAFSizerModel.js +445 -0
  15. package/lib/Models/Packhouse/Site/MAFSizerOutletArticleChangeModel.js +253 -0
  16. package/lib/Models/Packhouse/Site/MAFSizerPackrunSummaryModel.js +473 -0
  17. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +75 -5
  18. package/lib/Models/Packhouse/Site/index.js +12 -0
  19. package/lib/PackageVersion.js +2 -2
  20. package/lib/index.d.ts +4922 -3160
  21. package/package.json +1 -1
  22. package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +2 -0
  23. package/src/Controllers/Packhouse/Site/MAFSizerBatchController.js +1057 -0
  24. package/src/Controllers/Packhouse/Site/MAFSizerController.js +194 -0
  25. package/src/Controllers/Packhouse/Site/MAFSizerOutletArticleChangeController.js +1010 -0
  26. package/src/Controllers/Packhouse/Site/MAFSizerPackrunSummaryController.js +1053 -0
  27. package/src/Controllers/Packhouse/Site/PackrunController.js +59 -33
  28. package/src/Controllers/Packhouse/Site/ShiftController.js +22 -0
  29. package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +13 -7
  30. package/src/Controllers/Packhouse/Site/SoftSortBeltController.js +1 -0
  31. package/src/Controllers/Packhouse/Site/index.js +8 -0
  32. package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +29 -0
  33. package/src/Models/Packhouse/Site/MAFSizerBatchModel.js +598 -0
  34. package/src/Models/Packhouse/Site/MAFSizerModel.js +450 -0
  35. package/src/Models/Packhouse/Site/MAFSizerOutletArticleChangeModel.js +235 -0
  36. package/src/Models/Packhouse/Site/MAFSizerPackrunSummaryModel.js +511 -0
  37. package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +85 -5
  38. package/src/Models/Packhouse/Site/index.js +8 -0
  39. package/src/PackageVersion.js +2 -2
@@ -0,0 +1,598 @@
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 Batch
11
+ *
12
+ * @class
13
+ * @hideconstructor
14
+ * @extends BaseModel
15
+ */
16
+ class MAFSizerBatchModel extends BaseModel
17
+ {
18
+ /**
19
+ * MAFSizerBatchModel Constructor
20
+ *
21
+ * @protected
22
+ * @param {number} siteId The Site ID associated with this MAF Sizer Batch
23
+ */
24
+ constructor(siteId)
25
+ {
26
+ super();
27
+
28
+ /**
29
+ * The MAF Sizer Batch ID
30
+ *
31
+ * @type {string}
32
+ * @public
33
+ */
34
+ this.id = "";
35
+
36
+ /**
37
+ * The MAF Sizer ID this Batch is associated with
38
+ *
39
+ * @type {string}
40
+ * @public
41
+ */
42
+ this.mafSizerId = "";
43
+
44
+ /**
45
+ * The Numeric MAF 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
+ * The Grower Code
70
+ *
71
+ * @type {?string}
72
+ * @public
73
+ */
74
+ this.growerCode = null;
75
+
76
+ /**
77
+ * The Grower Name
78
+ *
79
+ * @type {?string}
80
+ * @public
81
+ */
82
+ this.growerName = null;
83
+
84
+ /**
85
+ * The Variety Code
86
+ *
87
+ * @type {?string}
88
+ * @public
89
+ */
90
+ this.varietyCode = null;
91
+
92
+ /**
93
+ * The Variety Name
94
+ *
95
+ * @type {?string}
96
+ * @public
97
+ */
98
+ this.varietyName = null;
99
+
100
+ /**
101
+ * The Total Weight Processed for this Batch
102
+ *
103
+ * @type {number}
104
+ * @public
105
+ */
106
+ this.totalWeight = 0;
107
+
108
+ /**
109
+ * The Packrun ID associated with this Batch
110
+ *
111
+ * @type {?string}
112
+ * @public
113
+ */
114
+ this.packrunId = null;
115
+
116
+ /**
117
+ * An Array of Summary Data Objects for each Article
118
+ *
119
+ * @type {Array<{name: string, fruitCount: number, fruitWeight: number}>}
120
+ * @public
121
+ */
122
+ this.articleSummaries = [];
123
+
124
+ /**
125
+ * An Array of Summary Data Objects for each Outlet
126
+ *
127
+ * @type {Array<{number: number, fruitCount: number, fruitWeight: number}>}
128
+ * @public
129
+ */
130
+ this.outletSummaries = [];
131
+
132
+ /**
133
+ * An Array of Summary Data Objects for each Fruit Size and Article
134
+ *
135
+ * @type {Array<{articleName: string, fruitSize: string, fruitCount: number, fruitWeight: number}>}
136
+ * @public
137
+ */
138
+ this.fruitSummaries = [];
139
+
140
+ /**
141
+ * Whether the MAF Sizer Batch has been deleted
142
+ *
143
+ * @type {boolean}
144
+ * @public
145
+ */
146
+ this.deleted = false;
147
+
148
+ /**
149
+ * When the MAF Sizer Batch 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 Batch
158
+ *
159
+ * @type {number}
160
+ * @public
161
+ */
162
+ this.siteId = siteId;
163
+ }
164
+
165
+ /**
166
+ * Create a new **MAFSizerBatchModel** 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 Batch
172
+ * @return {MAFSizerBatchModel}
173
+ */
174
+ static fromJSON(json, siteId)
175
+ {
176
+ let model = new MAFSizerBatchModel(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('mafSizerId' in jsonObject)
207
+ {
208
+ model.mafSizerId = (function(){
209
+ if(typeof jsonObject['mafSizerId'] !== 'string')
210
+ {
211
+ return String(jsonObject['mafSizerId']);
212
+ }
213
+
214
+ return jsonObject['mafSizerId'];
215
+ }());
216
+ }
217
+
218
+ if('batchId' in jsonObject)
219
+ {
220
+ model.batchId = (function(){
221
+ if(typeof jsonObject['batchId'] !== 'string')
222
+ {
223
+ return String(jsonObject['batchId']);
224
+ }
225
+
226
+ return jsonObject['batchId'];
227
+ }());
228
+ }
229
+
230
+ if('createdTimestamp' in jsonObject)
231
+ {
232
+ model.createdTimestamp = (function(){
233
+ if(typeof jsonObject['createdTimestamp'] !== 'string')
234
+ {
235
+ return new Date(String(jsonObject['createdTimestamp']));
236
+ }
237
+
238
+ return new Date(jsonObject['createdTimestamp']);
239
+ }());
240
+ }
241
+
242
+ if('batchName' in jsonObject)
243
+ {
244
+ model.batchName = (function(){
245
+ if(jsonObject['batchName'] === null)
246
+ {
247
+ return null;
248
+ }
249
+
250
+ if(typeof jsonObject['batchName'] !== 'string')
251
+ {
252
+ return String(jsonObject['batchName']);
253
+ }
254
+
255
+ return jsonObject['batchName'];
256
+ }());
257
+ }
258
+
259
+ if('growerCode' in jsonObject)
260
+ {
261
+ model.growerCode = (function(){
262
+ if(jsonObject['growerCode'] === null)
263
+ {
264
+ return null;
265
+ }
266
+
267
+ if(typeof jsonObject['growerCode'] !== 'string')
268
+ {
269
+ return String(jsonObject['growerCode']);
270
+ }
271
+
272
+ return jsonObject['growerCode'];
273
+ }());
274
+ }
275
+
276
+ if('growerName' in jsonObject)
277
+ {
278
+ model.growerName = (function(){
279
+ if(jsonObject['growerName'] === null)
280
+ {
281
+ return null;
282
+ }
283
+
284
+ if(typeof jsonObject['growerName'] !== 'string')
285
+ {
286
+ return String(jsonObject['growerName']);
287
+ }
288
+
289
+ return jsonObject['growerName'];
290
+ }());
291
+ }
292
+
293
+ if('varietyCode' in jsonObject)
294
+ {
295
+ model.varietyCode = (function(){
296
+ if(jsonObject['varietyCode'] === null)
297
+ {
298
+ return null;
299
+ }
300
+
301
+ if(typeof jsonObject['varietyCode'] !== 'string')
302
+ {
303
+ return String(jsonObject['varietyCode']);
304
+ }
305
+
306
+ return jsonObject['varietyCode'];
307
+ }());
308
+ }
309
+
310
+ if('varietyName' in jsonObject)
311
+ {
312
+ model.varietyName = (function(){
313
+ if(jsonObject['varietyName'] === null)
314
+ {
315
+ return null;
316
+ }
317
+
318
+ if(typeof jsonObject['varietyName'] !== 'string')
319
+ {
320
+ return String(jsonObject['varietyName']);
321
+ }
322
+
323
+ return jsonObject['varietyName'];
324
+ }());
325
+ }
326
+
327
+ if('totalWeight' in jsonObject)
328
+ {
329
+ model.totalWeight = (function(){
330
+ if(typeof jsonObject['totalWeight'] !== 'number')
331
+ {
332
+ return Number(jsonObject['totalWeight']);
333
+ }
334
+
335
+ return jsonObject['totalWeight'];
336
+ }());
337
+ }
338
+
339
+ if('packrunId' in jsonObject)
340
+ {
341
+ model.packrunId = (function(){
342
+ if(jsonObject['packrunId'] === null)
343
+ {
344
+ return null;
345
+ }
346
+
347
+ if(typeof jsonObject['packrunId'] !== 'string')
348
+ {
349
+ return String(jsonObject['packrunId']);
350
+ }
351
+
352
+ return jsonObject['packrunId'];
353
+ }());
354
+ }
355
+
356
+ if('articleSummaries' in jsonObject)
357
+ {
358
+ model.articleSummaries = (function(){
359
+ if(Array.isArray(jsonObject['articleSummaries']) !== true)
360
+ {
361
+ return [];
362
+ }
363
+
364
+ return jsonObject['articleSummaries'].map((articleSummariesItem) => {
365
+ return (function(){
366
+ let articleSummariesItemObject = {};
367
+
368
+ if(typeof articleSummariesItem === 'object' && 'name' in articleSummariesItem)
369
+ {
370
+ articleSummariesItemObject.name = (function(){
371
+ if(typeof articleSummariesItem.name !== 'string')
372
+ {
373
+ return String(articleSummariesItem.name);
374
+ }
375
+
376
+ return articleSummariesItem.name;
377
+ }());
378
+ }
379
+ else
380
+ {
381
+ articleSummariesItemObject.name = "";
382
+ }
383
+
384
+ if(typeof articleSummariesItem === 'object' && 'fruitCount' in articleSummariesItem)
385
+ {
386
+ articleSummariesItemObject.fruitCount = (function(){
387
+ if(typeof articleSummariesItem.fruitCount !== 'number')
388
+ {
389
+ return Number.isInteger(Number(articleSummariesItem.fruitCount)) ? Number(articleSummariesItem.fruitCount) : Math.floor(Number(articleSummariesItem.fruitCount));
390
+ }
391
+
392
+ return Number.isInteger(articleSummariesItem.fruitCount) ? articleSummariesItem.fruitCount : Math.floor(articleSummariesItem.fruitCount);
393
+ }());
394
+ }
395
+ else
396
+ {
397
+ articleSummariesItemObject.fruitCount = 0;
398
+ }
399
+
400
+ if(typeof articleSummariesItem === 'object' && 'fruitWeight' in articleSummariesItem)
401
+ {
402
+ articleSummariesItemObject.fruitWeight = (function(){
403
+ if(typeof articleSummariesItem.fruitWeight !== 'number')
404
+ {
405
+ return Number(articleSummariesItem.fruitWeight);
406
+ }
407
+
408
+ return articleSummariesItem.fruitWeight;
409
+ }());
410
+ }
411
+ else
412
+ {
413
+ articleSummariesItemObject.fruitWeight = 0;
414
+ }
415
+
416
+ return articleSummariesItemObject;
417
+ }());
418
+ });
419
+ }());
420
+ }
421
+
422
+ if('outletSummaries' in jsonObject)
423
+ {
424
+ model.outletSummaries = (function(){
425
+ if(Array.isArray(jsonObject['outletSummaries']) !== true)
426
+ {
427
+ return [];
428
+ }
429
+
430
+ return jsonObject['outletSummaries'].map((outletSummariesItem) => {
431
+ return (function(){
432
+ let outletSummariesItemObject = {};
433
+
434
+ if(typeof outletSummariesItem === 'object' && 'number' in outletSummariesItem)
435
+ {
436
+ outletSummariesItemObject.number = (function(){
437
+ if(typeof outletSummariesItem.number !== 'number')
438
+ {
439
+ return Number.isInteger(Number(outletSummariesItem.number)) ? Number(outletSummariesItem.number) : Math.floor(Number(outletSummariesItem.number));
440
+ }
441
+
442
+ return Number.isInteger(outletSummariesItem.number) ? outletSummariesItem.number : Math.floor(outletSummariesItem.number);
443
+ }());
444
+ }
445
+ else
446
+ {
447
+ outletSummariesItemObject.number = 0;
448
+ }
449
+
450
+ if(typeof outletSummariesItem === 'object' && 'fruitCount' in outletSummariesItem)
451
+ {
452
+ outletSummariesItemObject.fruitCount = (function(){
453
+ if(typeof outletSummariesItem.fruitCount !== 'number')
454
+ {
455
+ return Number.isInteger(Number(outletSummariesItem.fruitCount)) ? Number(outletSummariesItem.fruitCount) : Math.floor(Number(outletSummariesItem.fruitCount));
456
+ }
457
+
458
+ return Number.isInteger(outletSummariesItem.fruitCount) ? outletSummariesItem.fruitCount : Math.floor(outletSummariesItem.fruitCount);
459
+ }());
460
+ }
461
+ else
462
+ {
463
+ outletSummariesItemObject.fruitCount = 0;
464
+ }
465
+
466
+ if(typeof outletSummariesItem === 'object' && 'fruitWeight' in outletSummariesItem)
467
+ {
468
+ outletSummariesItemObject.fruitWeight = (function(){
469
+ if(typeof outletSummariesItem.fruitWeight !== 'number')
470
+ {
471
+ return Number(outletSummariesItem.fruitWeight);
472
+ }
473
+
474
+ return outletSummariesItem.fruitWeight;
475
+ }());
476
+ }
477
+ else
478
+ {
479
+ outletSummariesItemObject.fruitWeight = 0;
480
+ }
481
+
482
+ return outletSummariesItemObject;
483
+ }());
484
+ });
485
+ }());
486
+ }
487
+
488
+ if('fruitSummaries' in jsonObject)
489
+ {
490
+ model.fruitSummaries = (function(){
491
+ if(Array.isArray(jsonObject['fruitSummaries']) !== true)
492
+ {
493
+ return [];
494
+ }
495
+
496
+ return jsonObject['fruitSummaries'].map((fruitSummariesItem) => {
497
+ return (function(){
498
+ let fruitSummariesItemObject = {};
499
+
500
+ if(typeof fruitSummariesItem === 'object' && 'articleName' in fruitSummariesItem)
501
+ {
502
+ fruitSummariesItemObject.articleName = (function(){
503
+ if(typeof fruitSummariesItem.articleName !== 'string')
504
+ {
505
+ return String(fruitSummariesItem.articleName);
506
+ }
507
+
508
+ return fruitSummariesItem.articleName;
509
+ }());
510
+ }
511
+ else
512
+ {
513
+ fruitSummariesItemObject.articleName = "";
514
+ }
515
+
516
+ if(typeof fruitSummariesItem === 'object' && 'fruitSize' in fruitSummariesItem)
517
+ {
518
+ fruitSummariesItemObject.fruitSize = (function(){
519
+ if(typeof fruitSummariesItem.fruitSize !== 'string')
520
+ {
521
+ return String(fruitSummariesItem.fruitSize);
522
+ }
523
+
524
+ return fruitSummariesItem.fruitSize;
525
+ }());
526
+ }
527
+ else
528
+ {
529
+ fruitSummariesItemObject.fruitSize = "";
530
+ }
531
+
532
+ if(typeof fruitSummariesItem === 'object' && 'fruitCount' in fruitSummariesItem)
533
+ {
534
+ fruitSummariesItemObject.fruitCount = (function(){
535
+ if(typeof fruitSummariesItem.fruitCount !== 'number')
536
+ {
537
+ return Number.isInteger(Number(fruitSummariesItem.fruitCount)) ? Number(fruitSummariesItem.fruitCount) : Math.floor(Number(fruitSummariesItem.fruitCount));
538
+ }
539
+
540
+ return Number.isInteger(fruitSummariesItem.fruitCount) ? fruitSummariesItem.fruitCount : Math.floor(fruitSummariesItem.fruitCount);
541
+ }());
542
+ }
543
+ else
544
+ {
545
+ fruitSummariesItemObject.fruitCount = 0;
546
+ }
547
+
548
+ if(typeof fruitSummariesItem === 'object' && 'fruitWeight' in fruitSummariesItem)
549
+ {
550
+ fruitSummariesItemObject.fruitWeight = (function(){
551
+ if(typeof fruitSummariesItem.fruitWeight !== 'number')
552
+ {
553
+ return Number(fruitSummariesItem.fruitWeight);
554
+ }
555
+
556
+ return fruitSummariesItem.fruitWeight;
557
+ }());
558
+ }
559
+ else
560
+ {
561
+ fruitSummariesItemObject.fruitWeight = 0;
562
+ }
563
+
564
+ return fruitSummariesItemObject;
565
+ }());
566
+ });
567
+ }());
568
+ }
569
+
570
+ if('deleted' in jsonObject)
571
+ {
572
+ model.deleted = (function(){
573
+ if(typeof jsonObject['deleted'] !== 'boolean')
574
+ {
575
+ return Boolean(jsonObject['deleted']);
576
+ }
577
+
578
+ return jsonObject['deleted'];
579
+ }());
580
+ }
581
+
582
+ if('updateTimestamp' in jsonObject)
583
+ {
584
+ model.updateTimestamp = (function(){
585
+ if(typeof jsonObject['updateTimestamp'] !== 'string')
586
+ {
587
+ return new Date(String(jsonObject['updateTimestamp']));
588
+ }
589
+
590
+ return new Date(jsonObject['updateTimestamp']);
591
+ }());
592
+ }
593
+
594
+ return model;
595
+ }
596
+ }
597
+
598
+ export default MAFSizerBatchModel;