openhim-core
Version:
The OpenHIM core application that provides logging and routing of http requests
40 lines (35 loc) • 1.04 kB
JavaScript
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AlertModel = exports.AlertModelAPI = undefined;
var _mongoose = require('mongoose');
var _config = require('../config');
// A collection for keeping a day-long log of any alerts that got sent out to users
// It is used for the user max-alert policies
const AlertSchema = new _mongoose.Schema({
user: {
type: String, required: true
},
method: {
type: String, required: true
},
timestamp: {
type: Date, required: true, default: Date.now, expires: '1d'
},
channelID: {
type: String, required: true
},
condition: {
type: String, required: true
},
status: {
type: String, required: true
},
alertStatus: {
type: String, required: true, enum: ['Failed', 'Completed']
}
});
const AlertModelAPI = exports.AlertModelAPI = _config.connectionAPI.model('Alert', AlertSchema);
const AlertModel = exports.AlertModel = _config.connectionDefault.model('Alert', AlertSchema);
//# sourceMappingURL=alerts.js.map