@ricado/api-client 2.3.28 → 2.4.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.
Files changed (51) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/Lab/Site/DehydratorController.js +198 -0
  3. package/lib/Controllers/Lab/Site/FruitProfileController.js +204 -0
  4. package/lib/Controllers/Lab/Site/LabController.js +222 -0
  5. package/lib/Controllers/Lab/Site/RackController.js +222 -0
  6. package/lib/Controllers/Lab/Site/RackPositionController.js +207 -0
  7. package/lib/Controllers/Lab/Site/SampleController.js +1023 -0
  8. package/lib/Controllers/Lab/Site/SampleFailureReasonController.js +192 -0
  9. package/lib/Controllers/Lab/Site/SampleResultController.js +905 -0
  10. package/lib/Controllers/Lab/Site/index.js +46 -0
  11. package/lib/Controllers/Lab/index.js +25 -0
  12. package/lib/Controllers/Packhouse/Site/ShiftController.js +304 -0
  13. package/lib/Controllers/index.js +9 -6
  14. package/lib/Models/Lab/Site/DehydratorModel.js +250 -0
  15. package/lib/Models/Lab/Site/FruitProfileModel.js +303 -0
  16. package/lib/Models/Lab/Site/LabModel.js +365 -0
  17. package/lib/Models/Lab/Site/RackModel.js +358 -0
  18. package/lib/Models/Lab/Site/RackPositionModel.js +525 -0
  19. package/lib/Models/Lab/Site/SampleFailureReasonModel.js +195 -0
  20. package/lib/Models/Lab/Site/SampleModel.js +545 -0
  21. package/lib/Models/Lab/Site/SampleResultModel.js +545 -0
  22. package/lib/Models/Lab/Site/index.js +46 -0
  23. package/lib/Models/Lab/index.js +25 -0
  24. package/lib/Models/index.js +7 -4
  25. package/lib/PackageVersion.js +1 -1
  26. package/lib/index.d.ts +10441 -7526
  27. package/package.json +1 -1
  28. package/src/Controllers/Lab/Site/DehydratorController.js +175 -0
  29. package/src/Controllers/Lab/Site/FruitProfileController.js +181 -0
  30. package/src/Controllers/Lab/Site/LabController.js +199 -0
  31. package/src/Controllers/Lab/Site/RackController.js +199 -0
  32. package/src/Controllers/Lab/Site/RackPositionController.js +184 -0
  33. package/src/Controllers/Lab/Site/SampleController.js +1160 -0
  34. package/src/Controllers/Lab/Site/SampleFailureReasonController.js +169 -0
  35. package/src/Controllers/Lab/Site/SampleResultController.js +1036 -0
  36. package/src/Controllers/Lab/Site/index.js +30 -0
  37. package/src/Controllers/Lab/index.js +16 -0
  38. package/src/Controllers/Packhouse/Site/ShiftController.js +367 -0
  39. package/src/Controllers/index.js +2 -0
  40. package/src/Models/Lab/Site/DehydratorModel.js +234 -0
  41. package/src/Models/Lab/Site/FruitProfileModel.js +290 -0
  42. package/src/Models/Lab/Site/LabModel.js +372 -0
  43. package/src/Models/Lab/Site/RackModel.js +358 -0
  44. package/src/Models/Lab/Site/RackPositionModel.js +600 -0
  45. package/src/Models/Lab/Site/SampleFailureReasonModel.js +170 -0
  46. package/src/Models/Lab/Site/SampleModel.js +565 -0
  47. package/src/Models/Lab/Site/SampleResultModel.js +565 -0
  48. package/src/Models/Lab/Site/index.js +30 -0
  49. package/src/Models/Lab/index.js +16 -0
  50. package/src/Models/index.js +2 -0
  51. package/src/PackageVersion.js +1 -1
