Merge pull request #2413 from bluewave-labs/feat/notification-channels

feat: notification channels
This commit is contained in:
Alexander Holliday authored and GitHub committed 2025-06-10 09:24:37 +08:00
commit 59955cd29a
7 files changed
+201 -16

No files matched your search

+19 -3
View File
@@ -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,
@@ -27,6 +39,10 @@ const NotificationSchema = mongoose.Schema(
type: configSchema,
default: () => ({}),
},
notificationName: {
type: String,
required: true,
},
address: {
type: String,
},