@ricado/api-client 2.4.1 → 2.5.0

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 (32) hide show
  1. package/dist/ricado.api.client.js +1 -1
  2. package/lib/Controllers/Lab/Site/FruitProfileController.js +12 -9
  3. package/lib/Controllers/Lab/Site/ProbeCalibrationController.js +921 -0
  4. package/lib/Controllers/Lab/Site/RackPositionController.js +2 -2
  5. package/lib/Controllers/Lab/Site/SampleController.js +15 -15
  6. package/lib/Controllers/Lab/Site/SampleResultController.js +29 -27
  7. package/lib/Controllers/Lab/Site/index.js +3 -3
  8. package/lib/Models/Lab/Site/FruitProfileModel.js +22 -4
  9. package/lib/Models/Lab/Site/{SampleFailureReasonModel.js → ProbeCalibrationModel.js} +141 -33
  10. package/lib/Models/Lab/Site/RackPositionModel.js +67 -15
  11. package/lib/Models/Lab/Site/SampleModel.js +51 -73
  12. package/lib/Models/Lab/Site/SampleResultModel.js +45 -23
  13. package/lib/Models/Lab/Site/index.js +3 -3
  14. package/lib/PackageVersion.js +1 -1
  15. package/lib/index.d.ts +577 -305
  16. package/package.json +1 -1
  17. package/src/Controllers/Lab/Site/FruitProfileController.js +12 -9
  18. package/src/Controllers/Lab/Site/ProbeCalibrationController.js +1052 -0
  19. package/src/Controllers/Lab/Site/RackPositionController.js +2 -2
  20. package/src/Controllers/Lab/Site/SampleController.js +15 -15
  21. package/src/Controllers/Lab/Site/SampleResultController.js +29 -27
  22. package/src/Controllers/Lab/Site/index.js +2 -2
  23. package/src/Models/Lab/Site/FruitProfileModel.js +24 -4
  24. package/src/Models/Lab/Site/ProbeCalibrationModel.js +290 -0
  25. package/src/Models/Lab/Site/RackPositionModel.js +87 -15
  26. package/src/Models/Lab/Site/SampleModel.js +57 -82
  27. package/src/Models/Lab/Site/SampleResultModel.js +48 -23
  28. package/src/Models/Lab/Site/index.js +2 -2
  29. package/src/PackageVersion.js +1 -1
  30. package/lib/Controllers/Lab/Site/SampleFailureReasonController.js +0 -192
  31. package/src/Controllers/Lab/Site/SampleFailureReasonController.js +0 -169
  32. package/src/Models/Lab/Site/SampleFailureReasonModel.js +0 -170
@@ -162,7 +162,7 @@ export default RackPositionController;
162
162
  * @typedef {Object} RackPositionController.CreateData
163
163
  * @property {?number} [rtuId] The RTU this Rack Position belongs to
164
164
  * @property {string} name The Name of this Rack Position
165
- * @property {{pushButton: number, indicatorLight: number, temperature: number, calibrationOffset: number, disabled: number, currentSampleId: number, currentSampleStatus: number, nextSampleId: number, startCurrentSampleRequest: number, finishCurrentSampleRequest: number, currentSampleTotalDuration: number, currentSampleWarmUpDuration: number, currentSampleWarmUpCompleted: number, currentSampleBelowTargetDuration: number, currentSampleAboveTargetDuration: number, currentSampleWithinTargetDuration: number, currentSampleSuccessCriteriaMet: number, currentSampleFailureCriteriaMet: number}} points The Points used by this Rack Position
165
+ * @property {{pushButton: number, indicatorLight: number, temperature: number, calibrationOffset: number, disabled: number, currentSampleId: number, currentSampleStatus: number, nextSampleId: number, loadCurrentSampleRequest: number, startCurrentSampleRequest: number, finishCurrentSampleRequest: number, unloadCurrentSampleRequest: number, currentSampleTotalDuration: number, currentSampleWarmUpDuration: number, currentSampleWarmUpRateOfChange: number, currentSampleWarmUpWarning: number, currentSampleWarmUpCompleted: number, currentSampleBelowTargetDuration: number, currentSampleAboveTargetDuration: number, currentSampleWithinTargetDuration: number, currentSampleFinishCriteriaMet: number, currentSampleLatestUnloadTimestamp: number}} points The Points used by this Rack Position
166
166
  * @property {string} labId The Lab that owns this Rack Position
167
167
  * @property {string} rackId The Rack associated with this Rack Position
168
168
  * @property {number} verticalLevelIndex The Index of the Vertical Level in the Rack where this Position resides
@@ -175,7 +175,7 @@ export default RackPositionController;
175
175
  *
176
176
  * @typedef {Object} RackPositionController.UpdateData
