@justair/justair-library 4.1.0-alpha → 4.1.0-beta
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/monitors.js +34 -34
package/package.json
CHANGED
package/src/models/monitors.js
CHANGED
|
@@ -14,40 +14,6 @@ const parametersEnum = [
|
|
|
14
14
|
"WS And Direction",
|
|
15
15
|
];
|
|
16
16
|
|
|
17
|
-
// Monitor Audit Schema
|
|
18
|
-
const monitorAuditSchema = mongoose.Schema(
|
|
19
|
-
{
|
|
20
|
-
monitorId: { type: mongoose.Types.ObjectId, ref: "Monitors" },
|
|
21
|
-
orgId: { type: mongoose.Types.ObjectId, ref: "Organizations" },
|
|
22
|
-
timeUpdated: Date,
|
|
23
|
-
deletedAt: { type: Date, default: Date.now }, // Only populated on delete
|
|
24
|
-
monitorProperties: Object, // Stores properties of the monitor
|
|
25
|
-
monitorState: String, // Tracks the state of the monitor (e.g., "Deployed", "Maintenance")
|
|
26
|
-
monitorLocation: {
|
|
27
|
-
// Monitor GPS location (lat, lon)
|
|
28
|
-
type: { type: String, enum: ["Point"], required: true },
|
|
29
|
-
coordinates: { type: [Number], required: true },
|
|
30
|
-
},
|
|
31
|
-
parameterThresholds: Object,
|
|
32
|
-
corrections: {
|
|
33
|
-
type: Map,
|
|
34
|
-
of: correctionSchema,
|
|
35
|
-
default: {},
|
|
36
|
-
},
|
|
37
|
-
correctionHistory: {
|
|
38
|
-
type: [correctionHistorySchema],
|
|
39
|
-
default: [],
|
|
40
|
-
},
|
|
41
|
-
applyCorrections: { type: Boolean, default: false },
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
timestamps: true,
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
|
|
48
|
-
// Create the MonitorAudit model
|
|
49
|
-
const MonitorAudit = mongoose.model("MonitorAudit", monitorAuditSchema);
|
|
50
|
-
|
|
51
17
|
const correctionSchema = mongoose.Schema(
|
|
52
18
|
{
|
|
53
19
|
equationType: {
|
|
@@ -88,6 +54,40 @@ const correctionHistorySchema = mongoose.Schema(
|
|
|
88
54
|
{ _id: false }
|
|
89
55
|
);
|
|
90
56
|
|
|
57
|
+
// Monitor Audit Schema
|
|
58
|
+
const monitorAuditSchema = mongoose.Schema(
|
|
59
|
+
{
|
|
60
|
+
monitorId: { type: mongoose.Types.ObjectId, ref: "Monitors" },
|
|
61
|
+
orgId: { type: mongoose.Types.ObjectId, ref: "Organizations" },
|
|
62
|
+
timeUpdated: Date,
|
|
63
|
+
deletedAt: { type: Date, default: Date.now }, // Only populated on delete
|
|
64
|
+
monitorProperties: Object, // Stores properties of the monitor
|
|
65
|
+
monitorState: String, // Tracks the state of the monitor (e.g., "Deployed", "Maintenance")
|
|
66
|
+
monitorLocation: {
|
|
67
|
+
// Monitor GPS location (lat, lon)
|
|
68
|
+
type: { type: String, enum: ["Point"], required: true },
|
|
69
|
+
coordinates: { type: [Number], required: true },
|
|
70
|
+
},
|
|
71
|
+
parameterThresholds: Object,
|
|
72
|
+
corrections: {
|
|
73
|
+
type: Map,
|
|
74
|
+
of: correctionSchema,
|
|
75
|
+
default: {},
|
|
76
|
+
},
|
|
77
|
+
correctionHistory: {
|
|
78
|
+
type: [correctionHistorySchema],
|
|
79
|
+
default: [],
|
|
80
|
+
},
|
|
81
|
+
applyCorrections: { type: Boolean, default: false },
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
timestamps: true,
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
// Create the MonitorAudit model
|
|
89
|
+
const MonitorAudit = mongoose.model("MonitorAudit", monitorAuditSchema);
|
|
90
|
+
|
|
91
91
|
// Monitors Schema
|
|
92
92
|
const monitorsSchema = mongoose.Schema(
|
|
93
93
|
{
|