@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,657 @@
|
|
|
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 _FreshQualityPackrunSummaryModel = _interopRequireDefault(require("../../../Models/Packhouse/Site/FreshQualityPackrunSummaryModel"));
|
|
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 FreshQuality Packrun Summaries
|
|
24
|
+
*
|
|
25
|
+
* @class
|
|
26
|
+
*/
|
|
27
|
+
var FreshQualityPackrunSummaryController = /*#__PURE__*/function () {
|
|
28
|
+
function FreshQualityPackrunSummaryController() {
|
|
29
|
+
_classCallCheck(this, FreshQualityPackrunSummaryController);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_createClass(FreshQualityPackrunSummaryController, null, [{
|
|
33
|
+
key: "getOne",
|
|
34
|
+
value:
|
|
35
|
+
/**
|
|
36
|
+
* Retrieve a FreshQuality Packrun Summary [GET /packhouse/sites/{siteId}/freshquality-packrun-summaries/{id}]
|
|
37
|
+
*
|
|
38
|
+
* @static
|
|
39
|
+
* @public
|
|
40
|
+
* @param {number} siteId The Site ID
|
|
41
|
+
* @param {string} id The FreshQuality Packrun Summary ID
|
|
42
|
+
* @return {Promise<FreshQualityPackrunSummaryModel>}
|
|
43
|
+
*/
|
|
44
|
+
function getOne(siteId, id) {
|
|
45
|
+
return new Promise(function (resolve, reject) {
|
|
46
|
+
_RequestHelper.default.getRequest("/packhouse/sites/".concat(siteId, "/freshquality-packrun-summaries/").concat(id)).then(function (result) {
|
|
47
|
+
var resolveValue = function () {
|
|
48
|
+
return _FreshQualityPackrunSummaryModel.default.fromJSON(result, siteId);
|
|
49
|
+
}();
|
|
50
|
+
|
|
51
|
+
resolve(resolveValue);
|
|
52
|
+
}).catch(function (error) {
|
|
53
|
+
return reject(error);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Update a FreshQuality Packrun Summary [PATCH /packhouse/sites/{siteId}/freshquality-packrun-summaries/{id}]
|
|
59
|
+
*
|
|
60
|
+
* @static
|
|
61
|
+
* @public
|
|
62
|
+
* @param {number} siteId The Site ID
|
|
63
|
+
* @param {string} id The FreshQuality Packrun Summary ID
|
|
64
|
+
* @param {FreshQualityPackrunSummaryController.UpdateData} updateData The FreshQuality Packrun Summary Update Data
|
|
65
|
+
* @return {Promise<FreshQualityPackrunSummaryModel>}
|
|
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, "/freshquality-packrun-summaries/").concat(id), updateData).then(function (result) {
|
|
73
|
+
var resolveValue = function () {
|
|
74
|
+
return _FreshQualityPackrunSummaryModel.default.fromJSON(result, siteId);
|
|
75
|
+
}();
|
|
76
|
+
|
|
77
|
+
resolve(resolveValue);
|
|
78
|
+
}).catch(function (error) {
|
|
79
|
+
return reject(error);
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Delete a FreshQuality Packrun Summary [DELETE /packhouse/sites/{siteId}/freshquality-packrun-summaries/{id}]
|
|
85
|
+
*
|
|
86
|
+
* @static
|
|
87
|
+
* @public
|
|
88
|
+
* @param {number} siteId The Site ID
|
|
89
|
+
* @param {string} id The FreshQuality Packrun Summary 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, "/freshquality-packrun-summaries/").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}/freshquality-packrun-summaries/{id}/comments]
|
|
106
|
+
*
|
|
107
|
+
* Retrieves Comments for a FreshQuality Packrun Summary
|
|
108
|
+
*
|
|
109
|
+
* @static
|
|
110
|
+
* @public
|
|
111
|
+
* @param {number} siteId The Site ID
|
|
112
|
+
* @param {string} id The FreshQuality Packrun Summary ID
|
|
113
|
+
* @return {Promise<Array<FreshQualityPackrunSummaryController.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, "/freshquality-packrun-summaries/").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}/freshquality-packrun-summaries/{id}/comments]
|
|
203
|
+
*
|
|
204
|
+
* Create a Comment for a FreshQuality Packrun Summary
|
|
205
|
+
*
|
|
206
|
+
* @static
|
|
207
|
+
* @public
|
|
208
|
+
* @param {number} siteId The Site ID
|
|
209
|
+
* @param {string} id The FreshQuality Packrun Summary ID
|
|
210
|
+
* @param {string} content The Content of the New Comment
|
|
211
|
+
* @return {Promise<FreshQualityPackrunSummaryController.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, "/freshquality-packrun-summaries/").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}/freshquality-packrun-summaries/{id}/comments/{commentId}]
|
|
295
|
+
*
|
|
296
|
+
* Retrieves Comments for a FreshQuality Packrun Summary
|
|
297
|
+
*
|
|
298
|
+
* @static
|
|
299
|
+
* @public
|
|
300
|
+
* @param {number} siteId The Site ID
|
|
301
|
+
* @param {string} id The FreshQuality Packrun Summary ID
|
|
302
|
+
* @param {string} commentId The Comment ID
|
|
303
|
+
* @return {Promise<FreshQualityPackrunSummaryController.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, "/freshquality-packrun-summaries/").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}/freshquality-packrun-summaries/{id}/comments/{commentId}]
|
|
385
|
+
*
|
|
386
|
+
* Update a Comment for a FreshQuality Packrun Summary
|
|
387
|
+
*
|
|
388
|
+
* @static
|
|
389
|
+
* @public
|
|
390
|
+
* @param {number} siteId The Site ID
|
|
391
|
+
* @param {string} id The FreshQuality Packrun Summary ID
|
|
392
|
+
* @param {string} commentId The Comment ID
|
|
393
|
+
* @param {string} content The Updated Content for the Comment
|
|
394
|
+
* @return {Promise<FreshQualityPackrunSummaryController.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, "/freshquality-packrun-summaries/").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}/freshquality-packrun-summaries/{id}/comments/{commentId}]
|
|
478
|
+
*
|
|
479
|
+
* Delete a Comment for a FreshQuality Packrun Summary
|
|
480
|
+
*
|
|
481
|
+
* @static
|
|
482
|
+
* @public
|
|
483
|
+
* @param {number} siteId The Site ID
|
|
484
|
+
* @param {string} id The FreshQuality Packrun Summary 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, "/freshquality-packrun-summaries/").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 FreshQuality Packrun Summaries [GET /packhouse/sites/{siteId}/freshquality-packrun-summaries]
|
|
502
|
+
*
|
|
503
|
+
* @static
|
|
504
|
+
* @public
|
|
505
|
+
* @param {number} siteId The Site ID
|
|
506
|
+
* @param {FreshQualityPackrunSummaryController.GetAllQueryParameters} [queryParameters] The Optional Query Parameters
|
|
507
|
+
* @return {Promise<FreshQualityPackrunSummaryModel[]>}
|
|
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, "/freshquality-packrun-summaries"), 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 _FreshQualityPackrunSummaryModel.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 FreshQuality Packrun Summary [POST /packhouse/sites/{siteId}/freshquality-packrun-summaries]
|
|
536
|
+
*
|
|
537
|
+
* @static
|
|
538
|
+
* @public
|
|
539
|
+
* @param {number} siteId The Site ID
|
|
540
|
+
* @param {FreshQualityPackrunSummaryController.CreateData} createData The FreshQuality Packrun Summary Create Data
|
|
541
|
+
* @return {Promise<FreshQualityPackrunSummaryModel>}
|
|
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, "/freshquality-packrun-summaries"), createData).then(function (result) {
|
|
549
|
+
var resolveValue = function () {
|
|
550
|
+
return _FreshQualityPackrunSummaryModel.default.fromJSON(result, siteId);
|
|
551
|
+
}();
|
|
552
|
+
|
|
553
|
+
resolve(resolveValue);
|
|
554
|
+
}).catch(function (error) {
|
|
555
|
+
return reject(error);
|
|
556
|
+
});
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
}]);
|
|
560
|
+
|
|
561
|
+
return FreshQualityPackrunSummaryController;
|
|
562
|
+
}();
|
|
563
|
+
|
|
564
|
+
var _default = FreshQualityPackrunSummaryController;
|
|
565
|
+
/**
|
|
566
|
+
* The Optional Query Parameters for the getAll Function
|
|
567
|
+
*
|
|
568
|
+
* @typedef {Object} FreshQualityPackrunSummaryController.GetAllQueryParameters
|
|
569
|
+
* @property {string} [packingLineId] The Packing Line ID this Summary is associated with
|
|
570
|
+
* @property {string} [packrunId] The Packrun ID this Summary is associated with
|
|
571
|
+
* @property {?string} [timeBatchId] The Time Batch this Summary is associated with
|
|
572
|
+
* @property {Date} [createdTimestampBegin] Filter by the Timestamp when this FreshQuality Packrun Summary was Created. Results Greater than or Equal to Timestamp
|
|
573
|
+
* @property {Date} [createdTimestampEnd] Filter by the Timestamp when this FreshQuality Packrun Summary was Created. Results Less than or Equal to Timestamp
|
|
574
|
+
* @memberof Controllers.Packhouse.Site
|
|
575
|
+
*/
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* The Create Data for a FreshQuality Packrun Summary
|
|
579
|
+
*
|
|
580
|
+
* @typedef {Object} FreshQualityPackrunSummaryController.CreateData
|
|
581
|
+
* @property {string} packingLineId The Packing Line ID this Summary is associated with
|
|
582
|
+
* @property {string} [packrunId] The Packrun ID this Summary is associated with
|
|
583
|
+
* @property {Date} [createdTimestamp] When this Summary was Created
|
|
584
|
+
* @property {?string} [timeBatchId] The Time Batch this Summary is associated with
|
|
585
|
+
* @property {Array<FreshQualityPackrunSummaryController.Sample>} [class1R600Samples] An Array of Class 1 R600 Samples
|
|
586
|
+
* @property {Array<FreshQualityPackrunSummaryController.CategorySummary>} [categorySummaries] An Array of Defect Category Summaries (e.g. Minor Packing Defects, Softs)
|
|
587
|
+
* @property {number} [totalFruitSampled] The Total Number of Fruit Sampled in this Packrun Summary
|
|
588
|
+
* @memberof Controllers.Packhouse.Site
|
|
589
|
+
*/
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* The Update Data for a FreshQuality Packrun Summary
|
|
593
|
+
*
|
|
594
|
+
* @typedef {Object} FreshQualityPackrunSummaryController.UpdateData
|
|
595
|
+
* @property {string} [packingLineId] The Packing Line ID this Summary is associated with
|
|
596
|
+
* @property {Date} [createdTimestamp] When this Summary was Created
|
|
597
|
+
* @property {?string} [timeBatchId] The Time Batch this Summary is associated with
|
|
598
|
+
* @property {Array<FreshQualityPackrunSummaryController.Sample>} [class1R600Samples] An Array of Class 1 R600 Samples
|
|
599
|
+
* @property {Array<FreshQualityPackrunSummaryController.CategorySummary>} [categorySummaries] An Array of Defect Category Summaries (e.g. Minor Packing Defects, Softs)
|
|
600
|
+
* @property {number} [totalFruitSampled] The Total Number of Fruit Sampled in this Packrun Summary
|
|
601
|
+
* @memberof Controllers.Packhouse.Site
|
|
602
|
+
*/
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* A **CommentItem** Type
|
|
606
|
+
*
|
|
607
|
+
* @typedef {Object} FreshQualityPackrunSummaryController.CommentItem
|
|
608
|
+
* @property {string} id The Comment ID
|
|
609
|
+
* @property {?string} content The Content of the Comment
|
|
610
|
+
* @property {?Date} createdTimestamp When the Comment was Created
|
|
611
|
+
* @property {?Date} updatedTimestamp When the Comment was last Updated
|
|
612
|
+
* @memberof Controllers.Packhouse.Site
|
|
613
|
+
*/
|
|
614
|
+
|
|
615
|
+
/**
|
|
616
|
+
* A **SampleDefect** Type
|
|
617
|
+
*
|
|
618
|
+
* @typedef {Object} FreshQualityPackrunSummaryController.SampleDefect
|
|
619
|
+
* @property {string} name The Defect Name
|
|
620
|
+
* @property {string} group The Defect Group
|
|
621
|
+
* @property {number} fruitCount The Number of Fruit with this Defect
|
|
622
|
+
* @memberof Controllers.Packhouse.Site
|
|
623
|
+
*/
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* A **Sample** Type
|
|
627
|
+
*
|
|
628
|
+
* @typedef {Object} FreshQualityPackrunSummaryController.Sample
|
|
629
|
+
* @property {string} fruitSize The Fruit Size for this Sample
|
|
630
|
+
* @property {string} packType The Pack Type for this Sample
|
|
631
|
+
* @property {Date} timestamp When this Sample was taken
|
|
632
|
+
* @property {number} fruitCount The Total Number of Fruit Sampled
|
|
633
|
+
* @property {Array<FreshQualityPackrunSummaryController.SampleDefect>} defects An Array of Defects found in this Sample
|
|
634
|
+
* @memberof Controllers.Packhouse.Site
|
|
635
|
+
*/
|
|
636
|
+
|
|
637
|
+
/**
|
|
638
|
+
* A **CategorySummaryDefect** Type
|
|
639
|
+
*
|
|
640
|
+
* @typedef {Object} FreshQualityPackrunSummaryController.CategorySummaryDefect
|
|
641
|
+
* @property {string} name The Defect Name
|
|
642
|
+
* @property {number} fruitCount The Number of Fruit with this Defect
|
|
643
|
+
* @property {number} percentage The Percentage of Fruit with this Defect
|
|
644
|
+
* @memberof Controllers.Packhouse.Site
|
|
645
|
+
*/
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* A **CategorySummary** Type
|
|
649
|
+
*
|
|
650
|
+
* @typedef {Object} FreshQualityPackrunSummaryController.CategorySummary
|
|
651
|
+
* @property {string} name The Category Name (e.g. Minor Packing Defects, Softs)
|
|
652
|
+
* @property {number} percentage The Percentage of all Fruit Sampled that have Defects in this Category
|
|
653
|
+
* @property {Array<FreshQualityPackrunSummaryController.CategorySummaryDefect>} defects An Array of Defects within this Category Summary
|
|
654
|
+
* @memberof Controllers.Packhouse.Site
|
|
655
|
+
*/
|
|
656
|
+
|
|
657
|
+
exports.default = _default;
|