@justair/justair-library 4.15.0-alpha.d287cce → 4.15.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.
@@ -1 +1 @@
1
- {"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/models/organizations.js"],"names":[],"mappings":"AAyFA,sCAsBE;AAyDF,gCAA2E"}
1
+ {"version":3,"file":"organizations.d.ts","sourceRoot":"","sources":["../../src/models/organizations.js"],"names":[],"mappings":"AAoGA,sCAsBE;AAyDF,gCAA2E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@justair/justair-library",
3
- "version": "4.15.0-alpha.d287cce",
3
+ "version": "4.15.0",
4
4
  "description": "JustAir Internal Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -61,6 +61,17 @@ const featureSchema = new Schema({
61
61
  },
62
62
  });
63
63
 
64
+ const customAlertLevelSchema = new Schema(
65
+ {
66
+ parameter: { type: String },
67
+ startAlertLevel: {
68
+ type: String,
69
+ enum: ["Good", "Moderate", "Unhealthy for SG", "Unhealthy", "Very Unhealthy", "Hazardous"],
70
+ },
71
+ },
72
+ { _id: false }
73
+ );
74
+
64
75
  const computeResetTime = (rateLimitType, baseTime = new Date()) => {
65
76
  const resetTime = new Date(baseTime);
66
77
 
@@ -97,7 +108,7 @@ const organizationsSchema = mongoose.Schema(
97
108
  orgCode: String,
98
109
  orgDescription: String,
99
110
  orgLogo: String,
100
- customAlertLevels: { type: [Object], default: [{ parameter: "AQI", startAlertLevel: "Unhealthy for SG" }] },
111
+ customAlertLevels: { type: [customAlertLevelSchema], default: [{ parameter: "AQI", startAlertLevel: "Unhealthy for SG" }] },
101
112
  connectedMonitors: [{ type: mongoose.Types.ObjectId, ref: "Monitors" }],
102
113
  communityMessages: [Object],
103
114
  weeklyReportData: [Object],