@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,704 @@
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 ShiftQualitySummaryModel from '../../../Models/Packhouse/Site/ShiftQualitySummaryModel';
9
+
10
+ /**
11
+ * Controller Class for Shift Quality Summaries
12
+ *
13
+ * @class
14
+ */
15
+ class ShiftQualitySummaryController
16
+ {
17
+ /**
18
+ * Retrieve a Shift Quality Summary [GET /packhouse/sites/{siteId}/shift-quality-summaries/{id}]
19
+ *
20
+ * @static
21
+ * @public
22
+ * @param {number} siteId The Site ID
23
+ * @param {string} id The Shift Quality Summary ID
24
+ * @return {Promise<ShiftQualitySummaryModel>}
25
+ */
26
+ static getOne(siteId, id)
27
+ {
28
+ return new Promise((resolve, reject) => {
29
+ RequestHelper.getRequest(`/packhouse/sites/${siteId}/shift-quality-summaries/${id}`)
30
+ .then((result) => {
31
+ let resolveValue = (function(){
32
+ return ShiftQualitySummaryModel.fromJSON(result, siteId);
33
+ }());
34
+
35
+ resolve(resolveValue);
36
+ })
37
+ .catch(error => reject(error));
38
+ });
39
+ }
40
+
41
+ /**
42
+ * Update a Shift Quality Summary [PATCH /packhouse/sites/{siteId}/shift-quality-summaries/{id}]
43
+ *
44
+ * @static
45
+ * @public
46
+ * @param {number} siteId The Site ID
47
+ * @param {string} id The Shift Quality Summary ID
48
+ * @param {ShiftQualitySummaryController.UpdateData} updateData The Shift Quality Summary Update Data
49
+ * @return {Promise<ShiftQualitySummaryModel>}
50
+ */
51
+ static update(siteId, id, updateData)
52
+ {
53
+ return new Promise((resolve, reject) => {
54
+ RequestHelper.patchRequest(`/packhouse/sites/${siteId}/shift-quality-summaries/${id}`, updateData)
55
+ .then((result) => {
56
+ let resolveValue = (function(){
57
+ return ShiftQualitySummaryModel.fromJSON(result, siteId);
58
+ }());
59
+
60
+ resolve(resolveValue);
61
+ })
62
+ .catch(error => reject(error));
63
+ });
64
+ }
65
+
66
+ /**
67
+ * Delete a Shift Quality Summary [DELETE /packhouse/sites/{siteId}/shift-quality-summaries/{id}]
68
+ *
69
+ * @static
70
+ * @public
71
+ * @param {number} siteId The Site ID
72
+ * @param {string} id The Shift Quality Summary ID
73
+ * @return {Promise<boolean>}
74
+ */
75
+ static delete(siteId, id)
76
+ {
77
+ return new Promise((resolve, reject) => {
78
+ RequestHelper.deleteRequest(`/packhouse/sites/${siteId}/shift-quality-summaries/${id}`)
79
+ .then((result) => {
80
+ resolve(result ?? true);
81
+ })
82
+ .catch(error => reject(error));
83
+ });
84
+ }
85
+
86
+ /**
87
+ * Retrieve Comments [GET /packhouse/sites/{siteId}/shift-quality-summaries/{id}/comments]
88
+ *
89
+ * Retrieves Comments for a Shift Quality Summary
90
+ *
91
+ * @static
92
+ * @public
93
+ * @param {number} siteId The Site ID
94
+ * @param {string} id The Shift Quality Summary ID
95
+ * @return {Promise<Array<ShiftQualitySummaryController.CommentItem>>}
96
+ */
97
+ static getComments(siteId, id)
98
+ {
99
+ return new Promise((resolve, reject) => {
100
+ RequestHelper.getRequest(`/packhouse/sites/${siteId}/shift-quality-summaries/${id}/comments`)
101
+ .then((result) => {
102
+ let resolveValue = (function(){
103
+ if(Array.isArray(result) !== true)
104
+ {
105
+ return [];
106
+ }
107
+
108
+ return result.map((resultItem) => {
109
+ return (function(){
110
+ let resultItemObject = {};
111
+
112
+ if(typeof resultItem === 'object' && 'id' in resultItem)
113
+ {
114
+ resultItemObject.id = (function(){
115
+ if(typeof resultItem.id !== 'string')
116
+ {
117
+ return String(resultItem.id);
118
+ }
119
+
120
+ return resultItem.id;
121
+ }());
122
+ }
123
+ else
124
+ {
125
+ resultItemObject.id = "";
126
+ }
127
+
128
+ if(typeof resultItem === 'object' && 'content' in resultItem)
129
+ {
130
+ resultItemObject.content = (function(){
131
+ if(resultItem.content === null)
132
+ {
133
+ return null;
134
+ }
135
+
136
+ if(typeof resultItem.content !== 'string')
137
+ {
138
+ return String(resultItem.content);
139
+ }
140
+
141
+ return resultItem.content;
142
+ }());
143
+ }
144
+ else
145
+ {
146
+ resultItemObject.content = null;
147
+ }
148
+
149
+ if(typeof resultItem === 'object' && 'createdTimestamp' in resultItem)
150
+ {
151
+ resultItemObject.createdTimestamp = (function(){
152
+ if(resultItem.createdTimestamp === null)
153
+ {
154
+ return null;
155
+ }
156
+
157
+ if(typeof resultItem.createdTimestamp !== 'string')
158
+ {
159
+ return new Date(String(resultItem.createdTimestamp));
160
+ }
161
+
162
+ return new Date(resultItem.createdTimestamp);
163
+ }());
164
+ }
165
+ else
166
+ {
167
+ resultItemObject.createdTimestamp = null;
168
+ }
169
+
170
+ if(typeof resultItem === 'object' && 'updatedTimestamp' in resultItem)
171
+ {
172
+ resultItemObject.updatedTimestamp = (function(){
173
+ if(resultItem.updatedTimestamp === null)
174
+ {
175
+ return null;
176
+ }
177
+
178
+ if(typeof resultItem.updatedTimestamp !== 'string')
179
+ {
180
+ return new Date(String(resultItem.updatedTimestamp));
181
+ }
182
+
183
+ return new Date(resultItem.updatedTimestamp);
184
+ }());
185
+ }
186
+ else
187
+ {
188
+ resultItemObject.updatedTimestamp = null;
189
+ }
190
+
191
+ return resultItemObject;
192
+ }());
193
+ });
194
+ }());
195
+
196
+ resolve(resolveValue);
197
+ })
198
+ .catch(error => reject(error));
199
+ });
200
+ }
201
+
202
+ /**
203
+ * Create a Comment [POST /packhouse/sites/{siteId}/shift-quality-summaries/{id}/comments]
204
+ *
205
+ * Create a Comment for a Shift Quality Summary
206
+ *
207
+ * @static
208
+ * @public
209
+ * @param {number} siteId The Site ID
210
+ * @param {string} id The Shift Quality Summary ID
211
+ * @param {string} content The Content of the New Comment
212
+ * @return {Promise<ShiftQualitySummaryController.CommentItem>}
213
+ */
214
+ static createComment(siteId, id, content)
215
+ {
216
+ return new Promise((resolve, reject) => {
217
+ RequestHelper.postRequest(`/packhouse/sites/${siteId}/shift-quality-summaries/${id}/comments`, {content})
218
+ .then((result) => {
219
+ let resolveValue = (function(){
220
+ let resultObject = {};
221
+
222
+ if(typeof result === 'object' && 'id' in result)
223
+ {
224
+ resultObject.id = (function(){
225
+ if(typeof result.id !== 'string')
226
+ {
227
+ return String(result.id);
228
+ }
229
+
230
+ return result.id;
231
+ }());
232
+ }
233
+ else
234
+ {
235
+ resultObject.id = "";
236
+ }
237
+
238
+ if(typeof result === 'object' && 'content' in result)
239
+ {
240
+ resultObject.content = (function(){
241
+ if(result.content === null)
242
+ {
243
+ return null;
244
+ }
245
+
246
+ if(typeof result.content !== 'string')
247
+ {
248
+ return String(result.content);
249
+ }
250
+
251
+ return result.content;
252
+ }());
253
+ }
254
+ else
255
+ {
256
+ resultObject.content = null;
257
+ }
258
+
259
+ if(typeof result === 'object' && 'createdTimestamp' in result)
260
+ {
261
+ resultObject.createdTimestamp = (function(){
262
+ if(result.createdTimestamp === null)
263
+ {
264
+ return null;
265
+ }
266
+
267
+ if(typeof result.createdTimestamp !== 'string')
268
+ {
269
+ return new Date(String(result.createdTimestamp));
270
+ }
271
+
272
+ return new Date(result.createdTimestamp);
273
+ }());
274
+ }
275
+ else
276
+ {
277
+ resultObject.createdTimestamp = null;
278
+ }
279
+
280
+ if(typeof result === 'object' && 'updatedTimestamp' in result)
281
+ {
282
+ resultObject.updatedTimestamp = (function(){
283
+ if(result.updatedTimestamp === null)
284
+ {
285
+ return null;
286
+ }
287
+
288
+ if(typeof result.updatedTimestamp !== 'string')
289
+ {
290
+ return new Date(String(result.updatedTimestamp));
291
+ }
292
+
293
+ return new Date(result.updatedTimestamp);
294
+ }());
295
+ }
296
+ else
297
+ {
298
+ resultObject.updatedTimestamp = null;
299
+ }
300
+
301
+ return resultObject;
302
+ }());
303
+
304
+ resolve(resolveValue);
305
+ })
306
+ .catch(error => reject(error));
307
+ });
308
+ }
309
+
310
+ /**
311
+ * Retrieve a Comment [GET /packhouse/sites/{siteId}/shift-quality-summaries/{id}/comments/{commentId}]
312
+ *
313
+ * Retrieves Comments for a Shift Quality Summary
314
+ *
315
+ * @static
316
+ * @public
317
+ * @param {number} siteId The Site ID
318
+ * @param {string} id The Shift Quality Summary ID
319
+ * @param {string} commentId The Comment ID
320
+ * @return {Promise<ShiftQualitySummaryController.CommentItem>}
321
+ */
322
+ static getOneComment(siteId, id, commentId)
323
+ {
324
+ return new Promise((resolve, reject) => {
325
+ RequestHelper.getRequest(`/packhouse/sites/${siteId}/shift-quality-summaries/${id}/comments/${commentId}`)
326
+ .then((result) => {
327
+ let resolveValue = (function(){
328
+ let resultObject = {};
329
+
330
+ if(typeof result === 'object' && 'id' in result)
331
+ {
332
+ resultObject.id = (function(){
333
+ if(typeof result.id !== 'string')
334
+ {
335
+ return String(result.id);
336
+ }
337
+
338
+ return result.id;
339
+ }());
340
+ }
341
+ else
342
+ {
343
+ resultObject.id = "";
344
+ }
345
+
346
+ if(typeof result === 'object' && 'content' in result)
347
+ {
348
+ resultObject.content = (function(){
349
+ if(result.content === null)
350
+ {
351
+ return null;
352
+ }
353
+
354
+ if(typeof result.content !== 'string')
355
+ {
356
+ return String(result.content);
357
+ }
358
+
359
+ return result.content;
360
+ }());
361
+ }
362
+ else
363
+ {
364
+ resultObject.content = null;
365
+ }
366
+
367
+ if(typeof result === 'object' && 'createdTimestamp' in result)
368
+ {
369
+ resultObject.createdTimestamp = (function(){
370
+ if(result.createdTimestamp === null)
371
+ {
372
+ return null;
373
+ }
374
+
375
+ if(typeof result.createdTimestamp !== 'string')
376
+ {
377
+ return new Date(String(result.createdTimestamp));
378
+ }
379
+
380
+ return new Date(result.createdTimestamp);
381
+ }());
382
+ }
383
+ else
384
+ {
385
+ resultObject.createdTimestamp = null;
386
+ }
387
+
388
+ if(typeof result === 'object' && 'updatedTimestamp' in result)
389
+ {
390
+ resultObject.updatedTimestamp = (function(){
391
+ if(result.updatedTimestamp === null)
392
+ {
393
+ return null;
394
+ }
395
+
396
+ if(typeof result.updatedTimestamp !== 'string')
397
+ {
398
+ return new Date(String(result.updatedTimestamp));
399
+ }
400
+
401
+ return new Date(result.updatedTimestamp);
402
+ }());
403
+ }
404
+ else
405
+ {
406
+ resultObject.updatedTimestamp = null;
407
+ }
408
+
409
+ return resultObject;
410
+ }());
411
+
412
+ resolve(resolveValue);
413
+ })
414
+ .catch(error => reject(error));
415
+ });
416
+ }
417
+
418
+ /**
419
+ * Update a Comment [PATCH /packhouse/sites/{siteId}/shift-quality-summaries/{id}/comments/{commentId}]
420
+ *
421
+ * Update a Comment for a Shift Quality Summary
422
+ *
423
+ * @static
424
+ * @public
425
+ * @param {number} siteId The Site ID
426
+ * @param {string} id The Shift Quality Summary ID
427
+ * @param {string} commentId The Comment ID
428
+ * @param {string} content The Updated Content for the Comment
429
+ * @return {Promise<ShiftQualitySummaryController.CommentItem>}
430
+ */
431
+ static updateOneComment(siteId, id, commentId, content)
432
+ {
433
+ return new Promise((resolve, reject) => {
434
+ RequestHelper.patchRequest(`/packhouse/sites/${siteId}/shift-quality-summaries/${id}/comments/${commentId}`, {content})
435
+ .then((result) => {
436
+ let resolveValue = (function(){
437
+ let resultObject = {};
438
+
439
+ if(typeof result === 'object' && 'id' in result)
440
+ {
441
+ resultObject.id = (function(){
442
+ if(typeof result.id !== 'string')
443
+ {
444
+ return String(result.id);
445
+ }
446
+
447
+ return result.id;
448
+ }());
449
+ }
450
+ else
451
+ {
452
+ resultObject.id = "";
453
+ }
454
+
455
+ if(typeof result === 'object' && 'content' in result)
456
+ {
457
+ resultObject.content = (function(){
458
+ if(result.content === null)
459
+ {
460
+ return null;
461
+ }
462
+
463
+ if(typeof result.content !== 'string')
464
+ {
465
+ return String(result.content);
466
+ }
467
+
468
+ return result.content;
469
+ }());
470
+ }
471
+ else
472
+ {
473
+ resultObject.content = null;
474
+ }
475
+
476
+ if(typeof result === 'object' && 'createdTimestamp' in result)
477
+ {
478
+ resultObject.createdTimestamp = (function(){
479
+ if(result.createdTimestamp === null)
480
+ {
481
+ return null;
482
+ }
483
+
484
+ if(typeof result.createdTimestamp !== 'string')
485
+ {
486
+ return new Date(String(result.createdTimestamp));
487
+ }
488
+
489
+ return new Date(result.createdTimestamp);
490
+ }());
491
+ }
492
+ else
493
+ {
494
+ resultObject.createdTimestamp = null;
495
+ }
496
+
497
+ if(typeof result === 'object' && 'updatedTimestamp' in result)
498
+ {
499
+ resultObject.updatedTimestamp = (function(){
500
+ if(result.updatedTimestamp === null)
501
+ {
502
+ return null;
503
+ }
504
+
505
+ if(typeof result.updatedTimestamp !== 'string')
506
+ {
507
+ return new Date(String(result.updatedTimestamp));
508
+ }
509
+
510
+ return new Date(result.updatedTimestamp);
511
+ }());
512
+ }
513
+ else
514
+ {
515
+ resultObject.updatedTimestamp = null;
516
+ }
517
+
518
+ return resultObject;
519
+ }());
520
+
521
+ resolve(resolveValue);
522
+ })
523
+ .catch(error => reject(error));
524
+ });
525
+ }
526
+
527
+ /**
528
+ * Delete a Comment [DELETE /packhouse/sites/{siteId}/shift-quality-summaries/{id}/comments/{commentId}]
529
+ *
530
+ * Delete a Comment for a Shift Quality Summary
531
+ *
532
+ * @static
533
+ * @public
534
+ * @param {number} siteId The Site ID
535
+ * @param {string} id The Shift Quality Summary ID
536
+ * @param {string} commentId The Comment ID
537
+ * @return {Promise<boolean>}
538
+ */
539
+ static deleteOneComment(siteId, id, commentId)
540
+ {
541
+ return new Promise((resolve, reject) => {
542
+ RequestHelper.deleteRequest(`/packhouse/sites/${siteId}/shift-quality-summaries/${id}/comments/${commentId}`)
543
+ .then((result) => {
544
+ resolve(result ?? true);
545
+ })
546
+ .catch(error => reject(error));
547
+ });
548
+ }
549
+
550
+ /**
551
+ * List all Shift Quality Summaries [GET /packhouse/sites/{siteId}/shift-quality-summaries]
552
+ *
553
+ * @static
554
+ * @public
555
+ * @param {number} siteId The Site ID
556
+ * @param {ShiftQualitySummaryController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
557
+ * @return {Promise<ShiftQualitySummaryModel[]>}
558
+ */
559
+ static getAll(siteId, queryParameters = {})
560
+ {
561
+ return new Promise((resolve, reject) => {
562
+ RequestHelper.getRequest(`/packhouse/sites/${siteId}/shift-quality-summaries`, queryParameters)
563
+ .then((result) => {
564
+ let resolveValue = (function(){
565
+ if(Array.isArray(result) !== true)
566
+ {
567
+ return [];
568
+ }
569
+
570
+ return result.map((resultItem) => {
571
+ return (function(){
572
+ return ShiftQualitySummaryModel.fromJSON(resultItem, siteId);
573
+ }());
574
+ });
575
+ }());
576
+
577
+ resolve(resolveValue);
578
+ })
579
+ .catch(error => reject(error));
580
+ });
581
+ }
582
+
583
+ /**
584
+ * Create a Shift Quality Summary [POST /packhouse/sites/{siteId}/shift-quality-summaries]
585
+ *
586
+ * @static
587
+ * @public
588
+ * @param {number} siteId The Site ID
589
+ * @param {ShiftQualitySummaryController.CreateData} createData The Shift Quality Summary Create Data
590
+ * @return {Promise<ShiftQualitySummaryModel>}
591
+ */
592
+ static create(siteId, createData)
593
+ {
594
+ return new Promise((resolve, reject) => {
595
+ RequestHelper.postRequest(`/packhouse/sites/${siteId}/shift-quality-summaries`, createData)
596
+ .then((result) => {
597
+ let resolveValue = (function(){
598
+ return ShiftQualitySummaryModel.fromJSON(result, siteId);
599
+ }());
600
+
601
+ resolve(resolveValue);
602
+ })
603
+ .catch(error => reject(error));
604
+ });
605
+ }
606
+ }
607
+
608
+ export default ShiftQualitySummaryController;
609
+
610
+ /**
611
+ * The Optional Query Parameters for the getAll Function
612
+ *
613
+ * @typedef {Object} ShiftQualitySummaryController.GetAllQueryParameters
614
+ * @property {string} [packingLineId] The Packing Line ID this Quality Summary is associated with
615
+ * @property {string} [shiftId] The Shift ID this Quality Summary is asssociated with
616
+ * @property {?string} [qualityManagerUserId] The User ID of the Quality Manager for this Summary
617
+ * @property {string} [qualityManagerName] The Name of the Quality Manager for this Summary
618
+ * @property {Date} [createdTimestampBegin] Filter by the Timestamp when Quality Summaries were Created. Results Greater than or Equal to Timestamp
619
+ * @property {Date} [createdTimestampEnd] Filter by the Timestamp when Quality Summaries were Created. Results Less than or Equal to Timestamp
620
+ * @property {Date} [updateTimestampBegin] Filter by the Timestamp when Quality Summaries were last Updated. Results Greater than or Equal to Timestamp
621
+ * @property {Date} [updateTimestampEnd] Filter by the Timestamp when Quality Summaries were last Updated. Results Less than or Equal to Timestamp
622
+ * @memberof Controllers.Packhouse.Site
623
+ */
624
+
625
+ /**
626
+ * The Create Data for a Shift Quality Summary
627
+ *
628
+ * @typedef {Object} ShiftQualitySummaryController.CreateData
629
+ * @property {string} packingLineId The Packing Line ID this Quality Summary is associated with
630
+ * @property {string} [shiftId] The Shift ID this Quality Summary is asssociated with
631
+ * @property {Date} [createdTimestamp] When this Quality Summary was Created
632
+ * @property {?Date} [publishTimestamp] When this Quality Summary was Published
633
+ * @property {?string} [qualityManagerUserId] The User ID of the Quality Manager for this Summary
634
+ * @property {string} qualityManagerName The Name of the Quality Manager for this Summary
635
+ * @property {Array<ShiftQualitySummaryController.AccuracyResult>} [accuracyResults] An Array of Accuracy Results for this Summary
636
+ * @property {Array<ShiftQualitySummaryController.AuditResult>} [auditResults] An Array of Audit Results for this Summary
637
+ * @property {Array<ShiftQualitySummaryController.PackrunResult>} [packrunResults] An Array of Packrun Results for this Summary
638
+ * @property {?number} [satisfactionRating] An Optional Rating between 1 and 10 on how Satisfied the Quality Manager was with this Shift
639
+ * @memberof Controllers.Packhouse.Site
640
+ */
641
+
642
+ /**
643
+ * The Update Data for a Shift Quality Summary
644
+ *
645
+ * @typedef {Object} ShiftQualitySummaryController.UpdateData
646
+ * @property {string} [packingLineId] The Packing Line ID this Quality Summary is associated with
647
+ * @property {Date} [createdTimestamp] When this Quality Summary was Created
648
+ * @property {?Date} [publishTimestamp] When this Quality Summary was Published
649
+ * @property {?string} [qualityManagerUserId] The User ID of the Quality Manager for this Summary
650
+ * @property {string} [qualityManagerName] The Name of the Quality Manager for this Summary
651
+ * @property {Array<ShiftQualitySummaryController.AccuracyResult>} [accuracyResults] An Array of Accuracy Results for this Summary
652
+ * @property {Array<ShiftQualitySummaryController.AuditResult>} [auditResults] An Array of Audit Results for this Summary
653
+ * @property {Array<ShiftQualitySummaryController.PackrunResult>} [packrunResults] An Array of Packrun Results for this Summary
654
+ * @property {?number} [satisfactionRating] An Optional Rating between 1 and 10 on how Satisfied the Quality Manager was with this Shift
655
+ * @memberof Controllers.Packhouse.Site
656
+ */
657
+
658
+ /**
659
+ * A **CommentItem** Type
660
+ *
661
+ * @typedef {Object} ShiftQualitySummaryController.CommentItem
662
+ * @property {string} id The Comment ID
663
+ * @property {?string} content The Content of the Comment
664
+ * @property {?Date} createdTimestamp When the Comment was Created
665
+ * @property {?Date} updatedTimestamp When the Comment was last Updated
666
+ * @memberof Controllers.Packhouse.Site
667
+ */
668
+
669
+ /**
670
+ * A **AccuracyResult** Type
671
+ *
672
+ * @typedef {Object} ShiftQualitySummaryController.AccuracyResult
673
+ * @property {string} type The Accuracy Type
674
+ * @property {number} value The Accuracy Result Value
675
+ * @memberof Controllers.Packhouse.Site
676
+ */
677
+
678
+ /**
679
+ * A **AuditResult** Type
680
+ *
681
+ * @typedef {Object} ShiftQualitySummaryController.AuditResult
682
+ * @property {string} type The Audit Type
683
+ * @property {number} value The Audit Result Value
684
+ * @memberof Controllers.Packhouse.Site
685
+ */
686
+
687
+ /**
688
+ * A **PackrunResult** Type
689
+ *
690
+ * @typedef {Object} ShiftQualitySummaryController.PackrunResult
691
+ * @property {string} packrunId The ID of the associated Packrun
692
+ * @property {string} packrunName The Name of the associated Packrun
693
+ * @property {number} minorPackingDefects The R600 Minor Defects Percentage
694
+ * @property {number} majorPackingDefects The R600 Major Defects Percentage
695
+ * @property {number} softs The R600 Softs Percentage
696
+ * @property {number} cuts The R600 Cuts (e.g. Flesh Damage) Percentage
697
+ * @property {number} rots The R600 Rots Percentage
698
+ * @property {?number} softsLineAverageSampleSize The Softs Line Average Sample Size
699
+ * @property {?number} softsLineAverageValue The Softs Line Average Value
700
+ * @property {?number} exportFruitInClass2 The Percentage of Export (Class 1) Fruit found in Class 2
701
+ * @property {?number} exportFruitInLocalMarket The Percentage of Export (Class 1) Fruit found in Local Market
702
+ * @property {?number} exportFruitInWaste The Percentage of Export (Class 1) Fruit found in Waste
703
+ * @memberof Controllers.Packhouse.Site
704
+ */