@justair/justair-library 4.3.5 → 4.4.1
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/index.js +6 -0
- package/src/models/dataCompleteness.js +21 -0
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -49,6 +49,10 @@ import {
|
|
|
49
49
|
alertsAuditSchema,
|
|
50
50
|
} from "./models/alerts.js";
|
|
51
51
|
import { Features, featuresSchema } from "./models/features.js";
|
|
52
|
+
import {
|
|
53
|
+
DataCompleteness,
|
|
54
|
+
dataCompletenessSchema,
|
|
55
|
+
} from "./models/dataCompleteness.js";
|
|
52
56
|
import Database from "./config/db.js"; // Import the new Database class
|
|
53
57
|
import CustomLogger from "./config/logger.js";
|
|
54
58
|
|
|
@@ -104,4 +108,6 @@ export {
|
|
|
104
108
|
alertsAuditSchema,
|
|
105
109
|
Features,
|
|
106
110
|
featuresSchema,
|
|
111
|
+
dataCompletenessSchema,
|
|
112
|
+
DataCompleteness,
|
|
107
113
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const dataCompletenessSchema = mongoose.Schema(
|
|
4
|
+
{
|
|
5
|
+
monitorId: { type: mongoose.Types.ObjectId, ref: "Monitors" },
|
|
6
|
+
supplierId: { type: mongoose.Types.ObjectId, ref: "MonitorSuppliers" },
|
|
7
|
+
parameter: String,
|
|
8
|
+
count: Number,
|
|
9
|
+
threshold: Number,
|
|
10
|
+
completeness: Number, // percent 0–100
|
|
11
|
+
measurementsStartTime: Date,
|
|
12
|
+
measurementsEndTime: Date,
|
|
13
|
+
},
|
|
14
|
+
{ timestamps: true }
|
|
15
|
+
);
|
|
16
|
+
const DataCompleteness = mongoose.model(
|
|
17
|
+
"DataCompleteness",
|
|
18
|
+
dataCompletenessSchema
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
export { dataCompletenessSchema, DataCompleteness };
|