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