From 424bec1366431cac54b28984b14f8fb3c6669e15 Mon Sep 17 00:00:00 2001 From: veyselboybay Date: Tue, 28 May 2024 14:42:51 -0400 Subject: [PATCH] Updated the Alert model, ReadMe file --- README.md | 4 +++- Server/models/Alert.js | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 2fb1d944c..2e1022c31 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,9 @@ Example: | Name | Type | Notes | | ----------------- | --------- | ------------------------------------------------- | -| checkId | `string` | Unique ID for the check | +| checkId | `string` | Unique ID for the associated check | +| monitorId | `string` | Unique ID for the associated monitor | +| userId | `string` | Unique ID for the associated user | | status | `boolean` | Indicates the service is Up or Down | | message | `string` | Message for the user about the down service | | notifiedStatus | `boolean` | Indicates whether the user is notified | diff --git a/Server/models/Alert.js b/Server/models/Alert.js index 72705d947..758a7eba2 100644 --- a/Server/models/Alert.js +++ b/Server/models/Alert.js @@ -7,6 +7,16 @@ const AlertSchema = mongoose.Schema( ref: 'Check', immutable: true, }, + monitorId: { + type: mongoose.Schema.Types.ObjectId, + ref: 'Monitor', + immutable: true, + }, + userId: { + type: mongoose.Schema.Types.ObjectId, + ref: 'User', + immutable: true, + }, status: { type: Boolean, },