@justair/justair-library 4.7.6 → 4.7.7
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/package.json +1 -1
- package/src/models/measurements.js +15 -2
package/package.json
CHANGED
|
@@ -2,8 +2,21 @@ import mongoose from "mongoose";
|
|
|
2
2
|
|
|
3
3
|
const correctionSnapshotSchema = new mongoose.Schema(
|
|
4
4
|
{
|
|
5
|
-
equationType:
|
|
6
|
-
|
|
5
|
+
equationType: {
|
|
6
|
+
type: String,
|
|
7
|
+
enum: ['custom', 'linear'],
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
equation: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: function() {
|
|
13
|
+
return this.equationType === 'custom';
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
dateCreated: {
|
|
17
|
+
type: Date,
|
|
18
|
+
default: Date.now,
|
|
19
|
+
},
|
|
7
20
|
},
|
|
8
21
|
{ _id: false } // Not generating separate _id for each correction
|
|
9
22
|
);
|