177
177
  * @property {string} [name] The Name of this Rack Position
178
- * @property {{pushButton: number, indicatorLight: number, temperature: number, calibrationOffset: number, disabled: number, currentSampleId: number, currentSampleStatus: number, nextSampleId: number, startCurrentSampleRequest: number, finishCurrentSampleRequest: number, currentSampleTotalDuration: number, currentSampleWarmUpDuration: number, currentSampleWarmUpCompleted: number, currentSampleBelowTargetDuration: number, currentSampleAboveTargetDuration: number, currentSampleWithinTargetDuration: number, currentSampleSuccessCriteriaMet: number, currentSampleFailureCriteriaMet: number}} [points] The Points used by this Rack Position
178
+ * @property {{pushButton: number, indicatorLight: number, temperature: number, calibrationOffset: number, disabled: number, currentSampleId: number, currentSampleStatus: number, nextSampleId: number, loadCurrentSampleRequest: number, startCurrentSampleRequest: number, finishCurrentSampleRequest: number, unloadCurrentSampleRequest: number, currentSampleTotalDuration: number, currentSampleWarmUpDuration: number, currentSampleWarmUpRateOfChange: number, currentSampleWarmUpWarning: number, currentSampleWarmUpCompleted: number, currentSampleBelowTargetDuration: number, currentSampleAboveTargetDuration: number, currentSampleWithinTargetDuration: number, currentSampleFinishCriteriaMet: number, currentSampleLatestUnloadTimestamp: number}} [points] The Points used by this Rack Position
179
179
  * @property {string} [labId] The Lab that owns this Rack Position
180
180
  * @property {string} [rackId] The Rack associated with this Rack Position
181
181
  * @property {number} [verticalLevelIndex] The Index of the Vertical Level in the Rack where this Position resides
@@ -1054,28 +1054,30 @@ export default SampleController;
1054
1054
  * @property {string} [labId] The Lab ID this Sample is associated with
1055
1055
  * @property {string} [sampleNumber] The Numeric Sample Number
1056
1056
  * @property {string} [createdSource] The Source that Created this Sample
1057
- * @property {?string} [createdUserId] ID of the User who Created this Sample. Only applies if the `createdSource` is 'System'
1058
- * @property {?string} [createdUserName] Name of the User who Created this Sample. Only applies if the `createdSource` is 'System'
1059
- * @property {?string} [publishUserId] ID of the User who Published this Sample
1057
+ * @property {?string} [createdUserName] Name of the User who Created this Sample
1058
+ * @property {?string} [publishSource] The Source that Published this Sample
1060
1059
  * @property {?string} [publishUserName] Name of the User who Published this Sample
1061
1060
  * @property {string} [fruitProfileId] The Fruit Profile for this Sample
1062
1061
  * @property {string} [rackPositionId] The Rack Position used for this Sample
1063
1062
  * @property {string} [dehydratorId] The Dehydrator used for this Sample
1064
- * @property {?string} [outcome] The Outcome of this Sample
1065
- * @property {?string} [failureReasonId] A Sample Failure Reason ID if this Sample Failed
1066
1063
  * @property {?string} [resultId] The Sample Result ID asociated with this Sample
1067
1064
  * @property {Date} [createdTimestampBegin] Filter by the Timestamp when Samples were Created. Results Greater than or Equal to Timestamp
1068
1065
  * @property {Date} [createdTimestampEnd] Filter by the Timestamp when Samples were Created. Results Less than or Equal to Timestamp
1069
1066
  * @property {Date} [scheduledTimestampBegin] Filter by the Timestamp when Samples were Scheduled to Begin. Results Greater than or Equal to Timestamp
1070
1067
  * @property {Date} [scheduledTimestampEnd] Filter by the Timestamp when Samples were Scheduled to Begin. Results Less than or Equal to Timestamp
1068
+ * @property {Date} [loadedTimestampBegin] Filter by the Timestamp when Samples were Loaded. Results Greater than or Equal to Timestamp
1069
+ * @property {Date} [loadedTimestampEnd] Filter by the Timestamp when Samples were Loaded. Results Less than or Equal to Timestamp
1071
1070
  * @property {Date} [startTimestampBegin] Filter by the Timestamp when Samples were Started. Results Greater than or Equal to Timestamp
1072
1071
  * @property {Date} [startTimestampEnd] Filter by the Timestamp when Samples were Started. Results Less than or Equal to Timestamp
1073
1072
  * @property {Date} [finishTimestampBegin] Filter by the Timestamp when Samples were Finished. Results Greater than or Equal to Timestamp
1074
1073
  * @property {Date} [finishTimestampEnd] Filter by the Timestamp when Samples were Finished. Results Less than or Equal to Timestamp
