From 55a871cb3c33cecce1a519f293488f6650213d1f Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 9 Jun 2025 10:24:06 +0800 Subject: [PATCH] update notification model --- server/db/models/Notification.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/server/db/models/Notification.js b/server/db/models/Notification.js index ab51e0617..7ba3bb142 100755 --- a/server/db/models/Notification.js +++ b/server/db/models/Notification.js @@ -5,20 +5,32 @@ const configSchema = mongoose.Schema( webhookUrl: { type: String }, botToken: { type: String }, chatId: { type: String }, + platform: { + type: String, + enum: ["slack", "pager_duty"], + }, + routingKey: { type: String }, }, { _id: false } ); const NotificationSchema = mongoose.Schema( { - monitorId: { + userId: { type: mongoose.Schema.Types.ObjectId, - ref: "Monitor", + ref: "User", immutable: true, + required: true, + }, + teamId: { + type: mongoose.Schema.Types.ObjectId, + ref: "Team", + immutable: true, + required: true, }, type: { type: String, - enum: ["email", "sms", "webhook"], + enum: ["email", "sms", "webhook", "pager_duty"], }, platform: { type: String,