@ricado/api-client 2.1.1 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ricado.api.client.js +1 -1
- package/lib/Controllers/Packhouse/Site/BinTipBinController.js +622 -0
- package/lib/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
- package/lib/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +657 -0
- package/lib/Controllers/Packhouse/Site/PackingLineController.js +29 -1
- package/lib/Controllers/Packhouse/Site/PackrunController.js +42 -0
- package/lib/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/lib/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +661 -0
- package/lib/Controllers/Packhouse/Site/ShiftTaskController.js +628 -0
- package/lib/Controllers/Packhouse/Site/index.js +12 -0
- package/lib/DataItems/PointValueItem.js +3 -3
- package/lib/Models/AccountPolicyModel.js +7 -7
- package/lib/Models/ApiAccountModel.js +7 -7
- package/lib/Models/CompanyModel.js +5 -5
- package/lib/Models/FirebaseTokenModel.js +8 -8
- package/lib/Models/Packhouse/Site/BinTipBinModel.js +367 -0
- package/lib/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/lib/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +15 -15
- package/lib/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/lib/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/lib/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/lib/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/lib/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
- package/lib/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/lib/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/lib/Models/Packhouse/Site/PackingLineModel.js +583 -16
- package/lib/Models/Packhouse/Site/PackrunModel.js +81 -15
- package/lib/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/lib/Models/Packhouse/Site/RejectBinScaleModel.js +23 -23
- package/lib/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/lib/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +204 -38
- package/lib/Models/Packhouse/Site/ShiftModel.js +26 -19
- package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
- package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
- package/lib/Models/Packhouse/Site/SoftSortBeltModel.js +7 -7
- package/lib/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/lib/Models/Packhouse/Site/index.js +12 -0
- package/lib/Models/RTUModel.js +6 -6
- package/lib/Models/RTUPluginModel.js +5 -5
- package/lib/Models/Site/AlarmGroupModel.js +7 -7
- package/lib/Models/Site/AlarmModel.js +17 -17
- package/lib/Models/Site/DefinitionModel.js +6 -6
- package/lib/Models/Site/PermanentObjectDataModel.js +8 -8
- package/lib/Models/Site/PermanentObjectModel.js +7 -7
- package/lib/Models/Site/PointModel.js +11 -11
- package/lib/Models/Site/TemporaryObjectModel.js +6 -6
- package/lib/Models/SiteModel.js +6 -6
- package/lib/Models/TokenModel.js +10 -10
- package/lib/Models/UserAccountActionTokenModel.js +11 -11
- package/lib/Models/UserAccountModel.js +10 -10
- package/lib/PackageVersion.js +1 -1
- package/lib/Points.js +22 -12
- package/lib/WebSocketHelper.js +29 -13
- package/lib/index.d.ts +2473 -348
- package/lib/index.js +3 -3
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/BinTipBinController.js +665 -0
- package/src/Controllers/Packhouse/Site/CompacSizerController.js +3 -3
- package/src/Controllers/Packhouse/Site/FreshQualityPackrunSummaryController.js +700 -0
- package/src/Controllers/Packhouse/Site/PackingLineController.js +29 -1
- package/src/Controllers/Packhouse/Site/PackrunController.js +52 -0
- package/src/Controllers/Packhouse/Site/ShiftHourlyEntryController.js +15 -0
- package/src/Controllers/Packhouse/Site/ShiftQualitySummaryController.js +704 -0
- package/src/Controllers/Packhouse/Site/ShiftTaskController.js +671 -0
- package/src/Controllers/Packhouse/Site/index.js +8 -0
- package/src/DataItems/PointValueItem.js +3 -3
- package/src/Models/AccountPolicyModel.js +7 -7
- package/src/Models/ApiAccountModel.js +7 -7
- package/src/Models/CompanyModel.js +5 -5
- package/src/Models/FirebaseTokenModel.js +8 -8
- package/src/Models/Packhouse/Site/BinTipBinModel.js +365 -0
- package/src/Models/Packhouse/Site/BinTipWeightModel.js +9 -9
- package/src/Models/Packhouse/Site/CompacSizerBatchModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerModel.js +15 -15
- package/src/Models/Packhouse/Site/CompacSizerOutletProductChangeModel.js +10 -10
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeChangeModel.js +8 -8
- package/src/Models/Packhouse/Site/CompacSizerOutletTypeModel.js +6 -6
- package/src/Models/Packhouse/Site/CompacSizerPackrunSummaryModel.js +12 -12
- package/src/Models/Packhouse/Site/DowntimeEventModel.js +14 -14
- package/src/Models/Packhouse/Site/FreshPackPackrunSummaryModel.js +8 -8
- package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
- package/src/Models/Packhouse/Site/GrowingMethodModel.js +6 -6
- package/src/Models/Packhouse/Site/PackTypeModel.js +8 -8
- package/src/Models/Packhouse/Site/PackingLineModel.js +770 -16
- package/src/Models/Packhouse/Site/PackrunModel.js +90 -15
- package/src/Models/Packhouse/Site/RejectBinModel.js +9 -9
- package/src/Models/Packhouse/Site/RejectBinScaleModel.js +23 -23
- package/src/Models/Packhouse/Site/RejectBinWeightModel.js +10 -10
- package/src/Models/Packhouse/Site/ShiftFocusMeetingModel.js +12 -12
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +229 -38
- package/src/Models/Packhouse/Site/ShiftModel.js +29 -19
- package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
- package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
- package/src/Models/Packhouse/Site/SoftSortBeltModel.js +7 -7
- package/src/Models/Packhouse/Site/VarietyModel.js +8 -8
- package/src/Models/Packhouse/Site/index.js +8 -0
- package/src/Models/RTUModel.js +6 -6
- package/src/Models/RTUPluginModel.js +5 -5
- package/src/Models/Site/AlarmGroupModel.js +7 -7
- package/src/Models/Site/AlarmModel.js +17 -17
- package/src/Models/Site/DefinitionModel.js +6 -6
- package/src/Models/Site/PermanentObjectDataModel.js +8 -8
- package/src/Models/Site/PermanentObjectModel.js +7 -7
- package/src/Models/Site/PointModel.js +11 -11
- package/src/Models/Site/TemporaryObjectModel.js +6 -6
- package/src/Models/SiteModel.js +6 -6
- package/src/Models/TokenModel.js +10 -10
- package/src/Models/UserAccountActionTokenModel.js +11 -11
- package/src/Models/UserAccountModel.js +10 -10
- package/src/PackageVersion.js +1 -1
- package/src/Points.js +24 -12
- package/src/WebSocketHelper.js +34 -13
- package/src/index.js +3 -3
- package/types/tslint.json +2 -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
|
+
*/
|