@ricado/api-client 2.0.2 → 2.2.0

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 (155) hide show
  1. package/README.md +5 -7
  2. package/dist/ricado.api.client.js +1 -1
  3. package/lib/Controllers/Packhouse/Site/BinTipBinController.js +622 -0
  4. package/lib/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
  5. package/lib/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
  6. package/lib/Controllers/Packhouse/Site/CompacSizerController.js +7 -7
  7. package/lib/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
  8. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
  9. package/lib/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
  10. package/lib/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
  11. package/lib/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
  12. package/lib/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
  13. package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +657 -0
  14. package/lib/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
  15. package/lib/Controllers/Packhouse/Site/PackTypeController.js +4 -4
  16. package/lib/Controllers/Packhouse/Site/PackingLineController.js +29 -5
  17. package/lib/Controllers/Packhouse/Site/PackrunController.js +46 -4
  18. package/lib/Controllers/Packhouse/Site/RejectBinController.js +4 -4
  19. package/lib/Controllers/Packhouse/Site/RejectBinScaleController.js +28 -6
  20. package/lib/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
  21. package/lib/Controllers/Packhouse/Site/ShiftController.js +4 -4
  22. package/lib/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
  23. package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +19 -4
  24. package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +661 -0
  25. package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +628 -0
  26. package/lib/Controllers/Packhouse/Site/SoftSortBeltController.js +453 -0
  27. package/lib/Controllers/Packhouse/Site/VarietyController.js +4 -4
  28. package/lib/Controllers/Packhouse/Site/index.js +15 -0
  29. package/lib/Controllers/Site/AlarmController.js +4 -4
  30. package/lib/Controllers/Site/AlarmGroupController.js +4 -4
  31. package/lib/Controllers/Site/DefinitionController.js +4 -4
  32. package/lib/Controllers/Site/PermanentObjectController.js +4 -4
  33. package/lib/Controllers/Site/PermanentObjectDataController.js +4 -4
  34. package/lib/Controllers/Site/PointController.js +4 -4
  35. package/lib/Controllers/Site/TemporaryObjectController.js +4 -4
  36. package/lib/Errors/BadRequestError.js +1 -1
  37. package/lib/Errors/ForbiddenError.js +1 -1
  38. package/lib/Errors/NetworkError.js +1 -1
  39. package/lib/Errors/NotAllowedError.js +1 -1
  40. package/lib/Errors/NotFoundError.js +1 -1
  41. package/lib/Errors/ServerError.js +1 -1
  42. package/lib/Errors/UnauthorizedError.js +1 -1
  43. package/lib/Models/AccountPolicyModel.js +1 -1
  44. package/lib/Models/ApiAccountModel.js +1 -1
  45. package/lib/Models/CompanyModel.js +1 -1
  46. package/lib/Models/FirebaseTokenModel.js +1 -1
  47. package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
  48. package/lib/Models/Packhouse/Site/BinTipWeightModel.js +14 -4
  49. package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +14 -4
  50. package/lib/Models/Packhouse/Site/CompacSizerModel.js +15 -5
  51. package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +14 -4
  52. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +14 -4
  53. package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +14 -4
  54. package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +14 -4
  55. package/lib/Models/Packhouse/Site/DowntimeEventModel.js +14 -4
  56. package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +14 -4
  57. package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
  58. package/lib/Models/Packhouse/Site/GrowingMethodModel.js +14 -4
  59. package/lib/Models/Packhouse/Site/PackTypeModel.js +14 -4
  60. package/lib/Models/Packhouse/Site/PackingLineModel.js +538 -5
  61. package/lib/Models/Packhouse/Site/PackrunModel.js +80 -4
  62. package/lib/Models/Packhouse/Site/RejectBinModel.js +14 -4
  63. package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +274 -8
  64. package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +14 -4
  65. package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +14 -4
  66. package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +181 -5
  67. package/lib/Models/Packhouse/Site/ShiftModel.js +14 -4
  68. package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
  69. package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
  70. package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +235 -0
  71. package/lib/Models/Packhouse/Site/VarietyModel.js +14 -4
  72. package/lib/Models/Packhouse/Site/index.js +15 -0
  73. package/lib/Models/RTUModel.js +1 -1
  74. package/lib/Models/RTUPluginModel.js +1 -1
  75. package/lib/Models/Site/AlarmGroupModel.js +14 -4
  76. package/lib/Models/Site/AlarmModel.js +14 -4
  77. package/lib/Models/Site/DefinitionModel.js +14 -4
  78. package/lib/Models/Site/PermanentObjectDataModel.js +14 -4
  79. package/lib/Models/Site/PermanentObjectModel.js +14 -4
  80. package/lib/Models/Site/PointModel.js +14 -4
  81. package/lib/Models/Site/TemporaryObjectModel.js +14 -4
  82. package/lib/Models/SiteModel.js +1 -1
  83. package/lib/Models/TokenModel.js +1 -1
  84. package/lib/Models/UserAccountActionTokenModel.js +1 -1
  85. package/lib/Models/UserAccountModel.js +1 -1
  86. package/lib/PackageVersion.js +1 -1
  87. package/lib/index.d.ts +4039 -1071
  88. package/package.json +1 -1
  89. package/src/Controllers/Packhouse/Site/BinTipBinController.js +665 -0
  90. package/src/Controllers/Packhouse/Site/BinTipWeightController.js +4 -4
  91. package/src/Controllers/Packhouse/Site/CompacSizerBatchController.js +4 -4
  92. package/src/Controllers/Packhouse/Site/CompacSizerController.js +7 -7
  93. package/src/Controllers/Packhouse/Site/CompacSizerOutletProductChangeController.js +4 -4
  94. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeChangeController.js +4 -4
  95. package/src/Controllers/Packhouse/Site/CompacSizerOutletTypeController.js +4 -4
  96. package/src/Controllers/Packhouse/Site/CompacSizerPackrunSummaryController.js +4 -4
  97. package/src/Controllers/Packhouse/Site/DowntimeEventController.js +4 -4
  98. package/src/Controllers/Packhouse/Site/FreshPackPackrunSummaryController.js +4 -4
  99. package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +700 -0
  100. package/src/Controllers/Packhouse/Site/GrowingMethodController.js +4 -4
  101. package/src/Controllers/Packhouse/Site/PackTypeController.js +4 -4
  102. package/src/Controllers/Packhouse/Site/PackingLineController.js +29 -5
  103. package/src/Controllers/Packhouse/Site/PackrunController.js +56 -4
  104. package/src/Controllers/Packhouse/Site/RejectBinController.js +4 -4
  105. package/src/Controllers/Packhouse/Site/RejectBinScaleController.js +28 -6
  106. package/src/Controllers/Packhouse/Site/RejectBinWeightController.js +4 -4
  107. package/src/Controllers/Packhouse/Site/ShiftController.js +4 -4
  108. package/src/Controllers/Packhouse/Site/ShiftFocusMeetingController.js +4 -4
  109. package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +19 -4
  110. package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +704 -0
  111. package/src/Controllers/Packhouse/Site/ShiftTaskController.js +671 -0
  112. package/src/Controllers/Packhouse/Site/SoftSortBeltController.js +474 -0
  113. package/src/Controllers/Packhouse/Site/VarietyController.js +4 -4
  114. package/src/Controllers/Packhouse/Site/index.js +10 -0
  115. package/src/Controllers/Site/AlarmController.js +4 -4
  116. package/src/Controllers/Site/AlarmGroupController.js +4 -4
  117. package/src/Controllers/Site/DefinitionController.js +4 -4
  118. package/src/Controllers/Site/PermanentObjectController.js +4 -4
  119. package/src/Controllers/Site/PermanentObjectDataController.js +4 -4
  120. package/src/Controllers/Site/PointController.js +4 -4
  121. package/src/Controllers/Site/TemporaryObjectController.js +4 -4
  122. package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
  123. package/src/Models/Packhouse/Site/BinTipWeightModel.js +13 -3
  124. package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +13 -3
  125. package/src/Models/Packhouse/Site/CompacSizerModel.js +14 -4
  126. package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +13 -3
  127. package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +13 -3
  128. package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +13 -3
  129. package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +13 -3
  130. package/src/Models/Packhouse/Site/DowntimeEventModel.js +13 -3
  131. package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +13 -3
  132. package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
  133. package/src/Models/Packhouse/Site/GrowingMethodModel.js +13 -3
  134. package/src/Models/Packhouse/Site/PackTypeModel.js +13 -3
  135. package/src/Models/Packhouse/Site/PackingLineModel.js +718 -4
  136. package/src/Models/Packhouse/Site/PackrunModel.js +88 -3
  137. package/src/Models/Packhouse/Site/RejectBinModel.js +13 -3
  138. package/src/Models/Packhouse/Site/RejectBinScaleModel.js +310 -7
  139. package/src/Models/Packhouse/Site/RejectBinWeightModel.js +13 -3
  140. package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +13 -3
  141. package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +205 -4
  142. package/src/Models/Packhouse/Site/ShiftModel.js +13 -3
  143. package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
  144. package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
  145. package/src/Models/Packhouse/Site/SoftSortBeltModel.js +215 -0
  146. package/src/Models/Packhouse/Site/VarietyModel.js +13 -3
  147. package/src/Models/Packhouse/Site/index.js +10 -0
  148. package/src/Models/Site/AlarmGroupModel.js +13 -3
  149. package/src/Models/Site/AlarmModel.js +13 -3
  150. package/src/Models/Site/DefinitionModel.js +13 -3
  151. package/src/Models/Site/PermanentObjectDataModel.js +13 -3
  152. package/src/Models/Site/PermanentObjectModel.js +13 -3
  153. package/src/Models/Site/PointModel.js +13 -3
  154. package/src/Models/Site/TemporaryObjectModel.js +13 -3
  155. package/src/PackageVersion.js +1 -1
