From 4053a6a785dc5379896d7ab26fc684e7b3c6b16e Mon Sep 17 00:00:00 2001 From: Alexander Holliday Date: Tue, 30 Jul 2024 12:54:35 -0700 Subject: [PATCH] Add notification model (#488) --- Server/models/Notification.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Server/models/Notification.js diff --git a/Server/models/Notification.js b/Server/models/Notification.js new file mode 100644 index 000000000..6e4683ae2 --- /dev/null +++ b/Server/models/Notification.js @@ -0,0 +1,26 @@ +const mongoose = require("mongoose"); + +const NotificationSchema = mongoose.Schema( + { + monitorId: { + type: mongoose.Schema.Types.ObjectId, + ref: "Monitor", + immutable: true, + }, + type: { + type: String, + enum: ["email", "sms"], + }, + address: { + type: String, + }, + phone: { + type: String, + }, + }, + { + timestamps: true, + } +); + +module.exports = mongoose.model("Notification", NotificationSchema);