mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-14 05:39:50 -06:00
42 lines
700 B
JavaScript
42 lines
700 B
JavaScript
const mongoose = require("mongoose");
|
|
|
|
const MonitorSchema = mongoose.Schema(
|
|
{
|
|
userId: {
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
ref: "User",
|
|
immutable: true,
|
|
},
|
|
name: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
description: {
|
|
type: String,
|
|
},
|
|
type: {
|
|
type: String,
|
|
required: true,
|
|
enum: ["http", "ping"],
|
|
},
|
|
url: {
|
|
type: String,
|
|
required: true,
|
|
},
|
|
isActive: {
|
|
type: Boolean,
|
|
default: true,
|
|
},
|
|
interval: {
|
|
// in milliseconds
|
|
type: Number,
|
|
default: 60000,
|
|
},
|
|
},
|
|
{
|
|
timestamps: true,
|
|
}
|
|
);
|
|
|
|
module.exports = mongoose.model("Monitor", MonitorSchema);
|