@@ -0,0 +1,474 @@
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 RequestHelper from '../../../RequestHelper';
8
+ import SoftSortBeltModel from '../../../Models/Packhouse/Site/SoftSortBeltModel';
9
+
10
+ /**
11
+ * Controller Class for Soft Sort Belts
12
+ *
13
+ * @class
14
+ */
15
+ class SoftSortBeltController
16
+ {
17
+ /**
18
+ * Retrieve a Soft Sort Belt [GET /packhouse/sites/{siteId}/soft-sort-belts/{id}]
19
+ *
20
+ * @static
21
+ * @public
22
+ * @param {number} siteId The Site ID
23
+ * @param {string} id The Soft Sort Belt ID
24
+ * @return {Promise<SoftSortBeltModel>}
25
+ */
26
+ static getOne(siteId, id)
27
+ {
28
+ return new Promise((resolve, reject) => {
29
+ RequestHelper.getRequest(`/packhouse/sites/${siteId}/soft-sort-belts/${id}`)
30
+ .then((result) => {
31
+ let resolveValue = (function(){
32
+ return SoftSortBeltModel.fromJSON(result, siteId);
33
+ }());
34
+
35
+ resolve(resolveValue);
36
+ })
37
+ .catch(error => reject(error));
38
+ });
39
+ }
40
+
41
+ /**
42
+ * Update a Soft Sort Belt [PATCH /packhouse/sites/{siteId}/soft-sort-belts/{id}]
43
+ *
44
+ * @static
45
+ * @public
46
+ * @param {number} siteId The Site ID
47
+ * @param {string} id The Soft Sort Belt ID
48
+ * @param {SoftSortBeltController.UpdateData} updateData The Soft Sort Belt Update Data
49
+ * @return {Promise<SoftSortBeltModel>}
50
+ */
51
+ static update(siteId, id, updateData)
52
+ {
53
+ return new Promise((resolve, reject) => {
54
+ RequestHelper.patchRequest(`/packhouse/sites/${siteId}/soft-sort-belts/${id}`, updateData)
55
+ .then((result) => {
56
+ let resolveValue = (function(){
57
+ return SoftSortBeltModel.fromJSON(result, siteId);
58
+ }());
59
+
60
+ resolve(resolveValue);
61
+ })
62
+ .catch(error => reject(error));
63
+ });
64
+ }
65
+
66
+ /**
67
+ * Delete a Soft Sort Belt [DELETE /packhouse/sites/{siteId}/soft-sort-belts/{id}]
68
+ *
69
+ * @static
70
+ * @public
71
+ * @param {number} siteId The Site ID
72
+ * @param {string} id The Soft Sort Belt ID
73
+ * @return {Promise<boolean>}
74
+ */
75
+ static delete(siteId, id)
76
+ {
77
+ return new Promise((resolve, reject) => {
78
+ RequestHelper.deleteRequest(`/packhouse/sites/${siteId}/soft-sort-belts/${id}`)
79
+ .then((result) => {
80
+ resolve(result ?? true);
81
+ })
82
+ .catch(error => reject(error));
83
+ });
84
+ }
85
+
86
+ /**
87
+ * Retrieve the Events of a Soft Sort Belt [GET /packhouse/sites/{siteId}/soft-sort-belts/{id}/events]
88
+ *
89
+ * Retrieves Events for a Single Soft Sort Belt
90
+ *
91
+ * @static
92
+ * @public
93
+ * @param {number} siteId The Site ID
94
+ * @param {string} id The Soft Sort Belt ID
95
+ * @param {SoftSortBeltController.GetOneEventsQueryParameters} [queryParameters] The Optional Query Parameters
96
+ * @return {Promise<Array<SoftSortBeltController.SoftSortEventItem>>}
97
+ */
98
+ static getOneEvents(siteId, id, queryParameters = {})
99
+ {
100
+ return new Promise((resolve, reject) => {
101
+ RequestHelper.getRequest(`/packhouse/sites/${siteId}/soft-sort-belts/${id}/events`, queryParameters)
102
+ .then((result) => {
103
+ let resolveValue = (function(){
104
+ if(Array.isArray(result) !== true)
105
+ {
106
+ return [];
107
+ }
108
+
109
+ return result.map((resultItem) => {
110
+ return (function(){
111
+ let resultItemObject = {};
112
+
113
+ if(typeof resultItem === 'object' && 'beltId' in resultItem)
114
+ {
115
+ resultItemObject.beltId = (function(){
116
+ if(typeof resultItem.beltId !== 'string')
117
+ {
118
+ return String(resultItem.beltId);
119
+ }
120
+
121
+ return resultItem.beltId;
122
+ }());
123
+ }
124
+ else
125
+ {
126
+ resultItemObject.beltId = "";
127
+ }
128
+
129
+ if(typeof resultItem === 'object' && 'packrunId' in resultItem)
130
+ {
131
+ resultItemObject.packrunId = (function(){
132
+ if(typeof resultItem.packrunId !== 'string')
133
+ {
134
+ return String(resultItem.packrunId);
135
+ }
136
+
137
+ return resultItem.packrunId;
138
+ }());
139
+ }
140
+ else
141
+ {
142
+ resultItemObject.packrunId = "";
143
+ }
144
+
145
+ if(typeof resultItem === 'object' && 'packrunName' in resultItem)
146
+ {
147
+ resultItemObject.packrunName = (function(){
148
+ if(typeof resultItem.packrunName !== 'string')
149
+ {
150
+ return String(resultItem.packrunName);
151
+ }
152
+
153
+ return resultItem.packrunName;
154
+ }());
155
+ }
156
+ else
157
+ {
158
+ resultItemObject.packrunName = "";
159
+ }
160
+
161
+ if(typeof resultItem === 'object' && 'startTimestamp' in resultItem)
162
+ {
163
+ resultItemObject.startTimestamp = (function(){
164
+ if(typeof resultItem.startTimestamp !== 'string')
165
+ {
166
+ return new Date(String(resultItem.startTimestamp));
167
+ }
168
+
169
+ return new Date(resultItem.startTimestamp);
170
+ }());
171
+ }
172
+ else
173
+ {
174
+ resultItemObject.startTimestamp = new Date();
175
+ }
176
+
177
+ if(typeof resultItem === 'object' && 'endTimestamp' in resultItem)
178
+ {
179
+ resultItemObject.endTimestamp = (function(){
180
+ if(typeof resultItem.endTimestamp !== 'string')
181
+ {
182
+ return new Date(String(resultItem.endTimestamp));
183
+ }
184
+
185
+ return new Date(resultItem.endTimestamp);
186
+ }());
187
+ }
188
+ else
189
+ {
190
+ resultItemObject.endTimestamp = new Date();
191
+ }
192
+
193
+ if(typeof resultItem === 'object' && 'duration' in resultItem)
194
+ {
195
+ resultItemObject.duration = (function(){
196
+ if(typeof resultItem.duration !== 'number')
197
+ {
198
+ return Number.isInteger(Number(resultItem.duration)) ? Number(resultItem.duration) : Math.floor(Number(resultItem.duration));
199
+ }
200
+
201
+ return Number.isInteger(resultItem.duration) ? resultItem.duration : Math.floor(resultItem.duration);
202
+ }());
203
+ }
204
+ else
205
+ {
206
+ resultItemObject.duration = 0;
207
+ }
208
+
209
+ return resultItemObject;
210
+ }());
211
+ });
212
+ }());
213
+
214
+ resolve(resolveValue);
215
+ })
216
+ .catch(error => reject(error));
217
+ });
218
+ }
219
+
220
+ /**
221
+ * List all Soft Sort Belts [GET /packhouse/sites/{siteId}/soft-sort-belts]
222
+ *
223
+ * @static
224
+ * @public
225
+ * @param {number} siteId The Site ID
226
+ * @param {SoftSortBeltController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
227
+ * @return {Promise<SoftSortBeltModel[]>}
228
+ */
229
+ static getAll(siteId, queryParameters = {})
230
+ {
231
+ return new Promise((resolve, reject) => {
232
+ RequestHelper.getRequest(`/packhouse/sites/${siteId}/soft-sort-belts`, queryParameters)
233
+ .then((result) => {
234
+ let resolveValue = (function(){
235
+ if(Array.isArray(result) !== true)
236
+ {
237
+ return [];
238
+ }
239
+
240
+ return result.map((resultItem) => {
241
+ return (function(){
242
+ return SoftSortBeltModel.fromJSON(resultItem, siteId);
243
+ }());
244
+ });
245
+ }());
246
+
247
+ resolve(resolveValue);
248
+ })
249
+ .catch(error => reject(error));
250
+ });
251
+ }
252
+
253
+ /**
254
+ * Create a Soft Sort Belt [POST /packhouse/sites/{siteId}/soft-sort-belts]
255
+ *
256
+ * @static
257
+ * @public
258
+ * @param {number} siteId The Site ID
259
+ * @param {SoftSortBeltController.CreateData} createData The Soft Sort Belt Create Data
260
+ * @return {Promise<SoftSortBeltModel>}
261
+ */
262
+ static create(siteId, createData)
263
+ {
264
+ return new Promise((resolve, reject) => {
265
+ RequestHelper.postRequest(`/packhouse/sites/${siteId}/soft-sort-belts`, createData)
266
+ .then((result) => {
267
+ let resolveValue = (function(){
268
+ return SoftSortBeltModel.fromJSON(result, siteId);
269
+ }());
270
+
271
+ resolve(resolveValue);
272
+ })
273
+ .catch(error => reject(error));
274
+ });
275
+ }
276
+
277
+ /**
278
+ * Retrieve the Events of all Soft Sort Belts [GET /packhouse/sites/{siteId}/soft-sort-belts/events]
279
+ *
280
+ * Retrieves Events for all Soft Sort Belts
281
+ *
282
+ * @static
283
+ * @public
284
+ * @param {number} siteId The Site ID
285
+ * @param {SoftSortBeltController.GetAllEventsQueryParameters} [queryParameters] The Optional Query Parameters
286
+ * @return {Promise<Array<SoftSortBeltController.SoftSortEventItem>>}
287
+ */
288
+ static getAllEvents(siteId, queryParameters = {})
289
+ {
290
+ return new Promise((resolve, reject) => {
291
+ RequestHelper.getRequest(`/packhouse/sites/${siteId}/soft-sort-belts/events`, queryParameters)
292
+ .then((result) => {
293
+ let resolveValue = (function(){
294
+ if(Array.isArray(result) !== true)
295
+ {
296
+ return [];
297
+ }
298
+
299
+ return result.map((resultItem) => {
300
+ return (function(){
301
+ let resultItemObject = {};
302
+
303
+ if(typeof resultItem === 'object' && 'beltId' in resultItem)
304
+ {
305
+ resultItemObject.beltId = (function(){
306
+ if(typeof resultItem.beltId !== 'string')
307
+ {
308
+ return String(resultItem.beltId);
309
+ }
310
+
311
+ return resultItem.beltId;
312
+ }());
313
+ }
314
+ else
315
+ {
316
+ resultItemObject.beltId = "";
317
+ }
318
+
319
+ if(typeof resultItem === 'object' && 'packrunId' in resultItem)
320
+ {
321
+ resultItemObject.packrunId = (function(){
322
+ if(typeof resultItem.packrunId !== 'string')
323
+ {
324
+ return String(resultItem.packrunId);
325
+ }
326
+
327
+ return resultItem.packrunId;
328
+ }());
329
+ }
330
+ else
331
+ {
332
+ resultItemObject.packrunId = "";
333
+ }
334
+
335
+ if(typeof resultItem === 'object' && 'packrunName' in resultItem)
336
+ {
337
+ resultItemObject.packrunName = (function(){
338
+ if(typeof resultItem.packrunName !== 'string')
339
+ {
340
+ return String(resultItem.packrunName);
341
+ }
342
+
343
+ return resultItem.packrunName;
344
+ }());
345
+ }
346
+ else
347
+ {
348
+ resultItemObject.packrunName = "";
349
+ }
350
+
351
+ if(typeof resultItem === 'object' && 'startTimestamp' in resultItem)
352
+ {
353
+ resultItemObject.startTimestamp = (function(){
354
+ if(typeof resultItem.startTimestamp !== 'string')
355
+ {
356
+ return new Date(String(resultItem.startTimestamp));
357
+ }
358
+
359
+ return new Date(resultItem.startTimestamp);
360
+ }());
361
+ }
362
+ else
363
+ {
364
+ resultItemObject.startTimestamp = new Date();
365
+ }
366
+
367
+ if(typeof resultItem === 'object' && 'endTimestamp' in resultItem)
368
+ {
369
+ resultItemObject.endTimestamp = (function(){
370
+ if(typeof resultItem.endTimestamp !== 'string')
371
+ {
372
+ return new Date(String(resultItem.endTimestamp));
373
+ }
374
+
375
+ return new Date(resultItem.endTimestamp);
376
+ }());
377
+ }
378
+ else
379
+ {
380
+ resultItemObject.endTimestamp = new Date();
381
+ }
382
+
383
+ if(typeof resultItem === 'object' && 'duration' in resultItem)
384
+ {
385
+ resultItemObject.duration = (function(){
386
+ if(typeof resultItem.duration !== 'number')
387
+ {
388
+ return Number.isInteger(Number(resultItem.duration)) ? Number(resultItem.duration) : Math.floor(Number(resultItem.duration));
389
+ }
390
+
391
+ return Number.isInteger(resultItem.duration) ? resultItem.duration : Math.floor(resultItem.duration);
392
+ }());
393
+ }
394
+ else
395
+ {
396
+ resultItemObject.duration = 0;
397
+ }
398
+
399
+ return resultItemObject;
400
+ }());
401
+ });
402
+ }());
403
+
404
+ resolve(resolveValue);
405
+ })
406
+ .catch(error => reject(error));
407
+ });
408
+ }
409
+ }
410
+
411
+ export default SoftSortBeltController;
412
+
413
+ /**
414
+ * The Optional Query Parameters for the getOneEvents Function
415
+ *
416
+ * @typedef {Object} SoftSortBeltController.GetOneEventsQueryParameters
417
+ * @property {Date} [timestampBegin] The Beginning Timestamp of the Soft-Sort Event Results. Defaults to 24 Hours ago
418
+ * @property {Date} [timestampEnd] The End Timestamp of the Soft-Sort Event Results. Defaults to Now
419
+ * @memberof Controllers.Packhouse.Site
420
+ */
421
+
422
+ /**
423
+ * The Optional Query Parameters for the getAll Function
424
+ *
425
+ * @typedef {Object} SoftSortBeltController.GetAllQueryParameters
426
+ * @property {?number} [rtuId] The RTU this Soft Sort Belt belongs to
427
+ * @property {string} [name] The Name of this Soft Sort Belt
428
+ * @property {string} [packingLineId] The Packing Line that owns this Soft Sort Belt
429
+ * @memberof Controllers.Packhouse.Site
430
+ */
431
+
432
+ /**
433
+ * The Optional Query Parameters for the getAllEvents Function
434
+ *
435
+ * @typedef {Object} SoftSortBeltController.GetAllEventsQueryParameters
436
+ * @property {string[]} [beltIds] A List of Soft-Sort Belt IDs to Filter by
437
+ * @property {Date} [timestampBegin] The Beginning Timestamp of the Soft-Sort Event Results. Defaults to 24 Hours ago
438
+ * @property {Date} [timestampEnd] The End Timestamp of the Soft-Sort Event Results. Defaults to Now
439
+ * @memberof Controllers.Packhouse.Site
440
+ */
441
+
442
+ /**
443
+ * The Create Data for a Soft Sort Belt
444
+ *
445
+ * @typedef {Object} SoftSortBeltController.CreateData
446
+ * @property {?number} [rtuId] The RTU this Soft Sort Belt belongs to
447
+ * @property {string} name The Name of this Soft Sort Belt
448
+ * @property {Object} points The Points used by this Soft Sort Belt
449
+ * @property {string} packingLineId The Packing Line that owns this Soft Sort Belt
450
+ * @memberof Controllers.Packhouse.Site
451
+ */
452
+
453
+ /**
454
+ * The Update Data for a Soft Sort Belt
455
+ *
456
+ * @typedef {Object} SoftSortBeltController.UpdateData
457
+ * @property {string} [name] The Name of this Soft Sort Belt
458
+ * @property {Object} [points] The Points used by this Soft Sort Belt
459
+ * @property {string} [packingLineId] The Packing Line that owns this Soft Sort Belt
460
+ * @memberof Controllers.Packhouse.Site
461
+ */
462
+
463
+ /**
464
+ * A **SoftSortEventItem** Type
465
+ *
466
+ * @typedef {Object} SoftSortBeltController.SoftSortEventItem
467
+ * @property {string} beltId The Soft-Sort Belt ID
468
+ * @property {string} packrunId The ID of the associated Packrun
469
+ * @property {string} packrunName The Name of the associated Packrun
470
+ * @property {Date} startTimestamp When the Event Started
471
+ * @property {Date} endTimestamp When the Event Ended
472
+ * @property {number} duration The Duration in Seconds of the Event
473
+ * @memberof Controllers.Packhouse.Site
474
+ */
@@ -29,7 +29,7 @@ class VarietyController
29
29
  RequestHelper.getRequest(`/packhouse/sites/${siteId}/varieties/${id}`)
