@ricado/api-client 2.3.21 → 2.3.23
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/FreshPackBinLotController.js +877 -0
- package/lib/Controllers/Packhouse/Site/FreshPackFruitTemperatureController.js +892 -0
- package/lib/Controllers/Packhouse/Site/ShiftGrowerChangeMeetingController.js +892 -0
- package/lib/Controllers/Packhouse/Site/index.js +9 -0
- package/lib/Controllers/TokenController.js +1 -1
- package/lib/Models/Packhouse/Site/FreshPackBinLotModel.js +265 -0
- package/lib/Models/Packhouse/Site/FreshPackFruitTemperatureModel.js +341 -0
- package/lib/Models/Packhouse/Site/ShiftGrowerChangeMeetingModel.js +333 -0
- package/lib/Models/Packhouse/Site/index.js +9 -0
- package/lib/PackageVersion.js +1 -1
- package/lib/index.d.ts +6837 -5691
- package/package.json +1 -1
- package/src/Controllers/Packhouse/Site/FreshPackBinLotController.js +1008 -0
- package/src/Controllers/Packhouse/Site/FreshPackFruitTemperatureController.js +1023 -0
- package/src/Controllers/Packhouse/Site/ShiftGrowerChangeMeetingController.js +1023 -0
- package/src/Controllers/Packhouse/Site/index.js +6 -0
- package/src/Controllers/TokenController.js +1 -1
- package/src/Models/Packhouse/Site/FreshPackBinLotModel.js +248 -0
- package/src/Models/Packhouse/Site/FreshPackFruitTemperatureModel.js +347 -0
- package/src/Models/Packhouse/Site/ShiftGrowerChangeMeetingModel.js +325 -0
- package/src/Models/Packhouse/Site/index.js +6 -0
- package/src/PackageVersion.js +1 -1
|
@@ -31,6 +31,10 @@ var _CompacSizerPackrunSummaryController = _interopRequireDefault(require("./Com
|
|
|
31
31
|
|
|
32
32
|
var _DowntimeEventController = _interopRequireDefault(require("./DowntimeEventController"));
|
|
33
33
|
|
|
34
|
+
var _FreshPackBinLotController = _interopRequireDefault(require("./FreshPackBinLotController"));
|
|
35
|
+
|
|
36
|
+
var _FreshPackFruitTemperatureController = _interopRequireDefault(require("./FreshPackFruitTemperatureController"));
|
|
37
|
+
|
|
34
38
|
var _FreshPackPackrunSummaryController = _interopRequireDefault(require("./FreshPackPackrunSummaryController"));
|
|
35
39
|
|
|
36
40
|
var _FreshQualityPackrunSummaryController = _interopRequireDefault(require("./FreshQualityPackrunSummaryController"));
|
|
@@ -61,6 +65,8 @@ var _ShiftController = _interopRequireDefault(require("./ShiftController"));
|
|
|
61
65
|
|
|
62
66
|
var _ShiftFocusMeetingController = _interopRequireDefault(require("./ShiftFocusMeetingController"));
|
|
63
67
|
|
|
68
|
+
var _ShiftGrowerChangeMeetingController = _interopRequireDefault(require("./ShiftGrowerChangeMeetingController"));
|
|
69
|
+
|
|
64
70
|
var _ShiftHourlyEntryController = _interopRequireDefault(require("./ShiftHourlyEntryController"));
|
|
65
71
|
|
|
66
72
|
var _ShiftQualitySummaryController = _interopRequireDefault(require("./ShiftQualitySummaryController"));
|
|
@@ -100,6 +106,8 @@ var Site = {
|
|
|
100
106
|
CompacSizerOutletTypeController: _CompacSizerOutletTypeController.default,
|
|
101
107
|
CompacSizerPackrunSummaryController: _CompacSizerPackrunSummaryController.default,
|
|
102
108
|
DowntimeEventController: _DowntimeEventController.default,
|
|
109
|
+
FreshPackBinLotController: _FreshPackBinLotController.default,
|
|
110
|
+
FreshPackFruitTemperatureController: _FreshPackFruitTemperatureController.default,
|
|
103
111
|
FreshPackPackrunSummaryController: _FreshPackPackrunSummaryController.default,
|
|
104
112
|
FreshQualityPackrunSummaryController: _FreshQualityPackrunSummaryController.default,
|
|
105
113
|
GrowingMethodController: _GrowingMethodController.default,
|
|
@@ -115,6 +123,7 @@ var Site = {
|
|
|
115
123
|
RejectBinWeightController: _RejectBinWeightController.default,
|
|
116
124
|
ShiftController: _ShiftController.default,
|
|
117
125
|
ShiftFocusMeetingController: _ShiftFocusMeetingController.default,
|
|
126
|
+
ShiftGrowerChangeMeetingController: _ShiftGrowerChangeMeetingController.default,
|
|
118
127
|
ShiftHourlyEntryController: _ShiftHourlyEntryController.default,
|
|
119
128
|
ShiftQualitySummaryController: _ShiftQualitySummaryController.default,
|
|
120
129
|
ShiftSummaryReportController: _ShiftSummaryReportController.default,
|
|
@@ -41,7 +41,7 @@ var TokenController = /*#__PURE__*/function () {
|
|
|
41
41
|
* The user must have an account that has been created on RICADO. A valid Email Address and Password will be required.
|
|
42
42
|
*
|
|
43
43
|
* **API Key Authentication**
|
|
44
|
-
* A valid API Key and API Secret will be required. These can be created in the RICADO
|
|
44
|
+
* A valid API Key and API Secret will be required. These can be created in the RICADO Admin App at admin.ricado.co.nz.
|
|
45
45
|
*
|
|
46
46
|
* @static
|
|
47
47
|
* @public
|
|
@@ -0,0 +1,265 @@
|
|
|
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 FreshPack Bin Lot
|
|
36
|
+
*
|
|
37
|
+
* @class
|
|
38
|
+
* @hideconstructor
|
|
39
|
+
* @extends BaseModel
|
|
40
|
+
*/
|
|
41
|
+
var FreshPackBinLotModel = /*#__PURE__*/function (_BaseModel) {
|
|
42
|
+
_inherits(FreshPackBinLotModel, _BaseModel);
|
|
43
|
+
|
|
44
|
+
var _super = _createSuper(FreshPackBinLotModel);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* FreshPackBinLotModel Constructor
|
|
48
|
+
*
|
|
49
|
+
* @protected
|
|
50
|
+
* @param {number} siteId The Site ID associated with this FreshPack Bin Lot
|
|
51
|
+
*/
|
|
52
|
+
function FreshPackBinLotModel(siteId) {
|
|
53
|
+
var _this;
|
|
54
|
+
|
|
55
|
+
_classCallCheck(this, FreshPackBinLotModel);
|
|
56
|
+
|
|
57
|
+
_this = _super.call(this);
|
|
58
|
+
/**
|
|
59
|
+
* The FreshPack Bin Lot ID
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
_this.id = "";
|
|
66
|
+
/**
|
|
67
|
+
* The Bin Tip ID this Bin Lot is associated with
|
|
68
|
+
*
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
_this.binTipId = "";
|
|
74
|
+
/**
|
|
75
|
+
* The Bin Lot Code
|
|
76
|
+
*
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
_this.binLotCode = "";
|
|
82
|
+
/**
|
|
83
|
+
* When this Bin Lot was Created
|
|
84
|
+
*
|
|
85
|
+
* @type {Date}
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
_this.createdTimestamp = new Date();
|
|
90
|
+
/**
|
|
91
|
+
* An Array of Packrun IDs associated with this Bin Lot
|
|
92
|
+
*
|
|
93
|
+
* @type {string[]}
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
_this.packrunIds = [];
|
|
98
|
+
/**
|
|
99
|
+
* An Array of Bin Numbers for this Bin Lot
|
|
100
|
+
*
|
|
101
|
+
* @type {string[]}
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
_this.binNumbers = [];
|
|
106
|
+
/**
|
|
107
|
+
* Whether the FreshPack Bin Lot has been deleted
|
|
108
|
+
*
|
|
109
|
+
* @type {boolean}
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
_this.deleted = false;
|
|
114
|
+
/**
|
|
115
|
+
* When the FreshPack Bin Lot was last updated
|
|
116
|
+
*
|
|
117
|
+
* @type {Date}
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
_this.updateTimestamp = new Date();
|
|
122
|
+
/**
|
|
123
|
+
* The Site ID associated with this FreshPack Bin Lot
|
|
124
|
+
*
|
|
125
|
+
* @type {number}
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
_this.siteId = siteId;
|
|
130
|
+
return _this;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Create a new **FreshPackBinLotModel** from a JSON Object or JSON String
|
|
134
|
+
*
|
|
135
|
+
* @static
|
|
136
|
+
* @public
|
|
137
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
138
|
+
* @param {number} siteId The Site ID associated with this FreshPack Bin Lot
|
|
139
|
+
* @return {FreshPackBinLotModel}
|
|
140
|
+
*/
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
_createClass(FreshPackBinLotModel, null, [{
|
|
144
|
+
key: "fromJSON",
|
|
145
|
+
value: function fromJSON(json, siteId) {
|
|
146
|
+
var model = new FreshPackBinLotModel(siteId);
|
|
147
|
+
/**
|
|
148
|
+
* The JSON Object
|
|
149
|
+
*
|
|
150
|
+
* @type {Object<string, any>}
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
var jsonObject = {};
|
|
154
|
+
|
|
155
|
+
if (typeof json === 'string') {
|
|
156
|
+
jsonObject = JSON.parse(json);
|
|
157
|
+
} else if (_typeof(json) === 'object') {
|
|
158
|
+
jsonObject = json;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
if ('id' in jsonObject) {
|
|
162
|
+
model.id = function () {
|
|
163
|
+
if (typeof jsonObject['id'] !== 'string') {
|
|
164
|
+
return String(jsonObject['id']);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return jsonObject['id'];
|
|
168
|
+
}();
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if ('binTipId' in jsonObject) {
|
|
172
|
+
model.binTipId = function () {
|
|
173
|
+
if (typeof jsonObject['binTipId'] !== 'string') {
|
|
174
|
+
return String(jsonObject['binTipId']);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
return jsonObject['binTipId'];
|
|
178
|
+
}();
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
if ('binLotCode' in jsonObject) {
|
|
182
|
+
model.binLotCode = function () {
|
|
183
|
+
if (typeof jsonObject['binLotCode'] !== 'string') {
|
|
184
|
+
return String(jsonObject['binLotCode']);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
return jsonObject['binLotCode'];
|
|
188
|
+
}();
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
if ('createdTimestamp' in jsonObject) {
|
|
192
|
+
model.createdTimestamp = function () {
|
|
193
|
+
if (typeof jsonObject['createdTimestamp'] !== 'string') {
|
|
194
|
+
return new Date(String(jsonObject['createdTimestamp']));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
return new Date(jsonObject['createdTimestamp']);
|
|
198
|
+
}();
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
if ('packrunIds' in jsonObject) {
|
|
202
|
+
model.packrunIds = function () {
|
|
203
|
+
if (Array.isArray(jsonObject['packrunIds']) !== true) {
|
|
204
|
+
return [];
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
return jsonObject['packrunIds'].map(function (packrunIdsItem) {
|
|
208
|
+
return function () {
|
|
209
|
+
if (typeof packrunIdsItem !== 'string') {
|
|
210
|
+
return String(packrunIdsItem);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return packrunIdsItem;
|
|
214
|
+
}();
|
|
215
|
+
});
|
|
216
|
+
}();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if ('binNumbers' in jsonObject) {
|
|
220
|
+
model.binNumbers = function () {
|
|
221
|
+
if (Array.isArray(jsonObject['binNumbers']) !== true) {
|
|
222
|
+
return [];
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return jsonObject['binNumbers'].map(function (binNumbersItem) {
|
|
226
|
+
return function () {
|
|
227
|
+
if (typeof binNumbersItem !== 'string') {
|
|
228
|
+
return String(binNumbersItem);
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
return binNumbersItem;
|
|
232
|
+
}();
|
|
233
|
+
});
|
|
234
|
+
}();
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if ('deleted' in jsonObject) {
|
|
238
|
+
model.deleted = function () {
|
|
239
|
+
if (typeof jsonObject['deleted'] !== 'boolean') {
|
|
240
|
+
return Boolean(jsonObject['deleted']);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return jsonObject['deleted'];
|
|
244
|
+
}();
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if ('updateTimestamp' in jsonObject) {
|
|
248
|
+
model.updateTimestamp = function () {
|
|
249
|
+
if (typeof jsonObject['updateTimestamp'] !== 'string') {
|
|
250
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
254
|
+
}();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
return model;
|
|
258
|
+
}
|
|
259
|
+
}]);
|
|
260
|
+
|
|
261
|
+
return FreshPackBinLotModel;
|
|
262
|
+
}(_BaseModel2.default);
|
|
263
|
+
|
|
264
|
+
var _default = FreshPackBinLotModel;
|
|
265
|
+
exports.default = _default;
|
|
@@ -0,0 +1,341 @@
|
|
|
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 FreshPack Fruit Temperature
|
|
36
|
+
*
|
|
37
|
+
* @class
|
|
38
|
+
* @hideconstructor
|
|
39
|
+
* @extends BaseModel
|
|
40
|
+
*/
|
|
41
|
+
var FreshPackFruitTemperatureModel = /*#__PURE__*/function (_BaseModel) {
|
|
42
|
+
_inherits(FreshPackFruitTemperatureModel, _BaseModel);
|
|
43
|
+
|
|
44
|
+
var _super = _createSuper(FreshPackFruitTemperatureModel);
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* FreshPackFruitTemperatureModel Constructor
|
|
48
|
+
*
|
|
49
|
+
* @protected
|
|
50
|
+
* @param {number} siteId The Site ID associated with this FreshPack Fruit Temperature
|
|
51
|
+
*/
|
|
52
|
+
function FreshPackFruitTemperatureModel(siteId) {
|
|
53
|
+
var _this;
|
|
54
|
+
|
|
55
|
+
_classCallCheck(this, FreshPackFruitTemperatureModel);
|
|
56
|
+
|
|
57
|
+
_this = _super.call(this);
|
|
58
|
+
/**
|
|
59
|
+
* The FreshPack Fruit Temperature ID
|
|
60
|
+
*
|
|
61
|
+
* @type {string}
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
_this.id = "";
|
|
66
|
+
/**
|
|
67
|
+
* The Bin Tip ID this Fruit Temperature is associated with
|
|
68
|
+
*
|
|
69
|
+
* @type {string}
|
|
70
|
+
* @public
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
_this.binTipId = "";
|
|
74
|
+
/**
|
|
75
|
+
* The Fresh Pack Bin Lot ID this Fruit Temperature is associated with
|
|
76
|
+
*
|
|
77
|
+
* @type {string}
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
|
|
81
|
+
_this.freshPackBinLotId = "";
|
|
82
|
+
/**
|
|
83
|
+
* When this Fruit Temperature was Created
|
|
84
|
+
*
|
|
85
|
+
* @type {Date}
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
|
|
89
|
+
_this.createdTimestamp = new Date();
|
|
90
|
+
/**
|
|
91
|
+
* The Temperature of the Fruit
|
|
92
|
+
*
|
|
93
|
+
* @type {number}
|
|
94
|
+
* @public
|
|
95
|
+
*/
|
|
96
|
+
|
|
97
|
+
_this.temperature = 0;
|
|
98
|
+
/**
|
|
99
|
+
* The Packrun ID associated with this Fruit Temperature
|
|
100
|
+
*
|
|
101
|
+
* @type {string}
|
|
102
|
+
* @public
|
|
103
|
+
*/
|
|
104
|
+
|
|
105
|
+
_this.packrunId = "";
|
|
106
|
+
/**
|
|
107
|
+
* Result from Interacting with the FreshPack API to Send this Fruit Temperature
|
|
108
|
+
*
|
|
109
|
+
* @type {?{requestCount: number, requestTimestamp: ?Date, responseCode: ?number, responseMessage: ?string, completed: boolean}}
|
|
110
|
+
* @public
|
|
111
|
+
*/
|
|
112
|
+
|
|
113
|
+
_this.freshPackFruitTemperatureApi = null;
|
|
114
|
+
/**
|
|
115
|
+
* Whether the FreshPack Fruit Temperature has been deleted
|
|
116
|
+
*
|
|
117
|
+
* @type {boolean}
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
|
|
121
|
+
_this.deleted = false;
|
|
122
|
+
/**
|
|
123
|
+
* When the FreshPack Fruit Temperature was last updated
|
|
124
|
+
*
|
|
125
|
+
* @type {Date}
|
|
126
|
+
* @public
|
|
127
|
+
*/
|
|
128
|
+
|
|
129
|
+
_this.updateTimestamp = new Date();
|
|
130
|
+
/**
|
|
131
|
+
* The Site ID associated with this FreshPack Fruit Temperature
|
|
132
|
+
*
|
|
133
|
+
* @type {number}
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
|
|
137
|
+
_this.siteId = siteId;
|
|
138
|
+
return _this;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Create a new **FreshPackFruitTemperatureModel** from a JSON Object or JSON String
|
|
142
|
+
*
|
|
143
|
+
* @static
|
|
144
|
+
* @public
|
|
145
|
+
* @param {Object<string, any>|string} json A JSON Object or JSON String
|
|
146
|
+
* @param {number} siteId The Site ID associated with this FreshPack Fruit Temperature
|
|
147
|
+
* @return {FreshPackFruitTemperatureModel}
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
_createClass(FreshPackFruitTemperatureModel, null, [{
|
|
152
|
+
key: "fromJSON",
|
|
153
|
+
value: function fromJSON(json, siteId) {
|
|
154
|
+
var model = new FreshPackFruitTemperatureModel(siteId);
|
|
155
|
+
/**
|
|
156
|
+
* The JSON Object
|
|
157
|
+
*
|
|
158
|
+
* @type {Object<string, any>}
|
|
159
|
+
*/
|
|
160
|
+
|
|
161
|
+
var jsonObject = {};
|
|
162
|
+
|
|
163
|
+
if (typeof json === 'string') {
|
|
164
|
+
jsonObject = JSON.parse(json);
|
|
165
|
+
} else if (_typeof(json) === 'object') {
|
|
166
|
+
jsonObject = json;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
if ('id' in jsonObject) {
|
|
170
|
+
model.id = function () {
|
|
171
|
+
if (typeof jsonObject['id'] !== 'string') {
|
|
172
|
+
return String(jsonObject['id']);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
return jsonObject['id'];
|
|
176
|
+
}();
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
if ('binTipId' in jsonObject) {
|
|
180
|
+
model.binTipId = function () {
|
|
181
|
+
if (typeof jsonObject['binTipId'] !== 'string') {
|
|
182
|
+
return String(jsonObject['binTipId']);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
return jsonObject['binTipId'];
|
|
186
|
+
}();
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
if ('freshPackBinLotId' in jsonObject) {
|
|
190
|
+
model.freshPackBinLotId = function () {
|
|
191
|
+
if (typeof jsonObject['freshPackBinLotId'] !== 'string') {
|
|
192
|
+
return String(jsonObject['freshPackBinLotId']);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
return jsonObject['freshPackBinLotId'];
|
|
196
|
+
}();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
if ('createdTimestamp' in jsonObject) {
|
|
200
|
+
model.createdTimestamp = function () {
|
|
201
|
+
if (typeof jsonObject['createdTimestamp'] !== 'string') {
|
|
202
|
+
return new Date(String(jsonObject['createdTimestamp']));
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
return new Date(jsonObject['createdTimestamp']);
|
|
206
|
+
}();
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if ('temperature' in jsonObject) {
|
|
210
|
+
model.temperature = function () {
|
|
211
|
+
if (typeof jsonObject['temperature'] !== 'number') {
|
|
212
|
+
return Number(jsonObject['temperature']);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
return jsonObject['temperature'];
|
|
216
|
+
}();
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
if ('packrunId' in jsonObject) {
|
|
220
|
+
model.packrunId = function () {
|
|
221
|
+
if (typeof jsonObject['packrunId'] !== 'string') {
|
|
222
|
+
return String(jsonObject['packrunId']);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return jsonObject['packrunId'];
|
|
226
|
+
}();
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
if ('freshPackFruitTemperatureApi' in jsonObject) {
|
|
230
|
+
model.freshPackFruitTemperatureApi = function () {
|
|
231
|
+
if (jsonObject['freshPackFruitTemperatureApi'] === null) {
|
|
232
|
+
return null;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
var freshPackFruitTemperatureApiObject = {};
|
|
236
|
+
|
|
237
|
+
if (_typeof(jsonObject['freshPackFruitTemperatureApi']) === 'object' && 'requestCount' in jsonObject['freshPackFruitTemperatureApi']) {
|
|
238
|
+
freshPackFruitTemperatureApiObject.requestCount = function () {
|
|
239
|
+
if (typeof jsonObject['freshPackFruitTemperatureApi'].requestCount !== 'number') {
|
|
240
|
+
return Number.isInteger(Number(jsonObject['freshPackFruitTemperatureApi'].requestCount)) ? Number(jsonObject['freshPackFruitTemperatureApi'].requestCount) : Math.floor(Number(jsonObject['freshPackFruitTemperatureApi'].requestCount));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
return Number.isInteger(jsonObject['freshPackFruitTemperatureApi'].requestCount) ? jsonObject['freshPackFruitTemperatureApi'].requestCount : Math.floor(jsonObject['freshPackFruitTemperatureApi'].requestCount);
|
|
244
|
+
}();
|
|
245
|
+
} else {
|
|
246
|
+
freshPackFruitTemperatureApiObject.requestCount = 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (_typeof(jsonObject['freshPackFruitTemperatureApi']) === 'object' && 'requestTimestamp' in jsonObject['freshPackFruitTemperatureApi']) {
|
|
250
|
+
freshPackFruitTemperatureApiObject.requestTimestamp = function () {
|
|
251
|
+
if (jsonObject['freshPackFruitTemperatureApi'].requestTimestamp === null) {
|
|
252
|
+
return null;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
if (typeof jsonObject['freshPackFruitTemperatureApi'].requestTimestamp !== 'string') {
|
|
256
|
+
return new Date(String(jsonObject['freshPackFruitTemperatureApi'].requestTimestamp));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
return new Date(jsonObject['freshPackFruitTemperatureApi'].requestTimestamp);
|
|
260
|
+
}();
|
|
261
|
+
} else {
|
|
262
|
+
freshPackFruitTemperatureApiObject.requestTimestamp = null;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
if (_typeof(jsonObject['freshPackFruitTemperatureApi']) === 'object' && 'responseCode' in jsonObject['freshPackFruitTemperatureApi']) {
|
|
266
|
+
freshPackFruitTemperatureApiObject.responseCode = function () {
|
|
267
|
+
if (jsonObject['freshPackFruitTemperatureApi'].responseCode === null) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (typeof jsonObject['freshPackFruitTemperatureApi'].responseCode !== 'number') {
|
|
272
|
+
return Number.isInteger(Number(jsonObject['freshPackFruitTemperatureApi'].responseCode)) ? Number(jsonObject['freshPackFruitTemperatureApi'].responseCode) : Math.floor(Number(jsonObject['freshPackFruitTemperatureApi'].responseCode));
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
return Number.isInteger(jsonObject['freshPackFruitTemperatureApi'].responseCode) ? jsonObject['freshPackFruitTemperatureApi'].responseCode : Math.floor(jsonObject['freshPackFruitTemperatureApi'].responseCode);
|
|
276
|
+
}();
|
|
277
|
+
} else {
|
|
278
|
+
freshPackFruitTemperatureApiObject.responseCode = null;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
if (_typeof(jsonObject['freshPackFruitTemperatureApi']) === 'object' && 'responseMessage' in jsonObject['freshPackFruitTemperatureApi']) {
|
|
282
|
+
freshPackFruitTemperatureApiObject.responseMessage = function () {
|
|
283
|
+
if (jsonObject['freshPackFruitTemperatureApi'].responseMessage === null) {
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
if (typeof jsonObject['freshPackFruitTemperatureApi'].responseMessage !== 'string') {
|
|
288
|
+
return String(jsonObject['freshPackFruitTemperatureApi'].responseMessage);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
return jsonObject['freshPackFruitTemperatureApi'].responseMessage;
|
|
292
|
+
}();
|
|
293
|
+
} else {
|
|
294
|
+
freshPackFruitTemperatureApiObject.responseMessage = null;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (_typeof(jsonObject['freshPackFruitTemperatureApi']) === 'object' && 'completed' in jsonObject['freshPackFruitTemperatureApi']) {
|
|
298
|
+
freshPackFruitTemperatureApiObject.completed = function () {
|
|
299
|
+
if (typeof jsonObject['freshPackFruitTemperatureApi'].completed !== 'boolean') {
|
|
300
|
+
return Boolean(jsonObject['freshPackFruitTemperatureApi'].completed);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return jsonObject['freshPackFruitTemperatureApi'].completed;
|
|
304
|
+
}();
|
|
305
|
+
} else {
|
|
306
|
+
freshPackFruitTemperatureApiObject.completed = false;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
return freshPackFruitTemperatureApiObject;
|
|
310
|
+
}();
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
if ('deleted' in jsonObject) {
|
|
314
|
+
model.deleted = function () {
|
|
315
|
+
if (typeof jsonObject['deleted'] !== 'boolean') {
|
|
316
|
+
return Boolean(jsonObject['deleted']);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return jsonObject['deleted'];
|
|
320
|
+
}();
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if ('updateTimestamp' in jsonObject) {
|
|
324
|
+
model.updateTimestamp = function () {
|
|
325
|
+
if (typeof jsonObject['updateTimestamp'] !== 'string') {
|
|
326
|
+
return new Date(String(jsonObject['updateTimestamp']));
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
return new Date(jsonObject['updateTimestamp']);
|
|
330
|
+
}();
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return model;
|
|
334
|
+
}
|
|
335
|
+
}]);
|
|
336
|
+
|
|
337
|
+
return FreshPackFruitTemperatureModel;
|
|
338
|
+
}(_BaseModel2.default);
|
|
339
|
+
|
|
340
|
+
var _default = FreshPackFruitTemperatureModel;
|
|
341
|
+
exports.default = _default;
|