1074
+ * @property {Date} [unloadedTimestampBegin] Filter by the Timestamp when Samples were Unloaded. Results Greater than or Equal to Timestamp
1075
+ * @property {Date} [unloadedTimestampEnd] Filter by the Timestamp when Samples were Unloaded. Results Less than or Equal to Timestamp
1075
1076
  * @property {Date} [publishTimestampBegin] Filter by the Timestamp when Samples were Published. Results Greater than or Equal to Timestamp
1076
1077
  * @property {Date} [publishTimestampEnd] Filter by the Timestamp when Samples were Published. Results Less than or Equal to Timestamp
1077
1078
  * @property {Date} [updateTimestampBegin] Filter by the Timestamp when Samples were last Updated. Results Greater than or Equal to Timestamp
1078
1079
  * @property {Date} [updateTimestampEnd] Filter by the Timestamp when Samples were last Updated. Results Less than or Equal to Timestamp
1080
+ * @property {boolean} [publishedState] Filter by Published State of a Sample. `true` = Published, `false` = Not Published
1079
1081
  * @memberof Controllers.Lab.Site
1080
1082
  */
1081
1083
 
@@ -1087,19 +1089,18 @@ export default SampleController;
1087
1089
  * @property {string} [sampleNumber] The Numeric Sample Number
1088
1090
  * @property {Date} [createdTimestamp] When this Sample was Created
1089
1091
  * @property {string} createdSource The Source that Created this Sample
1090
- * @property {?string} [createdUserId] ID of the User who Created this Sample. Only applies if the `createdSource` is 'System'
1091
- * @property {?string} [createdUserName] Name of the User who Created this Sample. Only applies if the `createdSource` is 'System'
1092
+ * @property {?string} [createdUserName] Name of the User who Created this Sample
1092
1093
  * @property {?Date} [scheduledTimestamp] Optional Scheduled Timestamp when this Sample should Begin
1094
+ * @property {?Date} [loadedTimestamp] When this Sample was Loaded into the Dehydrator
1093
1095
  * @property {?Date} [startTimestamp] When this Sample was Started
1094
1096
  * @property {?Date} [finishTimestamp] When this Sample was Finished
1097
+ * @property {?Date} [unloadedTimestamp] When this Sample was Unloaded from the Dehydrator
1095
1098
  * @property {?Date} [publishTimestamp] When this Sample was Published
1096
- * @property {?string} [publishUserId] ID of the User who Published this Sample
1099
+ * @property {?string} [publishSource] The Source that Published this Sample
1097
1100
  * @property {?string} [publishUserName] Name of the User who Published this Sample
1098
1101
  * @property {string} fruitProfileId The Fruit Profile for this Sample
1099
1102
  * @property {string} rackPositionId The Rack Position used for this Sample
1100
1103
  * @property {string} dehydratorId The Dehydrator used for this Sample
1101
- * @property {?string} [outcome] The Outcome of this Sample
1102
- * @property {?string} [failureReasonId] A Sample Failure Reason ID if this Sample Failed
1103
1104
  * @property {?string} [resultId] The Sample Result ID asociated with this Sample
1104
1105
  * @memberof Controllers.Lab.Site
1105
1106
  */
@@ -1111,19 +1112,18 @@ export default SampleController;
1111
1112
  * @property {string} [labId] The Lab ID this Sample is associated with
1112
1113
  * @property {Date} [createdTimestamp] When this Sample was Created
1113
1114
  * @property {string} [createdSource] The Source that Created this Sample
1114
- * @property {?string} [createdUserId] ID of the User who Created this Sample. Only applies if the `createdSource` is 'System'
1115
- * @property {?string} [createdUserName] Name of the User who Created this Sample. Only applies if the `createdSource` is 'System'
1115
+ * @property {?string} [createdUserName] Name of the User who Created this Sample
1116
1116
  * @property {?Date} [scheduledTimestamp] Optional Scheduled Timestamp when this Sample should Begin
1117
+ * @property {?Date} [loadedTimestamp] When this Sample was Loaded into the Dehydrator
1117
1118
  * @property {?Date} [startTimestamp] When this Sample was Started
1118
1119
  * @property {?Date} [finishTimestamp] When this Sample was Finished
1120
+ * @property {?Date} [unloadedTimestamp] When this Sample was Unloaded from the Dehydrator
1119
1121
  * @property {?Date} [publishTimestamp] When this Sample was Published
1120
- * @property {?string} [publishUserId] ID of the User who Published this Sample
1122
+ * @property {?string} [publishSource] The Source that Published this Sample
1121
1123
  * @property {?string} [publishUserName] Name of the User who Published this Sample
