@ricado/api-client 2.1.1 → 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.
- 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 +25 -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/Models/Packhouse/Site/BinTipBinModel.js +367 -0
- package/lib/Models/Packhouse/Site/CompacSizerModel.js +1 -1
- package/lib/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +481 -0
- package/lib/Models/Packhouse/Site/PackingLineModel.js +524 -1
- package/lib/Models/Packhouse/Site/PackrunModel.js +66 -0
- package/lib/Models/Packhouse/Site/ShiftHourlyEntryModel.js +167 -1
- package/lib/Models/Packhouse/Site/ShiftQualitySummaryModel.js +599 -0
- package/lib/Models/Packhouse/Site/ShiftTaskModel.js +373 -0
- package/lib/Models/Packhouse/Site/index.js +12 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +2241 -146
- 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 +25 -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/Models/Packhouse/Site/BinTipBinModel.js +365 -0
- package/src/Models/Packhouse/Site/CompacSizerModel.js +1 -1
- package/src/Models/Packhouse/Site/FreshQualityPackrunSummaryModel.js +523 -0
- package/src/Models/Packhouse/Site/PackingLineModel.js +705 -1
- package/src/Models/Packhouse/Site/PackrunModel.js +75 -0
- package/src/Models/Packhouse/Site/ShiftHourlyEntryModel.js +192 -1
- package/src/Models/Packhouse/Site/ShiftQualitySummaryModel.js +664 -0
- package/src/Models/Packhouse/Site/ShiftTaskModel.js +369 -0
- package/src/Models/Packhouse/Site/index.js +8 -0
- package/src/PackageVersion.js +1 -1
|
@@ -0,0 +1,628 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _RequestHelper = _interopRequireDefault(require("../../../RequestHelper"));
|
|
9
|
+
|
|
10
|
+
var _ShiftTaskModel = _interopRequireDefault(require("../../../Models/Packhouse/Site/ShiftTaskModel"));
|
|
11
|
+
|
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
+
|
|
14
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
|
+
|
|
16
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
+
|
|
18
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
19
|
+
|
|
20
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Controller Class for Shift Tasks
|
|
24
|
+
*
|
|
25
|
+
* @class
|
|
26
|
+
*/
|
|
27
|
+
var ShiftTaskController = /*#__PURE__*/function () {
|
|
28
|
+
function ShiftTaskController() {
|
|
29
|
+
_classCallCheck(this, ShiftTaskController);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_createClass(ShiftTaskController, null, [{
|
|
33
|
+
key: "getOne",
|
|
34
|
+
value:
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve a Shift Task [GET /packhouse/sites/{siteId}/shift-tasks/{id}]
|
|
37
|
+
*
|
|
38
|
+
* @static
|
|
39
|
+
* @public
|
|
40
|
+
* @param {number} siteId The Site ID
|
|
41
|
+
* @param {string} id The Shift Task ID
|
|
42
|
+
* @return {Promise<ShiftTaskModel>}
|
|
43
|
+
*/
|
|
44
|
+
function getOne(siteId, id) {
|
|
45
|
+
return new Promise(function (resolve, reject) {
|
|
46
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/shift-tasks/").concat(id)).then(function (result) {
|
|
47
|
+
var resolveValue = function () {
|
|
48
|
+
return _ShiftTaskModel.default.fromJSON(result, siteId);
|
|
49
|
+
}();
|
|
50
|
+
|
|
51
|
+
resolve(resolveValue);
|
|
52
|
+
}).catch(function (error) {
|
|
53
|
+
return reject(error);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Update a Shift Task [PATCH /packhouse/sites/{siteId}/shift-tasks/{id}]
|
|
59
|
+
*
|
|
60
|
+
* @static
|
|
61
|
+
* @public
|
|
62
|
+
* @param {number} siteId The Site ID
|
|
63
|
+
* @param {string} id The Shift Task ID
|
|
64
|
+
* @param {ShiftTaskController.UpdateData} updateData The Shift Task Update Data
|
|
65
|
+
* @return {Promise<ShiftTaskModel>}
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
}, {
|
|
69
|
+
key: "update",
|
|
70
|
+
value: function update(siteId, id, updateData) {
|
|
71
|
+
return new Promise(function (resolve, reject) {
|
|
72
|
+
_RequestHelper.default.patchRequest("/packhouse/sites/".concat(siteId, "/shift-tasks/").concat(id), updateData).then(function (result) {
|
|
73
|
+
var resolveValue = function () {
|
|
74
|
+
return _ShiftTaskModel.default.fromJSON(result, siteId);
|
|
75
|
+
}();
|
|
76
|
+
|
|
77
|
+
resolve(resolveValue);
|
|
78
|
+
}).catch(function (error) {
|
|
79
|
+
return reject(error);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Delete a Shift Task [DELETE /packhouse/sites/{siteId}/shift-tasks/{id}]
|
|
85
|
+
*
|
|
86
|
+
* @static
|
|
87
|
+
* @public
|
|
88
|
+
* @param {number} siteId The Site ID
|
|
89
|
+
* @param {string} id The Shift Task ID
|
|
90
|
+
* @return {Promise<boolean>}
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
}, {
|
|
94
|
+
key: "delete",
|
|
95
|
+
value: function _delete(siteId, id) {
|
|
96
|
+
return new Promise(function (resolve, reject) {
|
|
97
|
+
_RequestHelper.default.deleteRequest("/packhouse/sites/".concat(siteId, "/shift-tasks/").concat(id)).then(function (result) {
|
|
98
|
+
resolve(result !== null && result !== void 0 ? result : true);
|
|
99
|
+
}).catch(function (error) {
|
|
100
|
+
return reject(error);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Retrieve Comments [GET /packhouse/sites/{siteId}/shift-tasks/{id}/comments]
|
|
106
|
+
*
|
|
107
|
+
* Retrieves Comments for a Shift Task
|
|
108
|
+
*
|
|
109
|
+
* @static
|
|
110
|
+
* @public
|
|
111
|
+
* @param {number} siteId The Site ID
|
|
112
|
+
* @param {string} id The Shift Task ID
|
|
113
|
+
* @return {Promise<Array<ShiftTaskController.CommentItem>>}
|
|
114
|
+
*/
|
|
115
|
+
|
|
116
|
+
}, {
|
|
117
|
+
key: "getComments",
|
|
118
|
+
value: function getComments(siteId, id) {
|
|
119
|
+
return new Promise(function (resolve, reject) {
|
|
120
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/shift-tasks/").concat(id, "/comments")).then(function (result) {
|
|
121
|
+
var resolveValue = function () {
|
|
122
|
+
if (Array.isArray(result) !== true) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return result.map(function (resultItem) {
|
|
127
|
+
return function () {
|
|
128
|
+
var resultItemObject = {};
|
|
129
|
+
|
|
130
|
+
if (_typeof(resultItem) === 'object' && 'id' in resultItem) {
|
|
131
|
+
resultItemObject.id = function () {
|
|
132
|
+
if (typeof resultItem.id !== 'string') {
|
|
133
|
+
return String(resultItem.id);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return resultItem.id;
|
|
137
|
+
}();
|
|
138
|
+
} else {
|
|
139
|
+
resultItemObject.id = "";
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
if (_typeof(resultItem) === 'object' && 'content' in resultItem) {
|
|
143
|
+
resultItemObject.content = function () {
|
|
144
|
+
if (resultItem.content === null) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
if (typeof resultItem.content !== 'string') {
|
|
149
|
+
return String(resultItem.content);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return resultItem.content;
|
|
153
|
+
}();
|
|
154
|
+
} else {
|
|
155
|
+
resultItemObject.content = null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (_typeof(resultItem) === 'object' && 'createdTimestamp' in resultItem) {
|
|
159
|
+
resultItemObject.createdTimestamp = function () {
|
|
160
|
+
if (resultItem.createdTimestamp === null) {
|
|
161
|
+
return null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (typeof resultItem.createdTimestamp !== 'string') {
|
|
165
|
+
return new Date(String(resultItem.createdTimestamp));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return new Date(resultItem.createdTimestamp);
|
|
169
|
+
}();
|
|
170
|
+
} else {
|
|
171
|
+
resultItemObject.createdTimestamp = null;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
if (_typeof(resultItem) === 'object' && 'updatedTimestamp' in resultItem) {
|
|
175
|
+
resultItemObject.updatedTimestamp = function () {
|
|
176
|
+
if (resultItem.updatedTimestamp === null) {
|
|
177
|
+
return null;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
if (typeof resultItem.updatedTimestamp !== 'string') {
|
|
181
|
+
return new Date(String(resultItem.updatedTimestamp));
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return new Date(resultItem.updatedTimestamp);
|
|
185
|
+
}();
|
|
186
|
+
} else {
|
|
187
|
+
resultItemObject.updatedTimestamp = null;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
return resultItemObject;
|
|
191
|
+
}();
|
|
192
|
+
});
|
|
193
|
+
}();
|
|
194
|
+
|
|
195
|
+
resolve(resolveValue);
|
|
196
|
+
}).catch(function (error) {
|
|
197
|
+
return reject(error);
|
|
198
|
+
});
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Create a Comment [POST /packhouse/sites/{siteId}/shift-tasks/{id}/comments]
|
|
203
|
+
*
|
|
204
|
+
* Create a Comment for a Shift Task
|
|
205
|
+
*
|
|
206
|
+
* @static
|
|
207
|
+
* @public
|
|
208
|
+
* @param {number} siteId The Site ID
|
|
209
|
+
* @param {string} id The Shift Task ID
|
|
210
|
+
* @param {string} content The Content of the New Comment
|
|
211
|
+
* @return {Promise<ShiftTaskController.CommentItem>}
|
|
212
|
+
*/
|
|
213
|
+
|
|
214
|
+
}, {
|
|
215
|
+
key: "createComment",
|
|
216
|
+
value: function createComment(siteId, id, content) {
|
|
217
|
+
return new Promise(function (resolve, reject) {
|
|
218
|
+
_RequestHelper.default.postRequest("/packhouse/sites/".concat(siteId, "/shift-tasks/").concat(id, "/comments"), {
|
|
219
|
+
content: content
|
|
220
|
+
}).then(function (result) {
|
|
221
|
+
var resolveValue = function () {
|
|
222
|
+
var resultObject = {};
|
|
223
|
+
|
|
224
|
+
if (_typeof(result) === 'object' && 'id' in result) {
|
|
225
|
+
resultObject.id = function () {
|
|
226
|
+
if (typeof result.id !== 'string') {
|
|
227
|
+
return String(result.id);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
return result.id;
|
|
231
|
+
}();
|
|
232
|
+
} else {
|
|
233
|
+
resultObject.id = "";
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
if (_typeof(result) === 'object' && 'content' in result) {
|
|
237
|
+
resultObject.content = function () {
|
|
238
|
+
if (result.content === null) {
|
|
239
|
+
return null;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if (typeof result.content !== 'string') {
|
|
243
|
+
return String(result.content);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return result.content;
|
|
247
|
+
}();
|
|
248
|
+
} else {
|
|
249
|
+
resultObject.content = null;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
if (_typeof(result) === 'object' && 'createdTimestamp' in result) {
|
|
253
|
+
resultObject.createdTimestamp = function () {
|
|
254
|
+
if (result.createdTimestamp === null) {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (typeof result.createdTimestamp !== 'string') {
|
|
259
|
+
return new Date(String(result.createdTimestamp));
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return new Date(result.createdTimestamp);
|
|
263
|
+
}();
|
|
264
|
+
} else {
|
|
265
|
+
resultObject.createdTimestamp = null;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
if (_typeof(result) === 'object' && 'updatedTimestamp' in result) {
|
|
269
|
+
resultObject.updatedTimestamp = function () {
|
|
270
|
+
if (result.updatedTimestamp === null) {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
if (typeof result.updatedTimestamp !== 'string') {
|
|
275
|
+
return new Date(String(result.updatedTimestamp));
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return new Date(result.updatedTimestamp);
|
|
279
|
+
}();
|
|
280
|
+
} else {
|
|
281
|
+
resultObject.updatedTimestamp = null;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
return resultObject;
|
|
285
|
+
}();
|
|
286
|
+
|
|
287
|
+
resolve(resolveValue);
|
|
288
|
+
}).catch(function (error) {
|
|
289
|
+
return reject(error);
|
|
290
|
+
});
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Retrieve a Comment [GET /packhouse/sites/{siteId}/shift-tasks/{id}/comments/{commentId}]
|
|
295
|
+
*
|
|
296
|
+
* Retrieves Comments for a Shift Task
|
|
297
|
+
*
|
|
298
|
+
* @static
|
|
299
|
+
* @public
|
|
300
|
+
* @param {number} siteId The Site ID
|
|
301
|
+
* @param {string} id The Shift Task ID
|
|
302
|
+
* @param {string} commentId The Comment ID
|
|
303
|
+
* @return {Promise<ShiftTaskController.CommentItem>}
|
|
304
|
+
*/
|
|
305
|
+
|
|
306
|
+
}, {
|
|
307
|
+
key: "getOneComment",
|
|
308
|
+
value: function getOneComment(siteId, id, commentId) {
|
|
309
|
+
return new Promise(function (resolve, reject) {
|
|
310
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/shift-tasks/").concat(id, "/comments/").concat(commentId)).then(function (result) {
|
|
311
|
+
var resolveValue = function () {
|
|
312
|
+
var resultObject = {};
|
|
313
|
+
|
|
314
|
+
if (_typeof(result) === 'object' && 'id' in result) {
|
|
315
|
+
resultObject.id = function () {
|
|
316
|
+
if (typeof result.id !== 'string') {
|
|
317
|
+
return String(result.id);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
return result.id;
|
|
321
|
+
}();
|
|
322
|
+
} else {
|
|
323
|
+
resultObject.id = "";
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
if (_typeof(result) === 'object' && 'content' in result) {
|
|
327
|
+
resultObject.content = function () {
|
|
328
|
+
if (result.content === null) {
|
|
329
|
+
return null;
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
if (typeof result.content !== 'string') {
|
|
333
|
+
return String(result.content);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return result.content;
|
|
337
|
+
}();
|
|
338
|
+
} else {
|
|
339
|
+
resultObject.content = null;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
if (_typeof(result) === 'object' && 'createdTimestamp' in result) {
|
|
343
|
+
resultObject.createdTimestamp = function () {
|
|
344
|
+
if (result.createdTimestamp === null) {
|
|
345
|
+
return null;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
if (typeof result.createdTimestamp !== 'string') {
|
|
349
|
+
return new Date(String(result.createdTimestamp));
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
return new Date(result.createdTimestamp);
|
|
353
|
+
}();
|
|
354
|
+
} else {
|
|
355
|
+
resultObject.createdTimestamp = null;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (_typeof(result) === 'object' && 'updatedTimestamp' in result) {
|
|
359
|
+
resultObject.updatedTimestamp = function () {
|
|
360
|
+
if (result.updatedTimestamp === null) {
|
|
361
|
+
return null;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
if (typeof result.updatedTimestamp !== 'string') {
|
|
365
|
+
return new Date(String(result.updatedTimestamp));
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
return new Date(result.updatedTimestamp);
|
|
369
|
+
}();
|
|
370
|
+
} else {
|
|
371
|
+
resultObject.updatedTimestamp = null;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
return resultObject;
|
|
375
|
+
}();
|
|
376
|
+
|
|
377
|
+
resolve(resolveValue);
|
|
378
|
+
}).catch(function (error) {
|
|
379
|
+
return reject(error);
|
|
380
|
+
});
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Update a Comment [PATCH /packhouse/sites/{siteId}/shift-tasks/{id}/comments/{commentId}]
|
|
385
|
+
*
|
|
386
|
+
* Update a Comment for a Shift Task
|
|
387
|
+
*
|
|
388
|
+
* @static
|
|
389
|
+
* @public
|
|
390
|
+
* @param {number} siteId The Site ID
|
|
391
|
+
* @param {string} id The Shift Task ID
|
|
392
|
+
* @param {string} commentId The Comment ID
|
|
393
|
+
* @param {string} content The Updated Content for the Comment
|
|
394
|
+
* @return {Promise<ShiftTaskController.CommentItem>}
|
|
395
|
+
*/
|
|
396
|
+
|
|
397
|
+
}, {
|
|
398
|
+
key: "updateOneComment",
|
|
399
|
+
value: function updateOneComment(siteId, id, commentId, content) {
|
|
400
|
+
return new Promise(function (resolve, reject) {
|
|
401
|
+
_RequestHelper.default.patchRequest("/packhouse/sites/".concat(siteId, "/shift-tasks/").concat(id, "/comments/").concat(commentId), {
|
|
402
|
+
content: content
|
|
403
|
+
}).then(function (result) {
|
|
404
|
+
var resolveValue = function () {
|
|
405
|
+
var resultObject = {};
|
|
406
|
+
|
|
407
|
+
if (_typeof(result) === 'object' && 'id' in result) {
|
|
408
|
+
resultObject.id = function () {
|
|
409
|
+
if (typeof result.id !== 'string') {
|
|
410
|
+
return String(result.id);
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
return result.id;
|
|
414
|
+
}();
|
|
415
|
+
} else {
|
|
416
|
+
resultObject.id = "";
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
if (_typeof(result) === 'object' && 'content' in result) {
|
|
420
|
+
resultObject.content = function () {
|
|
421
|
+
if (result.content === null) {
|
|
422
|
+
return null;
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
if (typeof result.content !== 'string') {
|
|
426
|
+
return String(result.content);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
return result.content;
|
|
430
|
+
}();
|
|
431
|
+
} else {
|
|
432
|
+
resultObject.content = null;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
if (_typeof(result) === 'object' && 'createdTimestamp' in result) {
|
|
436
|
+
resultObject.createdTimestamp = function () {
|
|
437
|
+
if (result.createdTimestamp === null) {
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
if (typeof result.createdTimestamp !== 'string') {
|
|
442
|
+
return new Date(String(result.createdTimestamp));
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
return new Date(result.createdTimestamp);
|
|
446
|
+
}();
|
|
447
|
+
} else {
|
|
448
|
+
resultObject.createdTimestamp = null;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (_typeof(result) === 'object' && 'updatedTimestamp' in result) {
|
|
452
|
+
resultObject.updatedTimestamp = function () {
|
|
453
|
+
if (result.updatedTimestamp === null) {
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
if (typeof result.updatedTimestamp !== 'string') {
|
|
458
|
+
return new Date(String(result.updatedTimestamp));
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
return new Date(result.updatedTimestamp);
|
|
462
|
+
}();
|
|
463
|
+
} else {
|
|
464
|
+
resultObject.updatedTimestamp = null;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
return resultObject;
|
|
468
|
+
}();
|
|
469
|
+
|
|
470
|
+
resolve(resolveValue);
|
|
471
|
+
}).catch(function (error) {
|
|
472
|
+
return reject(error);
|
|
473
|
+
});
|
|
474
|
+
});
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Delete a Comment [DELETE /packhouse/sites/{siteId}/shift-tasks/{id}/comments/{commentId}]
|
|
478
|
+
*
|
|
479
|
+
* Delete a Comment for a Shift Task
|
|
480
|
+
*
|
|
481
|
+
* @static
|
|
482
|
+
* @public
|
|
483
|
+
* @param {number} siteId The Site ID
|
|
484
|
+
* @param {string} id The Shift Task ID
|
|
485
|
+
* @param {string} commentId The Comment ID
|
|
486
|
+
* @return {Promise<boolean>}
|
|
487
|
+
*/
|
|
488
|
+
|
|
489
|
+
}, {
|
|
490
|
+
key: "deleteOneComment",
|
|
491
|
+
value: function deleteOneComment(siteId, id, commentId) {
|
|
492
|
+
return new Promise(function (resolve, reject) {
|
|
493
|
+
_RequestHelper.default.deleteRequest("/packhouse/sites/".concat(siteId, "/shift-tasks/").concat(id, "/comments/").concat(commentId)).then(function (result) {
|
|
494
|
+
resolve(result !== null && result !== void 0 ? result : true);
|
|
495
|
+
}).catch(function (error) {
|
|
496
|
+
return reject(error);
|
|
497
|
+
});
|
|
498
|
+
});
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* List all Shift Tasks [GET /packhouse/sites/{siteId}/shift-tasks]
|
|
502
|
+
*
|
|
503
|
+
* @static
|
|
504
|
+
* @public
|
|
505
|
+
* @param {number} siteId The Site ID
|
|
506
|
+
* @param {ShiftTaskController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
|
|
507
|
+
* @return {Promise<ShiftTaskModel[]>}
|
|
508
|
+
*/
|
|
509
|
+
|
|
510
|
+
}, {
|
|
511
|
+
key: "getAll",
|
|
512
|
+
value: function getAll(siteId) {
|
|
513
|
+
var queryParameters = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
514
|
+
return new Promise(function (resolve, reject) {
|
|
515
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/shift-tasks"), queryParameters).then(function (result) {
|
|
516
|
+
var resolveValue = function () {
|
|
517
|
+
if (Array.isArray(result) !== true) {
|
|
518
|
+
return [];
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
return result.map(function (resultItem) {
|
|
522
|
+
return function () {
|
|
523
|
+
return _ShiftTaskModel.default.fromJSON(resultItem, siteId);
|
|
524
|
+
}();
|
|
525
|
+
});
|
|
526
|
+
}();
|
|
527
|
+
|
|
528
|
+
resolve(resolveValue);
|
|
529
|
+
}).catch(function (error) {
|
|
530
|
+
return reject(error);
|
|
531
|
+
});
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Create a Shift Task [POST /packhouse/sites/{siteId}/shift-tasks]
|
|
536
|
+
*
|
|
537
|
+
* @static
|
|
538
|
+
* @public
|
|
539
|
+
* @param {number} siteId The Site ID
|
|
540
|
+
* @param {ShiftTaskController.CreateData} createData The Shift Task Create Data
|
|
541
|
+
* @return {Promise<ShiftTaskModel>}
|
|
542
|
+
*/
|
|
543
|
+
|
|
544
|
+
}, {
|
|
545
|
+
key: "create",
|
|
546
|
+
value: function create(siteId, createData) {
|
|
547
|
+
return new Promise(function (resolve, reject) {
|
|
548
|
+
_RequestHelper.default.postRequest("/packhouse/sites/".concat(siteId, "/shift-tasks"), createData).then(function (result) {
|
|
549
|
+
var resolveValue = function () {
|
|
550
|
+
return _ShiftTaskModel.default.fromJSON(result, siteId);
|
|
551
|
+
}();
|
|
552
|
+
|
|
553
|
+
resolve(resolveValue);
|
|
554
|
+
}).catch(function (error) {
|
|
555
|
+
return reject(error);
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}]);
|
|
560
|
+
|
|
561
|
+
return ShiftTaskController;
|
|
562
|
+
}();
|
|
563
|
+
|
|
564
|
+
var _default = ShiftTaskController;
|
|
565
|
+
/**
|
|
566
|
+
* The Optional Query Parameters for the getAll Function
|
|
567
|
+
*
|
|
568
|
+
* @typedef {Object} ShiftTaskController.GetAllQueryParameters
|
|
569
|
+
* @property {string} [packingLineId] The Packing Line ID this Task is associated with
|
|
570
|
+
* @property {string} [shiftId] The Shift ID this Task is asssociated with
|
|
571
|
+
* @property {?string} [authorUserId] The User ID of the Author for this Task
|
|
572
|
+
* @property {string} [authorName] The Name of the Author for this Task
|
|
573
|
+
* @property {string} [type] The Task Type
|
|
574
|
+
* @property {string[]} [tags] An Array of Tag IDs for this Task
|
|
575
|
+
* @property {Date} [createdTimestampBegin] Filter by the Timestamp when Tasks were Created. Results Greater than or Equal to Timestamp
|
|
576
|
+
* @property {Date} [createdTimestampEnd] Filter by the Timestamp when Tasks were Created. Results Less than or Equal to Timestamp
|
|
577
|
+
* @property {Date} [completedTimestampBegin] Filter by the Timestamp when Tasks were Completed. Results Greater than or Equal to Timestamp
|
|
578
|
+
* @property {Date} [completedTimestampEnd] Filter by the Timestamp when Tasks were Completed. Results Less than or Equal to Timestamp
|
|
579
|
+
* @property {Date} [updateTimestampBegin] Filter by the Timestamp when Tasks were last Updated. Results Greater than or Equal to Timestamp
|
|
580
|
+
* @property {Date} [updateTimestampEnd] Filter by the Timestamp when Tasks were last Updated. Results Less than or Equal to Timestamp
|
|
581
|
+
* @memberof Controllers.Packhouse.Site
|
|
582
|
+
*/
|
|
583
|
+
|
|
584
|
+
/**
|
|
585
|
+
* The Create Data for a Shift Task
|
|
586
|
+
*
|
|
587
|
+
* @typedef {Object} ShiftTaskController.CreateData
|
|
588
|
+
* @property {string} packingLineId The Packing Line ID this Task is associated with
|
|
589
|
+
* @property {string} [shiftId] The Shift ID this Task is asssociated with
|
|
590
|
+
* @property {Date} [createdTimestamp] When this Task was Created
|
|
591
|
+
* @property {?Date} [completedTimestamp] When this Task was Completed
|
|
592
|
+
* @property {?string} [authorUserId] The User ID of the Author for this Task
|
|
593
|
+
* @property {string} authorName The Name of the Author for this Task
|
|
594
|
+
* @property {string} type The Task Type
|
|
595
|
+
* @property {string[]} [tags] An Array of Tag IDs for this Task
|
|
596
|
+
* @property {string} title The Title of this Task
|
|
597
|
+
* @property {string} [content] The Content of this Task
|
|
598
|
+
* @memberof Controllers.Packhouse.Site
|
|
599
|
+
*/
|
|
600
|
+
|
|
601
|
+
/**
|
|
602
|
+
* The Update Data for a Shift Task
|
|
603
|
+
*
|
|
604
|
+
* @typedef {Object} ShiftTaskController.UpdateData
|
|
605
|
+
* @property {string} [packingLineId] The Packing Line ID this Task is associated with
|
|
606
|
+
* @property {Date} [createdTimestamp] When this Task was Created
|
|
607
|
+
* @property {?Date} [completedTimestamp] When this Task was Completed
|
|
608
|
+
* @property {?string} [authorUserId] The User ID of the Author for this Task
|
|
609
|
+
* @property {string} [authorName] The Name of the Author for this Task
|
|
610
|
+
* @property {string} [type] The Task Type
|
|
611
|
+
* @property {string[]} [tags] An Array of Tag IDs for this Task
|
|
612
|
+
* @property {string} [title] The Title of this Task
|
|
613
|
+
* @property {string} [content] The Content of this Task
|
|
614
|
+
* @memberof Controllers.Packhouse.Site
|
|
615
|
+
*/
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* A **CommentItem** Type
|
|
619
|
+
*
|
|
620
|
+
* @typedef {Object} ShiftTaskController.CommentItem
|
|
621
|
+
* @property {string} id The Comment ID
|
|
622
|
+
* @property {?string} content The Content of the Comment
|
|
623
|
+
* @property {?Date} createdTimestamp When the Comment was Created
|
|
624
|
+
* @property {?Date} updatedTimestamp When the Comment was last Updated
|
|
625
|
+
* @memberof Controllers.Packhouse.Site
|
|
626
|
+
*/
|
|
627
|
+
|
|
628
|
+
exports.default = _default;
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
+
var _BinTipBinController = _interopRequireDefault(require("./BinTipBinController"));
|
|
9
|
+
|
|
8
10
|
var _BinTipWeightController = _interopRequireDefault(require("./BinTipWeightController"));
|
|
9
11
|
|
|
10
12
|
var _CompacSizerBatchController = _interopRequireDefault(require("./CompacSizerBatchController"));
|
|
@@ -23,6 +25,8 @@ var _DowntimeEventController = _interopRequireDefault(require("./DowntimeEventCo
|
|
|
23
25
|
|
|
24
26
|
var _FreshPackPackrunSummaryController = _interopRequireDefault(require("./FreshPackPackrunSummaryController"));
|
|
25
27
|
|
|
28
|
+
var _FreshQualityPackrunSummaryController = _interopRequireDefault(require("./FreshQualityPackrunSummaryController"));
|
|
29
|
+
|
|
26
30
|
var _GrowingMethodController = _interopRequireDefault(require("./GrowingMethodController"));
|
|
27
31
|
|
|
28
32
|
var _PackTypeController = _interopRequireDefault(require("./PackTypeController"));
|
|
@@ -43,6 +47,10 @@ var _ShiftFocusMeetingController = _interopRequireDefault(require("./ShiftFocusM
|
|
|
43
47
|
|
|
44
48
|
var _ShiftHourlyEntryController = _interopRequireDefault(require("./ShiftHourlyEntryController"));
|
|
45
49
|
|
|
50
|
+
var _ShiftQualitySummaryController = _interopRequireDefault(require("./ShiftQualitySummaryController"));
|
|
51
|
+
|
|
52
|
+
var _ShiftTaskController = _interopRequireDefault(require("./ShiftTaskController"));
|
|
53
|
+
|
|
46
54
|
var _SoftSortBeltController = _interopRequireDefault(require("./SoftSortBeltController"));
|
|
47
55
|
|
|
48
56
|
var _VarietyController = _interopRequireDefault(require("./VarietyController"));
|
|
@@ -59,6 +67,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
59
67
|
* @namespace Controllers.Packhouse.Site
|
|
60
68
|
*/
|
|
61
69
|
var Site = {
|
|
70
|
+
BinTipBinController: _BinTipBinController.default,
|
|
62
71
|
BinTipWeightController: _BinTipWeightController.default,
|
|
63
72
|
CompacSizerBatchController: _CompacSizerBatchController.default,
|
|
64
73
|
CompacSizerController: _CompacSizerController.default,
|
|
@@ -68,6 +77,7 @@ var Site = {
|
|
|
68
77
|
CompacSizerPackrunSummaryController: _CompacSizerPackrunSummaryController.default,
|
|
69
78
|
DowntimeEventController: _DowntimeEventController.default,
|
|
70
79
|
FreshPackPackrunSummaryController: _FreshPackPackrunSummaryController.default,
|
|
80
|
+
FreshQualityPackrunSummaryController: _FreshQualityPackrunSummaryController.default,
|
|
71
81
|
GrowingMethodController: _GrowingMethodController.default,
|
|
72
82
|
PackTypeController: _PackTypeController.default,
|
|
73
83
|
PackingLineController: _PackingLineController.default,
|
|
@@ -78,6 +88,8 @@ var Site = {
|
|
|
78
88
|
ShiftController: _ShiftController.default,
|
|
79
89
|
ShiftFocusMeetingController: _ShiftFocusMeetingController.default,
|
|
80
90
|
ShiftHourlyEntryController: _ShiftHourlyEntryController.default,
|
|
91
|
+
ShiftQualitySummaryController: _ShiftQualitySummaryController.default,
|
|
92
|
+
ShiftTaskController: _ShiftTaskController.default,
|
|
81
93
|
SoftSortBeltController: _SoftSortBeltController.default,
|
|
82
94
|
VarietyController: _VarietyController.default
|
|
83
95
|
};
|