@justair/justair-library 3.0.1 → 3.1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justair/justair-library",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "JustAir Internal Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -11,6 +11,7 @@ import { contextsSchema, Contexts } from './models/contexts.js';
11
11
  import { parametersSchema, Parameters } from './models/parameters.js';
12
12
  import {usersSchema, Users} from './models/users.js';
13
13
  import { eventsSchema, Events } from './models/events.js';
14
+ import { qaNotificationsSchema, QANotifcations } from './models/qanotifications.js';
14
15
  import dbConfig from './config/db.js';
15
16
  import CustomLogger from './config/logger.js';
16
17
 
@@ -35,5 +36,6 @@ export {
35
36
  lightMonitorSchema, LightMonitors,
36
37
  monitorSuppliersSchema, MonitorSuppliers,
37
38
  contextsSchema, Contexts,
38
- parametersSchema, Parameters
39
+ parametersSchema, Parameters,
40
+ qaNotificationsSchema, QANotifcations
39
41
  };
@@ -5,8 +5,7 @@ const measurementsSchema = mongoose.Schema({
5
5
  orgId: { type: mongoose.Types.ObjectId, ref: 'Organizations' },
6
6
  timeUpdated: Date,
7
7
  measurements: Object,
8
- alert: { type: String, enum: ['Good','Moderate', 'Unhealthy for SG', 'Unhealthy', 'Very Unhealthy', 'Hazardous', 'Bad'], default: 'Good' },
9
- alertMessage: String
8
+ monitorState: String
10
9
  }, {
11
10
  timestamps: true
12
11
  });
@@ -0,0 +1,17 @@
1
+ import mongoose from 'mongoose';
2
+
3
+ const qaNotificationsSchema = mongoose.Schema({
4
+ monitorId: {type: mongoose.Types.ObjectId, ref: 'Monitors'},
5
+ issue: String,
6
+ reportedAt: Date,
7
+ reportedBy: Date,
8
+ resolvedAt: Date,
9
+ status: [{type: String, enum: ["Open", "Resolved"]}]
10
+ },
11
+ {
12
+ timestamps: true
13
+ });
14
+
15
+ const QANotifications = mongoose.model('QANotifications', qaNotificationsSchema);
16
+
17
+ export {qaNotificationsSchema, QANotifications};