1122
1124
  * @property {string} [fruitProfileId] The Fruit Profile for this Sample
1123
1125
  * @property {string} [rackPositionId] The Rack Position used for this Sample
1124
1126
  * @property {string} [dehydratorId] The Dehydrator used for this Sample
1125
- * @property {?string} [outcome] The Outcome of this Sample
1126
- * @property {?string} [failureReasonId] A Sample Failure Reason ID if this Sample Failed
1127
1127
  * @property {?string} [resultId] The Sample Result ID asociated with this Sample
1128
1128
  * @memberof Controllers.Lab.Site
1129
1129
  */
@@ -8,19 +8,19 @@ import RequestHelper from '../../../RequestHelper';
8
8
  import SampleResultModel from '../../../Models/Lab/Site/SampleResultModel';
9
9
 
10
10
  /**
11
- * Controller Class for Sample Resultss
11
+ * Controller Class for Sample Results
12
12
  *
13
13
  * @class
14
14
  */
15
15
  class SampleResultController
16
16
  {
17
17
  /**
18
- * Retrieve a Sample Results [GET /lab/sites/{siteId}/sample-results/{id}]
18
+ * Retrieve a Sample Result [GET /lab/sites/{siteId}/sample-results/{id}]
19
19
  *
20
20
  * @static
21
21
  * @public
22
22
  * @param {number} siteId The Site ID
23
- * @param {string} id The Sample Results ID
23
+ * @param {string} id The Sample Result ID
24
24
  * @return {Promise<SampleResultModel>}
25
25
  */
26
26
  static getOne(siteId, id)
@@ -39,13 +39,13 @@ class SampleResultController
39
39
  }
40
40
 
41
41
  /**
42
- * Update a Sample Results [PATCH /lab/sites/{siteId}/sample-results/{id}]
42
+ * Update a Sample Result [PATCH /lab/sites/{siteId}/sample-results/{id}]
43
43
  *
44
44
  * @static
45
45
  * @public
46
46
  * @param {number} siteId The Site ID
47
- * @param {string} id The Sample Results ID
48
- * @param {SampleResultController.UpdateData} updateData The Sample Results Update Data
47
+ * @param {string} id The Sample Result ID
48
+ * @param {SampleResultController.UpdateData} updateData The Sample Result Update Data
49
49
  * @return {Promise<SampleResultModel>}
50
50
  */
51
51
  static update(siteId, id, updateData)
@@ -64,12 +64,12 @@ class SampleResultController
64
64
  }
65
65
 
66
66
  /**
67
- * Delete a Sample Results [DELETE /lab/sites/{siteId}/sample-results/{id}]
67
+ * Delete a Sample Result [DELETE /lab/sites/{siteId}/sample-results/{id}]
68
68
  *
69
69
  * @static
70
70
  * @public
71
71
  * @param {number} siteId The Site ID
72
- * @param {string} id The Sample Results ID
72
+ * @param {string} id The Sample Result ID
73
73
  * @return {Promise<boolean>}
74
74
  */
75
75
  static delete(siteId, id)
@@ -86,12 +86,12 @@ class SampleResultController
86
86
  /**
87
87
  * Retrieve Comments [GET /lab/sites/{siteId}/sample-results/{id}/comments]
88
88
  *
89
- * Retrieves Comments for a Sample Results
89
+ * Retrieves Comments for a Sample Result
90
90
  *
91
91
  * @static
92
92
  * @public
93
93
  * @param {number} siteId The Site ID
94
- * @param {string} id The Sample Results ID
94
+ * @param {string} id The Sample Result ID
95
95
  * @return {Promise<Array<SampleResultController.CommentItem>>}
96
96
  */
97
97
  static getComments(siteId, id)
@@ -288,12 +288,12 @@ class SampleResultController
288
288
  /**
289
289
  * Create a Comment [POST /lab/sites/{siteId}/sample-results/{id}/comments]
290
290
  *
291
- * Create a Comment for a Sample Results
291
+ * Create a Comment for a Sample Result
292
292
  *
293
293
  * @static
294
294
  * @public
295
295
  * @param {number} siteId The Site ID
296
- * @param {string} id The Sample Results ID
296
+ * @param {string} id The Sample Result ID
297
297
  * @param {string} content The Content of the New Comment
298
298
  * @return {Promise<SampleResultController.CommentItem>}
299
299
  */
@@ -482,12 +482,12 @@ class SampleResultController
482
482
  /**
483
483
  * Retrieve a Comment [GET /lab/sites/{siteId}/sample-results/{id}/comments/{commentId}]
484
484
  *
485
- * Retrieves Comments for a Sample Results
485
+ * Retrieves Comments for a Sample Result
486
486
  *
487
487
  * @static
488
488
  * @public
489
489
  * @param {number} siteId The Site ID
490
- * @param {string} id The Sample Results ID
490
+ * @param {string} id The Sample Result ID
491
491
  * @param {string} commentId The Comment ID
492
492
  * @return {Promise<SampleResultController.CommentItem>}
493
493
  */