30
30
  .then((result) => {
31
31
  let resolveValue = (function(){
32
- return VarietyModel.fromJSON(result);
32
+ return VarietyModel.fromJSON(result, siteId);
33
33
  }());
34
34
 
35
35
  resolve(resolveValue);
@@ -54,7 +54,7 @@ class VarietyController
54
54
  RequestHelper.patchRequest(`/packhouse/sites/${siteId}/varieties/${id}`, updateData)
55
55
  .then((result) => {
56
56
  let resolveValue = (function(){
57
- return VarietyModel.fromJSON(result);
57
+ return VarietyModel.fromJSON(result, siteId);
58
58
  }());
59
59
 
60
60
  resolve(resolveValue);
@@ -105,7 +105,7 @@ class VarietyController
105
105
 
106
106
  return result.map((resultItem) => {
107
107
  return (function(){
108
- return VarietyModel.fromJSON(resultItem);
108
+ return VarietyModel.fromJSON(resultItem, siteId);
109
109
  }());
110
110
  });
111
111
  }());
@@ -131,7 +131,7 @@ class VarietyController
131
131
  RequestHelper.postRequest(`/packhouse/sites/${siteId}/varieties`, createData)
132
132
  .then((result) => {
133
133
  let resolveValue = (function(){
134
- return VarietyModel.fromJSON(result);
134
+ return VarietyModel.fromJSON(result, siteId);
135
135
  }());
136
136
 
137
137
  resolve(resolveValue);
@@ -7,6 +7,7 @@
7
7
  /**
8
8
  * @namespace Controllers.Packhouse.Site
9
9
  */
10
+ import BinTipBinController from './BinTipBinController';
10
11
  import BinTipWeightController from './BinTipWeightController';
11
12
  import CompacSizerBatchController from './CompacSizerBatchController';
12
13
  import CompacSizerController from './CompacSizerController';
@@ -16,6 +17,7 @@ import CompacSizerOutletTypeController from './CompacSizerOutletTypeController';
16
17
  import CompacSizerPackrunSummaryController from './CompacSizerPackrunSummaryController';
17
18
  import DowntimeEventController from './DowntimeEventController';
18
19
  import FreshPackPackrunSummaryController from './FreshPackPackrunSummaryController';
20
+ import FreshQualityPackrunSummaryController from './FreshQualityPackrunSummaryController';
19
21
  import GrowingMethodController from './GrowingMethodController';
20
22
  import PackTypeController from './PackTypeController';
21
23
  import PackingLineController from './PackingLineController';
@@ -26,9 +28,13 @@ import RejectBinWeightController from './RejectBinWeightController';
26
28
  import ShiftController from './ShiftController';
27
29
  import ShiftFocusMeetingController from './ShiftFocusMeetingController';
28
30
  import ShiftHourlyEntryController from './ShiftHourlyEntryController';
31
+ import ShiftQualitySummaryController from './ShiftQualitySummaryController';
32
+ import ShiftTaskController from './ShiftTaskController';
33
+ import SoftSortBeltController from './SoftSortBeltController';
29
34
  import VarietyController from './VarietyController';
30
35
 
31
36
  const Site = {
37
+ BinTipBinController,
32
38
  BinTipWeightController,
33
39
  CompacSizerBatchController,
34
40
  CompacSizerController,
@@ -38,6 +44,7 @@ const Site = {
38
44
  CompacSizerPackrunSummaryController,
39
45
  DowntimeEventController,
40
46
  FreshPackPackrunSummaryController,
47
+ FreshQualityPackrunSummaryController,
41
48
  GrowingMethodController,
42
49
  PackTypeController,
43
50
  PackingLineController,
@@ -48,6 +55,9 @@ const Site = {
48
55
  ShiftController,
49
56
  ShiftFocusMeetingController,
50
57
  ShiftHourlyEntryController,
58
+ ShiftQualitySummaryController,
59
+ ShiftTaskController,
60
+ SoftSortBeltController,
51
61
  VarietyController,
52
62
  };
53
63
 
@@ -29,7 +29,7 @@ class AlarmController
29
29
  RequestHelper.getRequest(`/sites/${siteId}/alarms/${id}`)
30
30
  .then((result) => {
31
31
  let resolveValue = (function(){
32
- return AlarmModel.fromJSON(result);
32
+ return AlarmModel.fromJSON(result, siteId);
33
33
  }());
34
34
 
35
35
  resolve(resolveValue);
@@ -54,7 +54,7 @@ class AlarmController
54
54
  RequestHelper.patchRequest(`/sites/${siteId}/alarms/${id}`, updateData)
55
55
  .then((result) => {
56
56
  let resolveValue = (function(){
57
- return AlarmModel.fromJSON(result);
57
+ return AlarmModel.fromJSON(result, siteId);
58
58
  }());
59
59
 
60
60
  resolve(resolveValue);
@@ -212,7 +212,7 @@ class AlarmController
212
212
 
213
213
  return result.map((resultItem) => {
214
214
  return (function(){
215
- return AlarmModel.fromJSON(resultItem);
215
+ return AlarmModel.fromJSON(resultItem, siteId);
216
216
  }());
217
217
  });
218
218
  }());
@@ -238,7 +238,7 @@ class AlarmController
238
238
  RequestHelper.postRequest(`/sites/${siteId}/alarms`, createData)
239
239
  .then((result) => {
240
240
  let resolveValue = (function(){
241
- return AlarmModel.fromJSON(result);
241
+ return AlarmModel.fromJSON(result, siteId);
242
242
  }());
243
243
 
244
244
  resolve(resolveValue);
@@ -29,7 +29,7 @@ class AlarmGroupController
29
29
  RequestHelper.getRequest(`/sites/${siteId}/alarm-groups/${id}`)
30
30
  .then((result) => {
31
31
  let resolveValue = (function(){
32
- return AlarmGroupModel.fromJSON(result);
32
+ return AlarmGroupModel.fromJSON(result, siteId);
33
33
  }());
34
34
 
35
35
  resolve(resolveValue);
@@ -54,7 +54,7 @@ class AlarmGroupController
54
54
  RequestHelper.patchRequest(`/sites/${siteId}/alarm-groups/${id}`, updateData)
55
55
  .then((result) => {
56
56
  let resolveValue = (function(){
57
- return AlarmGroupModel.fromJSON(result);
57
+ return AlarmGroupModel.fromJSON(result, siteId);
58
58
  }());
59
59
 
60
60
  resolve(resolveValue);
@@ -105,7 +105,7 @@ class AlarmGroupController
105
105
 
106
106
  return result.map((resultItem) => {
107
107
  return (function(){
108
- return AlarmGroupModel.fromJSON(resultItem);
108
+ return AlarmGroupModel.fromJSON(resultItem, siteId);
109
109
  }());
110
110
  });
111
111
  }());
@@ -131,7 +131,7 @@ class AlarmGroupController
131
131
  RequestHelper.postRequest(`/sites/${siteId}/alarm-groups`, createData)
132
132
  .then((result) => {
133
133
  let resolveValue = (function(){
134
- return AlarmGroupModel.fromJSON(result);
134
+ return AlarmGroupModel.fromJSON(result, siteId);
135
135
  }());
136
136
 
137
137
  resolve(resolveValue);
@@ -29,7 +29,7 @@ class DefinitionController
29
29
  RequestHelper.getRequest(`/sites/${siteId}/definitions/${id}`)
30
30
  .then((result) => {
31
31
  let resolveValue = (function(){
32
- return DefinitionModel.fromJSON(result);
32
+ return DefinitionModel.fromJSON(result, siteId);
33
33
  }());
34
34
 
35
35
  resolve(resolveValue);
@@ -54,7 +54,7 @@ class DefinitionController
54
54
  RequestHelper.patchRequest(`/sites/${siteId}/definitions/${id}`, updateData)
55
55
  .then((result) => {
56
56
  let resolveValue = (function(){
57
- return DefinitionModel.fromJSON(result);
57
+ return DefinitionModel.fromJSON(result, siteId);
58
58
  }());
59
59
 
60
60
  resolve(resolveValue);
@@ -105,7 +105,7 @@ class DefinitionController
105
105
 
106
106
  return result.map((resultItem) => {
107
107
  return (function(){
108
- return DefinitionModel.fromJSON(resultItem);
108
+ return DefinitionModel.fromJSON(resultItem, siteId);
109
109
  }());
110
110
  });
111
111
  }());
@@ -131,7 +131,7 @@ class DefinitionController
131
131
  RequestHelper.postRequest(`/sites/${siteId}/definitions`, createData)
132
132
  .then((result) => {
133
133
  let resolveValue = (function(){
134
- return DefinitionModel.fromJSON(result);
134
+ return DefinitionModel.fromJSON(result, siteId);
135
135
  }());
136
136
 
137
137
  resolve(resolveValue);