@justair/justair-library 4.2.0 → 4.3.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.
- package/package.json +1 -1
- package/src/models/monitors.js +28 -1
- package/src/models/qanotifications.js +0 -32
package/package.json
CHANGED
package/src/models/monitors.js
CHANGED
|
@@ -14,6 +14,33 @@ const parametersEnum = [
|
|
|
14
14
|
"WS And Direction",
|
|
15
15
|
];
|
|
16
16
|
|
|
17
|
+
const noteSchema = mongoose.Schema({
|
|
18
|
+
note: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
type: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
monitorState: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
adminId: {
|
|
31
|
+
type: mongoose.Types.ObjectId,
|
|
32
|
+
ref: "Admin",
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
adminName: {
|
|
36
|
+
type: String,
|
|
37
|
+
},
|
|
38
|
+
date: {
|
|
39
|
+
type: Date,
|
|
40
|
+
default: Date.now,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
17
44
|
const correctionSchema = mongoose.Schema(
|
|
18
45
|
{
|
|
19
46
|
equationType: {
|
|
@@ -150,7 +177,7 @@ const monitorsSchema = mongoose.Schema(
|
|
|
150
177
|
],
|
|
151
178
|
latestPM2_5: Number,
|
|
152
179
|
latestAQI_PM2_5: Number,
|
|
153
|
-
notes: [
|
|
180
|
+
notes: [noteSchema],
|
|
154
181
|
calculatedAverages: [Object],
|
|
155
182
|
images: [String],
|
|
156
183
|
isActive: { type: Boolean, default: true },
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
|
|
3
|
-
const qaNotificationsSchema = mongoose.Schema(
|
|
4
|
-
{
|
|
5
|
-
monitorId: { type: mongoose.Types.ObjectId, ref: "Monitors" },
|
|
6
|
-
issue: String,
|
|
7
|
-
reportedAt: Date,
|
|
8
|
-
reportedBy: String,
|
|
9
|
-
resolvedAt: Date,
|
|
10
|
-
resolvedBy: String,
|
|
11
|
-
resolution: String,
|
|
12
|
-
statusHistory: [Object],
|
|
13
|
-
type: String,
|
|
14
|
-
status: {
|
|
15
|
-
type: String,
|
|
16
|
-
enum: ["Open", "Resolved", "Cancelled", "Needs Review"],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
timestamps: true,
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const QANotifications = mongoose.model(
|
|
25
|
-
"QANotifications",
|
|
26
|
-
qaNotificationsSchema
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
qaNotificationsSchema.index({ monitorId: 1 });
|
|
30
|
-
qaNotificationsSchema.index({ createdAt: 1 });
|
|
31
|
-
|
|
32
|
-
export { qaNotificationsSchema, QANotifications };
|