@@ -676,12 +676,12 @@ class SampleResultController
676
676
  /**
677
677
  * Update a Comment [PATCH /lab/sites/{siteId}/sample-results/{id}/comments/{commentId}]
678
678
  *
679
- * Update a Comment for a Sample Results
679
+ * Update a Comment for a Sample Result
680
680
  *
681
681
  * @static
682
682
  * @public
683
683
  * @param {number} siteId The Site ID
684
- * @param {string} id The Sample Results ID
684
+ * @param {string} id The Sample Result ID
685
685
  * @param {string} commentId The Comment ID
686
686
  * @param {string} content The Updated Content for the Comment
687
687
  * @return {Promise<SampleResultController.CommentItem>}
@@ -871,12 +871,12 @@ class SampleResultController
871
871
  /**
872
872
  * Delete a Comment [DELETE /lab/sites/{siteId}/sample-results/{id}/comments/{commentId}]
873
873
  *
874
- * Delete a Comment for a Sample Results
874
+ * Delete a Comment for a Sample Result
875
875
  *
876
876
  * @static
877
877
  * @public
878
878
  * @param {number} siteId The Site ID
879
- * @param {string} id The Sample Results ID
879
+ * @param {string} id The Sample Result ID
880
880
  * @param {string} commentId The Comment ID
881
881
  * @return {Promise<boolean>}
882
882
  */
@@ -892,7 +892,7 @@ class SampleResultController
892
892
  }
893
893
 
894
894
  /**
895
- * List all Sample Resultss [GET /lab/sites/{siteId}/sample-results]
895
+ * List all Sample Results [GET /lab/sites/{siteId}/sample-results]
896
896
  *
897
897
  * @static
898
898
  * @public
@@ -925,12 +925,12 @@ class SampleResultController
925
925
  }
926
926
 
927
927
  /**
928
- * Create a Sample Results [POST /lab/sites/{siteId}/sample-results]
928
+ * Create a Sample Result [POST /lab/sites/{siteId}/sample-results]
929
929
  *
930
930
  * @static
931
931
  * @public
932
932
  * @param {number} siteId The Site ID
933
- * @param {SampleResultController.CreateData} createData The Sample Results Create Data
933
+ * @param {SampleResultController.CreateData} createData The Sample Result Create Data
934
934
  * @return {Promise<SampleResultModel>}
935
935
  */
936
936
  static create(siteId, createData)
@@ -963,7 +963,7 @@ export default SampleResultController;
963
963
  */
964
964
 
965
965
  /**
966
- * The Create Data for a Sample Results
966
+ * The Create Data for a Sample Result
967
967
  *
968
968
  * @typedef {Object} SampleResultController.CreateData
969
969
  * @property {string} labId The Lab ID this Sample Result is associated with
@@ -975,9 +975,10 @@ export default SampleResultController;
975
975
  * @property {number} belowTargetDuration The Below Temperature Target Duration (in seconds) of the Sample
976
976
  * @property {number} aboveTargetDuration The Above Temperature Target Duration (in seconds) of the Sample
977
977
  * @property {number} withinTargetDuration The Within Temperature Target Duration (in seconds) of the Sample
978
- * @property {?Date} [successCriteriaMetTimestamp] Timestamp of when the Success Criteria was Met for the Sample - `null` if not Met
979
- * @property {?Date} [failureCriteriaMetTimestamp] Timestamp of when the Failure Criteria was Met for the Sample - `null` if not Met
978
+ * @property {?Date} [finishCriteriaMetTimestamp] Timestamp of when the Finish Criteria was Met for the Sample - `null` if not Met
979
+ * @property {?Date} [latestUnloadTimestamp] Latest Possible Timestamp of when the Sample should have been Unloaded to remain Compliant
980
980
  * @property {?number} [totalAverageTemperature] The Average Temperature for the Total Duration of the Sample
981
+ * @property {?number} [warmUpRateOfChangeTemperature] The Average Temperature Rate-of-Change seen during the Warm Up process for the Sample
981
982
  * @property {?number} [belowTargetMinimumTemperature] The Minimum Temperature seen Below the Temperature Target for the Sample
982
983
  * @property {?number} [belowTargetAverageTemperature] The Average Temperature seen Below the Temperature Target for the Sample
983
984
  * @property {?number} [aboveTargetMaximumTemperature] The Maximum Temperature seen Above the Temperature Target for the Sample
@@ -989,7 +990,7 @@ export default SampleResultController;
989
990
  */
