Merge branch 'master' into feat/check-routes

This commit is contained in:
Alex Holliday committed 2024-05-27 15:21:13 -07:00
commit 46623dc8d6
3 files changed
+85

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
const mongoose = require('mongoose')
const AlertSchema = mongoose.Schema(
{
checkId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Check',
immutable: true,
},
status: {
type: Boolean,
},
message: {
type: String,
},
notifiedStatus: {
type: Boolean,
},
acknowledgeStatus: {
type: Boolean,
}
},
{
timestamps: true,
}
);
module.exports = mongoose.model('Alert', AlertSchema);
+28
View File
@@ -0,0 +1,28 @@
const mongoose = require('mongoose')
const CheckSchema = mongoose.Schema(
{
monitorId: {
type: mongoose.Schema.Types.ObjectId,
ref: 'Monitor',
immutable: true,
},
status: {
type: Boolean,
},
responseTime: {
type: Number, // milliseconds
},
statusCode: {
type: Number, // 200, ... , 500
},
message: {
type: String,
}
},
{
timestamps: true,
}
);
module.exports = mongoose.model('Check', CheckSchema);