@@ -0,0 +1,358 @@
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 BaseModel from '../../../Models/BaseModel';
8
+
9
+ /**
10
+ * Model Class for a Rack
11
+ *
12
+ * @class
13
+ * @hideconstructor
14
+ * @extends BaseModel
15
+ */
16
+ class RackModel extends BaseModel
17
+ {
18
+ /**
19
+ * RackModel Constructor
20
+ *
21
+ * @protected
22
+ * @param {number} siteId The Site ID associated with this Rack
23
+ */
24
+ constructor(siteId)
25
+ {
26
+ super();
27
+
28
+ /**
29
+ * The Rack ID
30
+ *
31
+ * @type {string}
32
+ * @public
33
+ */
34
+ this.id = "";
35
+
36
+ /**
37
+ * The RTU this Rack belongs to
38
+ *
39
+ * @type {?number}
40
+ * @public
41
+ */
42
+ this.rtuId = null;
43
+
44
+ /**
45
+ * The Name of this Rack
46
+ *
47
+ * @type {string}
48
+ * @public
49
+ */
50
+ this.name = "";
51
+
52
+ /**
53
+ * The Points used by this Rack
54
+ *
55
+ * @type {{disabled: number}}
56
+ * @public
57
+ */
58
+ this.points = (function(){
59
+ let pointsDefaultValue = {};
60
+
61
+ pointsDefaultValue.disabled = 0;
62
+
63
+ return pointsDefaultValue;
64
+ }());
65
+
66
+ /**
67
+ * The Lab that owns this Rack
68
+ *
69
+ * @type {string}
70
+ * @public
71
+ */
72
+ this.labId = "";
73
+
74
+ /**
75
+ * The Vertical Levels Defined for this Rack
76
+ *
77
+ * @type {Array<{name: string}>}
78
+ * @public
79
+ */
80
+ this.verticalLevels = [];
81
+
82
+ /**
83
+ * Whether the Vertical Levels for this Rack should be Inverted. By Default, Vertical Levels go from the Lowest Level upwards
84
+ *
85
+ * @type {boolean}
86
+ * @public
87
+ */
88
+ this.invertVerticalLevels = false;
89
+
90
+ /**
91
+ * The Horizontal Positions defined for this Rack
92
+ *
93
+ * @type {Array<{name: string}>}
94
+ * @public
95
+ */
96
+ this.horizontalPositions = [];
97
+
98
+ /**
99
+ * Whether the Horizontal Positions for this Rack should be Inverted. By Default, Horizontal Positions go from Left to Right
100
+ *
101
+ * @type {boolean}
102
+ * @public
103
+ */
104
+ this.invertHorizontalPositions = false;
105
+
106
+ /**
107
+ * Whether the Rack has been deleted
108
+ *
109
+ * @type {boolean}
110
+ * @public
111
+ */
112
+ this.deleted = false;
113
+
114
+ /**
115
+ * When the Rack was last updated
116
+ *
117
+ * @type {Date}
118
+ * @public
119
+ */
120
+ this.updateTimestamp = new Date();
121
+
122
+ /**
123
+ * The Site ID associated with this Rack
124
+ *
125
+ * @type {number}
126
+ * @public
127
+ */
128
+ this.siteId = siteId;
129
+ }
130
+
131
+ /**
132
+ * Create a new **RackModel** from a JSON Object or JSON String
133
+ *
134
+ * @static
135
+ * @public
136
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
137
+ * @param {number} siteId The Site ID associated with this Rack
138
+ * @return {RackModel}
139
+ */
140
+ static fromJSON(json, siteId)
141
+ {
142
+ let model = new RackModel(siteId);
143
+
144
+ /**
145
+ * The JSON Object
146
+ *
147
+ * @type {Object<string, any>}
148
+ */
149
+ let jsonObject = {};
150
+
151
+ if(typeof json === 'string')
152
+ {
153
+ jsonObject = JSON.parse(json);
154
+ }
155
+ else if(typeof json === 'object')
156
+ {
157
+ jsonObject = json;
158
+ }
159
+
160
+ if('id' in jsonObject)
161
+ {
162
+ model.id = (function(){
163
+ if(typeof jsonObject['id'] !== 'string')
164
+ {
165
+ return String(jsonObject['id']);
166
+ }
167
+
168
+ return jsonObject['id'];
169
+ }());
170
+ }
171
+
172
+ if('rtuId' in jsonObject)
173
+ {
174
+ model.rtuId = (function(){
175
+ if(jsonObject['rtuId'] === null)
176
+ {
177
+ return null;
178
+ }
179
+
180
+ if(typeof jsonObject['rtuId'] !== 'number')
181
+ {
182
+ return Number.isInteger(Number(jsonObject['rtuId'])) ? Number(jsonObject['rtuId']) : Math.floor(Number(jsonObject['rtuId']));
183
+ }
184
+
185
+ return Number.isInteger(jsonObject['rtuId']) ? jsonObject['rtuId'] : Math.floor(jsonObject['rtuId']);
186
+ }());
187
+ }
188
+
189
+ if('name' in jsonObject)
190
+ {
191
+ model.name = (function(){
192
+ if(typeof jsonObject['name'] !== 'string')
193
+ {
194
+ return String(jsonObject['name']);
195
+ }
196
+
197
+ return jsonObject['name'];
198
+ }());
199
+ }
200
+
201
+ if('points' in jsonObject)
202
+ {
203
+ model.points = (function(){
204
+ let pointsObject = {};
205
+
206
+ if(typeof jsonObject['points'] === 'object' && 'disabled' in jsonObject['points'])
207
+ {
208
+ pointsObject.disabled = (function(){
209
+ if(typeof jsonObject['points'].disabled !== 'number')
210
+ {
211
+ return Number.isInteger(Number(jsonObject['points'].disabled)) ? Number(jsonObject['points'].disabled) : Math.floor(Number(jsonObject['points'].disabled));
212
+ }
213
+
214
+ return Number.isInteger(jsonObject['points'].disabled) ? jsonObject['points'].disabled : Math.floor(jsonObject['points'].disabled);
215
+ }());
216
+ }
217
+ else
218
+ {
219
+ pointsObject.disabled = 0;
220
+ }
221
+
222
+ return pointsObject;
223
+ }());
224
+ }
225
+
226
+ if('labId' in jsonObject)
227
+ {
228
+ model.labId = (function(){
229
+ if(typeof jsonObject['labId'] !== 'string')
230
+ {
231
+ return String(jsonObject['labId']);
232
+ }
233
+
234
+ return jsonObject['labId'];
235
+ }());
236
+ }
237
+
238
+ if('verticalLevels' in jsonObject)
239
+ {
240
+ model.verticalLevels = (function(){
241
+ if(Array.isArray(jsonObject['verticalLevels']) !== true)
242
+ {
243
+ return [];
244
+ }
245
+
246
+ return jsonObject['verticalLevels'].map((verticalLevelsItem) => {
247
+ return (function(){
248
+ let verticalLevelsItemObject = {};
249
+
250
+ if(typeof verticalLevelsItem === 'object' && 'name' in verticalLevelsItem)
251
+ {
252
+ verticalLevelsItemObject.name = (function(){
253
+ if(typeof verticalLevelsItem.name !== 'string')
254
+ {
255
+ return String(verticalLevelsItem.name);
256
+ }
257
+
258
+ return verticalLevelsItem.name;
259
+ }());
260
+ }
261
+ else
262
+ {
263
+ verticalLevelsItemObject.name = "";
264
+ }
265
+
266
+ return verticalLevelsItemObject;
267
+ }());
268
+ });
269
+ }());
270
+ }
271
+
272
+ if('invertVerticalLevels' in jsonObject)
273
+ {
274
+ model.invertVerticalLevels = (function(){
275
+ if(typeof jsonObject['invertVerticalLevels'] !== 'boolean')
276
+ {
277
+ return Boolean(jsonObject['invertVerticalLevels']);
278
+ }
279
+
280
+ return jsonObject['invertVerticalLevels'];
281
+ }());
282
+ }
283
+
284
+ if('horizontalPositions' in jsonObject)
285
+ {
286
+ model.horizontalPositions = (function(){
287
+ if(Array.isArray(jsonObject['horizontalPositions']) !== true)
288
+ {
289
+ return [];
290
+ }
291
+
292
+ return jsonObject['horizontalPositions'].map((horizontalPositionsItem) => {
293
+ return (function(){
294
+ let horizontalPositionsItemObject = {};
295
+
296
+ if(typeof horizontalPositionsItem === 'object' && 'name' in horizontalPositionsItem)
297
+ {
298
+ horizontalPositionsItemObject.name = (function(){
299
+ if(typeof horizontalPositionsItem.name !== 'string')
300
+ {
301
+ return String(horizontalPositionsItem.name);
302
+ }
303
+
304
+ return horizontalPositionsItem.name;
305
+ }());
306
+ }
307
+ else
308
+ {
309
+ horizontalPositionsItemObject.name = "";
310
+ }
311
+
312
+ return horizontalPositionsItemObject;
313
+ }());
314
+ });
315
+ }());
316
+ }
317
+
318
+ if('invertHorizontalPositions' in jsonObject)
319
+ {
320
+ model.invertHorizontalPositions = (function(){
321
+ if(typeof jsonObject['invertHorizontalPositions'] !== 'boolean')
322
+ {
323
+ return Boolean(jsonObject['invertHorizontalPositions']);
324
+ }
325
+
326
+ return jsonObject['invertHorizontalPositions'];
327
+ }());
328
+ }
329
+
330
+ if('deleted' in jsonObject)
331
+ {
332
+ model.deleted = (function(){
333
+ if(typeof jsonObject['deleted'] !== 'boolean')
334
+ {
335
+ return Boolean(jsonObject['deleted']);
336
+ }
337
+
338
+ return jsonObject['deleted'];
339
+ }());
340
+ }
341
+
342
+ if('updateTimestamp' in jsonObject)
343
+ {
344
+ model.updateTimestamp = (function(){
345
+ if(typeof jsonObject['updateTimestamp'] !== 'string')
346
+ {
347
+ return new Date(String(jsonObject['updateTimestamp']));
348
+ }
349
+
350
+ return new Date(jsonObject['updateTimestamp']);
351
+ }());
352
+ }
353
+
354
+ return model;
355
+ }
356
+ }
357
+
358
+ export default RackModel;