990
991
 
991
992
  /**
992
- * The Update Data for a Sample Results
993
+ * The Update Data for a Sample Result
993
994
  *
994
995
  * @typedef {Object} SampleResultController.UpdateData
995
996
  * @property {string} [labId] The Lab ID this Sample Result is associated with
@@ -1000,9 +1001,10 @@ export default SampleResultController;
1000
1001
  * @property {number} [belowTargetDuration] The Below Temperature Target Duration (in seconds) of the Sample
1001
1002
  * @property {number} [aboveTargetDuration] The Above Temperature Target Duration (in seconds) of the Sample
1002
1003
  * @property {number} [withinTargetDuration] The Within Temperature Target Duration (in seconds) of the Sample
1003
- * @property {?Date} [successCriteriaMetTimestamp] Timestamp of when the Success Criteria was Met for the Sample - `null` if not Met
1004
- * @property {?Date} [failureCriteriaMetTimestamp] Timestamp of when the Failure Criteria was Met for the Sample - `null` if not Met
1004
+ * @property {?Date} [finishCriteriaMetTimestamp] Timestamp of when the Finish Criteria was Met for the Sample - `null` if not Met
1005
+ * @property {?Date} [latestUnloadTimestamp] Latest Possible Timestamp of when the Sample should have been Unloaded to remain Compliant
1005
1006
  * @property {?number} [totalAverageTemperature] The Average Temperature for the Total Duration of the Sample
1007
+ * @property {?number} [warmUpRateOfChangeTemperature] The Average Temperature Rate-of-Change seen during the Warm Up process for the Sample
1006
1008
  * @property {?number} [belowTargetMinimumTemperature] The Minimum Temperature seen Below the Temperature Target for the Sample
1007
1009
  * @property {?number} [belowTargetAverageTemperature] The Average Temperature seen Below the Temperature Target for the Sample
1008
1010
  * @property {?number} [aboveTargetMaximumTemperature] The Maximum Temperature seen Above the Temperature Target for the Sample
@@ -10,20 +10,20 @@
10
10
  import DehydratorController from './DehydratorController';
11
11
  import FruitProfileController from './FruitProfileController';
12
12
  import LabController from './LabController';
13
+ import ProbeCalibrationController from './ProbeCalibrationController';
13
14
  import RackController from './RackController';
14
15
  import RackPositionController from './RackPositionController';
15
16
  import SampleController from './SampleController';
16
- import SampleFailureReasonController from './SampleFailureReasonController';
17
17
  import SampleResultController from './SampleResultController';
18
18
 
19
19
  const Site = {
20
20
  DehydratorController,
21
21
  FruitProfileController,
22
22
  LabController,
23
+ ProbeCalibrationController,
23
24
  RackController,
24
25
  RackPositionController,
25
26
  SampleController,
26
- SampleFailureReasonController,
27
27
  SampleResultController,
28
28
  };
29
29
 
@@ -66,7 +66,7 @@ class FruitProfileModel extends BaseModel
66
66
  this.nominalWarmUpDuration = 0;
67
67
 
68
68
  /**
69
- * The Minimum Duration (in seconds) that a Sample should be within the Min and Max Target Temperatures be Successful
69
+ * The Minimum Duration (in seconds) that a Sample should be within the Min and Max Target Temperatures to be Compliant
70
70
  *
71
71
  * @type {number}
72
72
  * @public
@@ -74,7 +74,15 @@ class FruitProfileModel extends BaseModel
74
74
  this.minimumWithinTargetDuration = 0;
75
75
 
76
76
  /**
77
- * The Maximum Duration (in seconds) that a Sample should be Dehydrated for before it Fails
77
+ * The Minimum Duration (in seconds) that a Sample must be Dehydrated for to be Compliant
78
+ *
79
+ * @type {number}
80
+ * @public
81
+ */
82
+ this.minimumTotalDuration = 0;
83
+
84
+ /**
85
+ * The Maximum Duration (in seconds) that a Sample can be Dehydrated for before it is Considered Non-Compliant
78
86
  *
79
87
  * @type {number}
80
88
  * @public
@@ -82,7 +90,7 @@ class FruitProfileModel extends BaseModel
82
90
  this.maximumTotalDuration = 0;
83
91
 
84
92
  /**
85
- * The Minimum Target Temperature for a Sample to be Successful
93
+ * The Minimum Target Temperature for a Sample to be Compliant
86
94
  *
87
95
  * @type {number}
88
96
  * @public
@@ -90,7 +98,7 @@ class FruitProfileModel extends BaseModel
90
98
  this.minimumTargetTemperature = 0;
91
99
 
92
100
  /**
93
- * The Maximum Target Temperature for a Sample to be Successful
101
+ * The Maximum Target Temperature for a Sample to be Compliant
94
102
  *
95
103
  * @type {number}
96
104
  * @public
@@ -223,6 +231,18 @@ class FruitProfileModel extends BaseModel
223
231
  }());
224
232
  }
225
233
 
234
+ if('minimumTotalDuration' in jsonObject)
235
+ {
236
+ model.minimumTotalDuration = (function(){
237
+ if(typeof jsonObject['minimumTotalDuration'] !== 'number')
238
+ {
239
+ return Number.isInteger(Number(jsonObject['minimumTotalDuration'])) ? Number(jsonObject['minimumTotalDuration']) : Math.floor(Number(jsonObject['minimumTotalDuration']));
240
+ }
241
+
242
+ return Number.isInteger(jsonObject['minimumTotalDuration']) ? jsonObject['minimumTotalDuration'] : Math.floor(jsonObject['minimumTotalDuration']);
243
+ }());
244
+ }
245
+
226
246
  if('maximumTotalDuration' in jsonObject)
227
247
  {
228
248
  model.maximumTotalDuration = (function(){
@@ -0,0 +1,290 @@
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 Probe Calibration
11
+ *
12
+ * @class
13
+ * @hideconstructor
14
+ * @extends BaseModel
15
+ */
16
+ class ProbeCalibrationModel extends BaseModel
17
+ {
18
+ /**
19
+ * ProbeCalibrationModel Constructor
20
+ *
21
+ * @protected
22
+ * @param {number} siteId The Site ID associated with this Probe Calibration
23
+ */
24
+ constructor(siteId)
25
+ {
26
+ super();
27
+
28
+ /**
29
+ * The Probe Calibration ID
30
+ *
31
+ * @type {string}
32
+ * @public
33
+ */
34
+ this.id = "";
35
+
36
+ /**
37
+ * The Rack Position ID this Probe Calibration is associated with
38
+ *
39
+ * @type {string}
40
+ * @public
41
+ */
42
+ this.rackPositionId = "";
43
+
44
+ /**
45
+ * When this Probe Calibration was Created
46
+ *
47
+ * @type {Date}
48
+ * @public
49
+ */
50
+ this.createdTimestamp = new Date();
51
+
52
+ /**
53
+ * ID of the User who Completed this Probe Calibration
54
+ *
55
+ * @type {string}
56
+ * @public
57
+ */
58
+ this.userId = "";
59
+
60
+ /**
61
+ * Name of the User who Completed this Probe Calibration
62
+ *
63
+ * @type {string}
64
+ * @public
65
+ */
66
+ this.userName = "";
67
+
68
+ /**
69
+ * The Calibration Offset prior to this Probe Calibration being Created
70
+ *
71
+ * @type {number}
72
+ * @public
73
+ */
74
+ this.preCalibrationOffset = 0;
75
+
76
+ /**
77
+ * The Calibration Offset after this Probe Calibration was Created
78
+ *
79
+ * @type {number}
80
+ * @public
81
+ */
82
+ this.postCalibrationOffset = 0;
83
+
84
+ /**
85
+ * The Temperature Probe reading prior to this Probe Calibration being Created
86
+ *
87
+ * @type {number}
88
+ * @public
89
+ */
90
+ this.preCalibrationTemperature = 0;
91
+
92
+ /**
93
+ * The Temperature Probe reading after this Probe Calibration was Created
94
+ *
95
+ * @type {number}
96
+ * @public
97
+ */
98
+ this.postCalibrationTemperature = 0;
99
+
100
+ /**
101
+ * Whether the Probe Calibration has been deleted
102
+ *
103
+ * @type {boolean}
104
+ * @public
105
+ */
106
+ this.deleted = false;
107
+
108
+ /**
109
+ * When the Probe Calibration was last updated
110
+ *
111
+ * @type {Date}
112
+ * @public
113
+ */
114
+ this.updateTimestamp = new Date();
115
+
116
+ /**
117
+ * The Site ID associated with this Probe Calibration
118
+ *
119
+ * @type {number}
120
+ * @public
121
+ */
122
+ this.siteId = siteId;
123
+ }
124
+
125
+ /**
126
+ * Create a new **ProbeCalibrationModel** from a JSON Object or JSON String
127
+ *
128
+ * @static
129
+ * @public
130
+ * @param {Object<string, any>|string} json A JSON Object or JSON String
131
+ * @param {number} siteId The Site ID associated with this Probe Calibration
132
+ * @return {ProbeCalibrationModel}
133
+ */
134
+ static fromJSON(json, siteId)
135
+ {
136
+ let model = new ProbeCalibrationModel(siteId);
137
+
138
+ /**
139
+ * The JSON Object
140
+ *
141
+ * @type {Object<string, any>}
142
+ */
143
+ let jsonObject = {};
144
+
145
+ if(typeof json === 'string')
146
+ {
147
+ jsonObject = JSON.parse(json);
148
+ }
149
+ else if(typeof json === 'object')
150
+ {
151
+ jsonObject = json;
152
+ }
153
+
154
+ if('id' in jsonObject)
155
+ {
156
+ model.id = (function(){
157
+ if(typeof jsonObject['id'] !== 'string')
158
+ {
159
+ return String(jsonObject['id']);
160
+ }
161
+
162
+ return jsonObject['id'];
163
+ }());
164
+ }
165
+
166
+ if('rackPositionId' in jsonObject)
167
+ {
168
+ model.rackPositionId = (function(){
169
+ if(typeof jsonObject['rackPositionId'] !== 'string')
170
+ {
171
+ return String(jsonObject['rackPositionId']);
172
+ }
173
+
174
+ return jsonObject['rackPositionId'];
175
+ }());
176
+ }
177
+
178
+ if('createdTimestamp' in jsonObject)
179
+ {
180
+ model.createdTimestamp = (function(){
181
+ if(typeof jsonObject['createdTimestamp'] !== 'string')
182
+ {
183
+ return new Date(String(jsonObject['createdTimestamp']));
184
+ }
185
+
186
+ return new Date(jsonObject['createdTimestamp']);
187
+ }());
188
+ }
189
+
190
+ if('userId' in jsonObject)
191
+ {
192
+ model.userId = (function(){
193
+ if(typeof jsonObject['userId'] !== 'string')
194
+ {
195
+ return String(jsonObject['userId']);
196
+ }
197
+
198
+ return jsonObject['userId'];
199
+ }());
200
+ }
201
+
202
+ if('userName' in jsonObject)
203
+ {
204
+ model.userName = (function(){
205
+ if(typeof jsonObject['userName'] !== 'string')
206
+ {
207
+ return String(jsonObject['userName']);
208
+ }
209
+
210
+ return jsonObject['userName'];
211
+ }());
212
+ }
213
+
214
+ if('preCalibrationOffset' in jsonObject)
215
+ {
216
+ model.preCalibrationOffset = (function(){
217
+ if(typeof jsonObject['preCalibrationOffset'] !== 'number')
218
+ {
219
+ return Number(jsonObject['preCalibrationOffset']);
220
+ }
221
+
222
+ return jsonObject['preCalibrationOffset'];
223
+ }());
224
+ }
225
+
226
+ if('postCalibrationOffset' in jsonObject)
227
+ {
228
+ model.postCalibrationOffset = (function(){
229
+ if(typeof jsonObject['postCalibrationOffset'] !== 'number')
230
+ {
231
+ return Number(jsonObject['postCalibrationOffset']);
232
+ }
233
+
234
+ return jsonObject['postCalibrationOffset'];
235
+ }());
236
+ }
237
+
238
+ if('preCalibrationTemperature' in jsonObject)
239
+ {
240
+ model.preCalibrationTemperature = (function(){
241
+ if(typeof jsonObject['preCalibrationTemperature'] !== 'number')
242
+ {
243
+ return Number(jsonObject['preCalibrationTemperature']);
244
+ }
245
+
246
+ return jsonObject['preCalibrationTemperature'];
247
+ }());
248
+ }
249
+
250
+ if('postCalibrationTemperature' in jsonObject)
251
+ {
252
+ model.postCalibrationTemperature = (function(){
253
+ if(typeof jsonObject['postCalibrationTemperature'] !== 'number')
254
+ {
255
+ return Number(jsonObject['postCalibrationTemperature']);
256
+ }
257
+
258
+ return jsonObject['postCalibrationTemperature'];
259
+ }());
260
+ }
261
+
262
+ if('deleted' in jsonObject)
263
+ {
264
+ model.deleted = (function(){
265
+ if(typeof jsonObject['deleted'] !== 'boolean')
266
+ {
267
+ return Boolean(jsonObject['deleted']);
268
+ }
269
+
270
+ return jsonObject['deleted'];
271
+ }());
272
+ }
273
+
274
+ if('updateTimestamp' in jsonObject)
275
+ {
276
+ model.updateTimestamp = (function(){
277
+ if(typeof jsonObject['updateTimestamp'] !== 'string')
278
+ {
279
+ return new Date(String(jsonObject['updateTimestamp']));
280
+ }
281
+
282
+ return new Date(jsonObject['updateTimestamp']);
283
+ }());
284
+ }
285
+
286
+ return model;
287
+ }
288
+ }
289
+
290
+ export default ProbeCalibrationModel;