Files
Checkmate/Server/models/Alert.js
2024-05-28 14:42:51 -04:00

39 lines
834 B
JavaScript

const mongoose = require('mongoose')
const AlertSchema = mongoose.Schema(
{
checkId: {
type: mongoose.Schema.Types.ObjectId,
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,
},
message: {
type: String,
},
notifiedStatus: {
type: Boolean,
},
acknowledgeStatus: {
type: Boolean,
}
},
{
timestamps: true,
}
);
module.exports = mongoose.model('Alert', AlertSchema);