2024-05-27 15:07:34 -04:00
|
|
|
const mongoose = require('mongoose')
|
|
|
|
|
|
|
|
|
|
const AlertSchema = mongoose.Schema(
|
|
|
|
|
{
|
|
|
|
|
checkId: {
|
|
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
|
|
|
ref: 'Check',
|
|
|
|
|
immutable: true,
|
|
|
|
|
},
|
2024-05-28 14:42:51 -04:00
|
|
|
monitorId: {
|
|
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
|
|
|
ref: 'Monitor',
|
|
|
|
|
immutable: true,
|
|
|
|
|
},
|
|
|
|
|
userId: {
|
|
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
|
|
|
ref: 'User',
|
|
|
|
|
immutable: true,
|
|
|
|
|
},
|
2024-05-27 15:07:34 -04:00
|
|
|
status: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
},
|
|
|
|
|
message: {
|
|
|
|
|
type: String,
|
|
|
|
|
},
|
|
|
|
|
notifiedStatus: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
},
|
|
|
|
|
acknowledgeStatus: {
|
|
|
|
|
type: Boolean,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
timestamps: true,
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
module.exports = mongoose.model('Alert', AlertSchema);
|