@ricado/api-client 2.3.24 → 2.3.26

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.
@@ -55,6 +55,8 @@ var _PackingLineController = _interopRequireDefault(require("./PackingLineContro
55
55
 
56
56
  var _PackrunController = _interopRequireDefault(require("./PackrunController"));
57
57
 
58
+ var _PrePackSampleController = _interopRequireDefault(require("./PrePackSampleController"));
59
+
58
60
  var _RejectBinController = _interopRequireDefault(require("./RejectBinController"));
59
61
 
60
62
  var _RejectBinScaleController = _interopRequireDefault(require("./RejectBinScaleController"));
@@ -118,6 +120,7 @@ var Site = {
118
120
  PackTypeController: _PackTypeController.default,
119
121
  PackingLineController: _PackingLineController.default,
120
122
  PackrunController: _PackrunController.default,
123
+ PrePackSampleController: _PrePackSampleController.default,
121
124
  RejectBinController: _RejectBinController.default,
122
125
  RejectBinScaleController: _RejectBinScaleController.default,
123
126
  RejectBinWeightController: _RejectBinWeightController.default,
@@ -189,7 +189,7 @@ var PackingLineModel = /*#__PURE__*/function (_BaseModel) {
189
189
  /**
190
190
  * The Optional Shift Management Object for this Packing Line
191
191
  *
192
- * @type {?{points: {currentShiftId: number, currentShiftStatus: number, createNewDayShiftRequest: number, createNewNightShiftRequest: number, startCurrentShiftRequest: number, finishCurrentShiftRequest: number, currentFocusMeetingId: number, startFocusMeetingRequest: number, finishFocusMeetingRequest: number, currentGrowerChangeMeetingId: number, startGrowerChangeMeetingRequest: number, finishGrowerChangeMeetingRequest: number, shiftSchedules: number, currentShiftModifyHourlyEntryRequest: number, currentShiftClass1TraysPerHourTarget: number, currentShiftClass1TraysPerHourAdjustedTarget: number, currentShiftClass1TraysPerHour: number, currentShiftCostPerTrayTarget: number, currentShiftCostPerTrayAdjustedTarget: number, currentShiftCostPerTray: number, currentShiftManningTarget: number, currentShiftClass1Manning: number, currentShiftClass2Manning: number, currentShiftClass1ManningTarget: number, currentShiftClass2ManningTarget: number, currentShiftQualityR600IdealTarget: number, currentShiftQualityR600Ideal: number, currentShiftScorePercentage: number, class1TraysPerHourTargets: number, costPerTrayTargets: number, manningTargets: number, qualityR600IdealTargets: number, layeredTrayPercentageTargets: number, class1PercentageTargets: ?number, costPerManningUnitHour: number, class1TraysPerHourScoreWeighting: number, costPerTrayScoreWeighting: number, qualityR600IdealScoreWeighting: number, summaryReportEmailContacts: number, currentShiftUpdateManningTeamsRequest: ?number, currentShiftUpdateManningTeamsTimestamp: ?number, manningTeams: ?number}, customQualityConfiguration: Array<{id: string, name: string, type: string, points: {currentShiftCustomQualityTarget: number, currentShiftCustomQualityValue: number, customQualityTargets: number, customQualityScoreWeighting: number}}>, enabled: boolean, taskDefinitions: Array<{type: string, tags: Array<{id: string, name: string, color: string, deleted: boolean}>}>, manningUsesTeams: boolean}}
192
+ * @type {?{points: {currentShiftId: number, currentShiftStatus: number, createNewDayShiftRequest: number, createNewNightShiftRequest: number, startCurrentShiftRequest: number, finishCurrentShiftRequest: number, currentFocusMeetingId: number, startFocusMeetingRequest: number, finishFocusMeetingRequest: number, currentGrowerChangeMeetingId: number, startGrowerChangeMeetingRequest: number, finishGrowerChangeMeetingRequest: number, shiftSchedules: number, currentShiftModifyHourlyEntryRequest: number, currentShiftClass1TraysPerHourTarget: number, currentShiftClass1TraysPerHourAdjustedTarget: number, currentShiftClass1TraysPerHour: number, currentShiftCostPerTrayTarget: number, currentShiftCostPerTrayAdjustedTarget: number, currentShiftCostPerTray: number, currentShiftManningTarget: number, currentShiftClass1Manning: number, currentShiftClass2Manning: number, currentShiftClass1ManningTarget: number, currentShiftClass2ManningTarget: number, currentShiftQualityR600IdealTarget: number, currentShiftQualityR600Ideal: number, currentShiftScorePercentage: number, class1TraysPerHourTargets: number, class1TraysPerHourAdjustments: number, costPerTrayTargets: number, manningTargets: number, qualityR600IdealTargets: number, layeredTrayPercentageTargets: number, class1PercentageTargets: ?number, costPerManningUnitHour: number, class1TraysPerHourScoreWeighting: number, costPerTrayScoreWeighting: number, qualityR600IdealScoreWeighting: number, summaryReportEmailContacts: number, currentShiftUpdateManningTeamsRequest: ?number, currentShiftUpdateManningTeamsTimestamp: ?number, manningTeams: ?number}, customQualityConfiguration: Array<{id: string, name: string, type: string, points: {currentShiftCustomQualityTarget: number, currentShiftCustomQualityValue: number, customQualityTargets: number, customQualityScoreWeighting: number}}>, enabled: boolean, taskDefinitions: Array<{type: string, tags: Array<{id: string, name: string, color: string, deleted: boolean}>}>, manningUsesTeams: boolean}}
193
193
  * @public
194
194
  */
195
195
 
@@ -3093,6 +3093,18 @@ var PackingLineModel = /*#__PURE__*/function (_BaseModel) {
3093
3093
  pointsObject.class1TraysPerHourTargets = 0;
3094
3094
  }
3095
3095
 
3096
+ if (_typeof(jsonObject['shiftManagement'].points) === 'object' && 'class1TraysPerHourAdjustments' in jsonObject['shiftManagement'].points) {
3097
+ pointsObject.class1TraysPerHourAdjustments = function () {
3098
+ if (typeof jsonObject['shiftManagement'].points.class1TraysPerHourAdjustments !== 'number') {
3099
+ return Number.isInteger(Number(jsonObject['shiftManagement'].points.class1TraysPerHourAdjustments)) ? Number(jsonObject['shiftManagement'].points.class1TraysPerHourAdjustments) : Math.floor(Number(jsonObject['shiftManagement'].points.class1TraysPerHourAdjustments));
3100
+ }
3101
+
3102
+ return Number.isInteger(jsonObject['shiftManagement'].points.class1TraysPerHourAdjustments) ? jsonObject['shiftManagement'].points.class1TraysPerHourAdjustments : Math.floor(jsonObject['shiftManagement'].points.class1TraysPerHourAdjustments);
3103
+ }();
3104
+ } else {
3105
+ pointsObject.class1TraysPerHourAdjustments = 0;
3106
+ }
3107
+
3096
3108
  if (_typeof(jsonObject['shiftManagement'].points) === 'object' && 'costPerTrayTargets' in jsonObject['shiftManagement'].points) {
3097
3109
  pointsObject.costPerTrayTargets = function () {
3098
3110
  if (typeof jsonObject['shiftManagement'].points.costPerTrayTargets !== 'number') {
@@ -3299,6 +3311,7 @@ var PackingLineModel = /*#__PURE__*/function (_BaseModel) {
3299
3311
  pointsDefaultValue.currentShiftQualityR600Ideal = 0;
3300
3312
  pointsDefaultValue.currentShiftScorePercentage = 0;
3301
3313
  pointsDefaultValue.class1TraysPerHourTargets = 0;
3314
+ pointsDefaultValue.class1TraysPerHourAdjustments = 0;
3302
3315
  pointsDefaultValue.costPerTrayTargets = 0;
3303
3316
  pointsDefaultValue.manningTargets = 0;
3304
3317
  pointsDefaultValue.qualityR600IdealTargets = 0;
@@ -0,0 +1,327 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _BaseModel2 = _interopRequireDefault(require("../../../Models/BaseModel"));
9
+
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+
12
+ 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); }
13
+
14
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
+
16
+ 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); } }
17
+
18
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
19
+
20
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
+
22
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
23
+
24
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
25
+
26
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
27
+
28
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
+
30
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
31
+
32
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
33
+
34
+ /**
35
+ * Model Class for a PrePack Sample
36
+ *
37
+ * @class
38
+ * @hideconstructor
39
+ * @extends BaseModel
40
+ */
41
+ var PrePackSampleModel = /*#__PURE__*/function (_BaseModel) {
42
+ _inherits(PrePackSampleModel, _BaseModel);
43
+
44
+ var _super = _createSuper(PrePackSampleModel);
45
+
46
+ /**
47
+ * PrePackSampleModel Constructor
48
+ *
49
+ * @protected
50
+ * @param {number} siteId The Site ID associated with this PrePack Sample
51
+ */
52
+ function PrePackSampleModel(siteId) {
53
+ var _this;
54
+
55
+ _classCallCheck(this, PrePackSampleModel);
56
+
57
+ _this = _super.call(this);
58
+ /**
59
+ * The PrePack Sample ID
60
+ *
61
+ * @type {string}
62
+ * @public
63
+ */
64
+
65
+ _this.id = "";
66
+ /**
67
+ * The Packing Line ID this Sample is associated with
68
+ *
69
+ * @type {string}
70
+ * @public
71
+ */
72
+
73
+ _this.packingLineId = "";
74
+ /**
75
+ * The Packrun ID this Sample is associated with
76
+ *
77
+ * @type {string}
78
+ * @public
79
+ */
80
+
81
+ _this.packrunId = "";
82
+ /**
83
+ * When this Sample was Created
84
+ *
85
+ * @type {Date}
86
+ * @public
87
+ */
88
+
89
+ _this.createdTimestamp = new Date();
90
+ /**
91
+ * The ID of the User who created this Pre-Pack Sample
92
+ *
93
+ * @type {string}
94
+ * @public
95
+ */
96
+
97
+ _this.userId = "";
98
+ /**
99
+ * The Name of the User who created this Pre-Pack Sample
100
+ *
101
+ * @type {string}
102
+ * @public
103
+ */
104
+
105
+ _this.userName = "";
106
+ /**
107
+ * An Array of Defects found in this Pre-Pack Sample
108
+ *
109
+ * @type {Array<{id: string, name: string, fruitCount: number}>}
110
+ * @public
111
+ */
112
+
113
+ _this.sampleDefects = [];
114
+ /**
115
+ * The Total Number of Fruit Sampled in this Pre-Pack Sample
116
+ *
117
+ * @type {number}
118
+ * @public
119
+ */
120
+
121
+ _this.totalFruitSampled = 0;
122
+ /**
123
+ * Whether the PrePack Sample has been deleted
124
+ *
125
+ * @type {boolean}
126
+ * @public
127
+ */
128
+
129
+ _this.deleted = false;
130
+ /**
131
+ * When the PrePack Sample was last updated
132
+ *
133
+ * @type {Date}
134
+ * @public
135
+ */
136
+
137
+ _this.updateTimestamp = new Date();
138
+ /**
139
+ * The Site ID associated with this PrePack Sample
140
+ *
141
+ * @type {number}
142
+ * @public
143
+ */
144
+
145
+ _this.siteId = siteId;
146
+ return _this;
147
+ }
148
+ /**
149
+ * Create a new **PrePackSampleModel** from a JSON Object or JSON String
150
+ *
151
+ * @static
152
+ * @public
153
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
154
+ * @param {number} siteId The Site ID associated with this PrePack Sample
155
+ * @return {PrePackSampleModel}
156
+ */
157
+
158
+
159
+ _createClass(PrePackSampleModel, null, [{
160
+ key: "fromJSON",
161
+ value: function fromJSON(json, siteId) {
162
+ var model = new PrePackSampleModel(siteId);
163
+ /**
164
+ * The JSON Object
165
+ *
166
+ * @type {Object<string, any>}
167
+ */
168
+
169
+ var jsonObject = {};
170
+
171
+ if (typeof json === 'string') {
172
+ jsonObject = JSON.parse(json);
173
+ } else if (_typeof(json) === 'object') {
174
+ jsonObject = json;
175
+ }
176
+
177
+ if ('id' in jsonObject) {
178
+ model.id = function () {
179
+ if (typeof jsonObject['id'] !== 'string') {
180
+ return String(jsonObject['id']);
181
+ }
182
+
183
+ return jsonObject['id'];
184
+ }();
185
+ }
186
+
187
+ if ('packingLineId' in jsonObject) {
188
+ model.packingLineId = function () {
189
+ if (typeof jsonObject['packingLineId'] !== 'string') {
190
+ return String(jsonObject['packingLineId']);
191
+ }
192
+
193
+ return jsonObject['packingLineId'];
194
+ }();
195
+ }
196
+
197
+ if ('packrunId' in jsonObject) {
198
+ model.packrunId = function () {
199
+ if (typeof jsonObject['packrunId'] !== 'string') {
200
+ return String(jsonObject['packrunId']);
201
+ }
202
+
203
+ return jsonObject['packrunId'];
204
+ }();
205
+ }
206
+
207
+ if ('createdTimestamp' in jsonObject) {
208
+ model.createdTimestamp = function () {
209
+ if (typeof jsonObject['createdTimestamp'] !== 'string') {
210
+ return new Date(String(jsonObject['createdTimestamp']));
211
+ }
212
+
213
+ return new Date(jsonObject['createdTimestamp']);
214
+ }();
215
+ }
216
+
217
+ if ('userId' in jsonObject) {
218
+ model.userId = function () {
219
+ if (typeof jsonObject['userId'] !== 'string') {
220
+ return String(jsonObject['userId']);
221
+ }
222
+
223
+ return jsonObject['userId'];
224
+ }();
225
+ }
226
+
227
+ if ('userName' in jsonObject) {
228
+ model.userName = function () {
229
+ if (typeof jsonObject['userName'] !== 'string') {
230
+ return String(jsonObject['userName']);
231
+ }
232
+
233
+ return jsonObject['userName'];
234
+ }();
235
+ }
236
+
237
+ if ('sampleDefects' in jsonObject) {
238
+ model.sampleDefects = function () {
239
+ if (Array.isArray(jsonObject['sampleDefects']) !== true) {
240
+ return [];
241
+ }
242
+
243
+ return jsonObject['sampleDefects'].map(function (sampleDefectsItem) {
244
+ return function () {
245
+ var sampleDefectsItemObject = {};
246
+
247
+ if (_typeof(sampleDefectsItem) === 'object' && 'id' in sampleDefectsItem) {
248
+ sampleDefectsItemObject.id = function () {
249
+ if (typeof sampleDefectsItem.id !== 'string') {
250
+ return String(sampleDefectsItem.id);
251
+ }
252
+
253
+ return sampleDefectsItem.id;
254
+ }();
255
+ } else {
256
+ sampleDefectsItemObject.id = "";
257
+ }
258
+
259
+ if (_typeof(sampleDefectsItem) === 'object' && 'name' in sampleDefectsItem) {
260
+ sampleDefectsItemObject.name = function () {
261
+ if (typeof sampleDefectsItem.name !== 'string') {
262
+ return String(sampleDefectsItem.name);
263
+ }
264
+
265
+ return sampleDefectsItem.name;
266
+ }();
267
+ } else {
268
+ sampleDefectsItemObject.name = "";
269
+ }
270
+
271
+ if (_typeof(sampleDefectsItem) === 'object' && 'fruitCount' in sampleDefectsItem) {
272
+ sampleDefectsItemObject.fruitCount = function () {
273
+ if (typeof sampleDefectsItem.fruitCount !== 'number') {
274
+ return Number.isInteger(Number(sampleDefectsItem.fruitCount)) ? Number(sampleDefectsItem.fruitCount) : Math.floor(Number(sampleDefectsItem.fruitCount));
275
+ }
276
+
277
+ return Number.isInteger(sampleDefectsItem.fruitCount) ? sampleDefectsItem.fruitCount : Math.floor(sampleDefectsItem.fruitCount);
278
+ }();
279
+ } else {
280
+ sampleDefectsItemObject.fruitCount = 0;
281
+ }
282
+
283
+ return sampleDefectsItemObject;
284
+ }();
285
+ });
286
+ }();
287
+ }
288
+
289
+ if ('totalFruitSampled' in jsonObject) {
290
+ model.totalFruitSampled = function () {
291
+ if (typeof jsonObject['totalFruitSampled'] !== 'number') {
292
+ return Number.isInteger(Number(jsonObject['totalFruitSampled'])) ? Number(jsonObject['totalFruitSampled']) : Math.floor(Number(jsonObject['totalFruitSampled']));
293
+ }
294
+
295
+ return Number.isInteger(jsonObject['totalFruitSampled']) ? jsonObject['totalFruitSampled'] : Math.floor(jsonObject['totalFruitSampled']);
296
+ }();
297
+ }
298
+
299
+ if ('deleted' in jsonObject) {
300
+ model.deleted = function () {
301
+ if (typeof jsonObject['deleted'] !== 'boolean') {
302
+ return Boolean(jsonObject['deleted']);
303
+ }
304
+
305
+ return jsonObject['deleted'];
306
+ }();
307
+ }
308
+
309
+ if ('updateTimestamp' in jsonObject) {
310
+ model.updateTimestamp = function () {
311
+ if (typeof jsonObject['updateTimestamp'] !== 'string') {
312
+ return new Date(String(jsonObject['updateTimestamp']));
313
+ }
314
+
315
+ return new Date(jsonObject['updateTimestamp']);
316
+ }();
317
+ }
318
+
319
+ return model;
320
+ }
321
+ }]);
322
+
323
+ return PrePackSampleModel;
324
+ }(_BaseModel2.default);
325
+
326
+ var _default = PrePackSampleModel;
327
+ exports.default = _default;
@@ -55,6 +55,8 @@ var _PackingLineModel = _interopRequireDefault(require("./PackingLineModel"));
55
55
 
56
56
  var _PackrunModel = _interopRequireDefault(require("./PackrunModel"));
57
57
 
58
+ var _PrePackSampleModel = _interopRequireDefault(require("./PrePackSampleModel"));
59
+
58
60
  var _RejectBinModel = _interopRequireDefault(require("./RejectBinModel"));
59
61
 
60
62
  var _RejectBinScaleModel = _interopRequireDefault(require("./RejectBinScaleModel"));
@@ -118,6 +120,7 @@ var Site = {
118
120
  PackTypeModel: _PackTypeModel.default,
119
121
  PackingLineModel: _PackingLineModel.default,
120
122
  PackrunModel: _PackrunModel.default,
123
+ PrePackSampleModel: _PrePackSampleModel.default,
121
124
  RejectBinModel: _RejectBinModel.default,
122
125
  RejectBinScaleModel: _RejectBinScaleModel.default,
123
126
  RejectBinWeightModel: _RejectBinWeightModel.default,
@@ -5,5 +5,5 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.version = void 0;
7
7
  // Generated by genversion.
8
- var version = '2.3.24';
8
+ var version = '2.3.26';
9
9
  exports.version = version;