@justair/justair-library 3.3.4 → 3.3.6
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/monitorRequests.js +21 -12
- package/src/models/monitors.js +16 -14
package/package.json
CHANGED
|
@@ -1,16 +1,25 @@
|
|
|
1
|
-
import mongoose from
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
2
|
|
|
3
|
-
const monitorRequestsSchema = mongoose.Schema(
|
|
4
|
-
|
|
3
|
+
const monitorRequestsSchema = mongoose.Schema(
|
|
4
|
+
{
|
|
5
|
+
monitorOwnerOrg: { type: mongoose.Types.ObjectId, ref: "Organizations" },
|
|
5
6
|
monitorOwnerOrgName: String,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
monitorList: [{ type: mongoose.Types.ObjectId, ref:
|
|
9
|
-
status: {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
7
|
+
monitorReceiverOrg: { type: mongoose.Types.ObjectId, ref: "Organizations" },
|
|
8
|
+
monitorReceiverOrgName: String,
|
|
9
|
+
monitorList: [{ type: mongoose.Types.ObjectId, ref: "Monitors" }],
|
|
10
|
+
status: {
|
|
11
|
+
type: String,
|
|
12
|
+
enum: ["Requested", "Approved", "Denied", "Cancel", "Deleted"],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
timestamps: true,
|
|
17
|
+
}
|
|
18
|
+
);
|
|
13
19
|
|
|
14
|
-
const MonitorRequests = mongoose.model(
|
|
20
|
+
const MonitorRequests = mongoose.model(
|
|
21
|
+
"MonitorRequests",
|
|
22
|
+
monitorRequestsSchema
|
|
23
|
+
);
|
|
15
24
|
|
|
16
|
-
export {monitorRequestsSchema, MonitorRequests};
|
|
25
|
+
export { monitorRequestsSchema, MonitorRequests };
|
package/src/models/monitors.js
CHANGED
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import mongoose from "mongoose";
|
|
2
|
+
const parametersEnum = [
|
|
3
|
+
"NO2",
|
|
4
|
+
"SO2",
|
|
5
|
+
"PM2.5",
|
|
6
|
+
"PM10",
|
|
7
|
+
"Temperature",
|
|
8
|
+
"Humidity",
|
|
9
|
+
"OZONE",
|
|
10
|
+
"VOC",
|
|
11
|
+
"CO",
|
|
12
|
+
"NO",
|
|
13
|
+
"PM1",
|
|
14
|
+
"WS And Direction",
|
|
15
|
+
];
|
|
2
16
|
|
|
3
17
|
// Monitor Audit Schema
|
|
4
18
|
const monitorAuditSchema = mongoose.Schema(
|
|
@@ -80,20 +94,7 @@ const monitorsSchema = mongoose.Schema(
|
|
|
80
94
|
parameters: [
|
|
81
95
|
{
|
|
82
96
|
type: String,
|
|
83
|
-
enum:
|
|
84
|
-
"NO2",
|
|
85
|
-
"SO2",
|
|
86
|
-
"PM2.5",
|
|
87
|
-
"PM10",
|
|
88
|
-
"Temperature",
|
|
89
|
-
"Humidity",
|
|
90
|
-
"OZONE",
|
|
91
|
-
"VOC",
|
|
92
|
-
"CO",
|
|
93
|
-
"NO",
|
|
94
|
-
"PM1",
|
|
95
|
-
"WS And Direction",
|
|
96
|
-
],
|
|
97
|
+
enum: parametersEnum,
|
|
97
98
|
},
|
|
98
99
|
],
|
|
99
100
|
latestPM2_5: Number,
|
|
@@ -102,6 +103,7 @@ const monitorsSchema = mongoose.Schema(
|
|
|
102
103
|
calculatedAverages: [Object],
|
|
103
104
|
images: [String],
|
|
104
105
|
isActive: { type: Boolean, default: true },
|
|
106
|
+
parameterThresholds: Object,
|
|
105
107
|
},
|
|
106
108
|
{
|
|
107
109
|
timestamps: true,
|