@justair/justair-library 4.3.1 → 4.3.3-alpha

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": "4.3.1",
3
+ "version": "4.3.3-alpha",
4
4
  "description": "JustAir Internal Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -31,6 +31,7 @@ const alertsSchema = mongoose.Schema(
31
31
  actionBy: { type: mongoose.Types.ObjectId, ref: "Admin" },
32
32
  actionDate: { type: Date, default: Date.now },
33
33
  recipents: [recipientSchema],
34
+ metaData: Object
34
35
  },
35
36
  {
36
37
  timestamps: true,
@@ -69,7 +70,7 @@ const alertsAuditSchema = mongoose.Schema(
69
70
  const AlertsAudit = mongoose.model("AlertsAudit", alertsAuditSchema);
70
71
 
71
72
  // Pre-hook to log single alert deletions
72
- alertsSchema.pre("findOneAndDelete", async function () {
73
+ alertsSchema.pre("sindOneAndDelete", async function () {
73
74
  const docToDelete = await this.model.findOne(this.getFilter());
74
75
  if (docToDelete) {
75
76
  console.log("Logging findOneAndDelete to audit", docToDelete);
@@ -39,6 +39,14 @@ const correctionSchema = new Schema(
39
39
  { _id: false }
40
40
  );
41
41
 
42
+ const featureSchema = new Schema({
43
+ featureName: String,
44
+ dateAdded: {
45
+ type: Date,
46
+ default: Date.now,
47
+ },
48
+ });
49
+
42
50
  const organizationsSchema = mongoose.Schema(
43
51
  {
44
52
  name: String,
@@ -56,6 +64,7 @@ const organizationsSchema = mongoose.Schema(
56
64
  isActive: { type: Boolean, default: true },
57
65
  correctionRules: [correctionSchema],
58
66
  alertConfigurations: [alertSchema],
67
+ features: [featureSchema],
59
68
  },
60
69
  {
61
70
  timestamps: true,