Move sms.ir template IDs out of env into settings so SuperAdmin can manage them, and record every outbound SMS status in notifications.
29 lines
453 B
JavaScript
29 lines
453 B
JavaScript
'use strict';
|
|
|
|
const mongoose = require('mongoose');
|
|
|
|
const SETTINGS_KEY = 'app';
|
|
|
|
const settingSchema = new mongoose.Schema({
|
|
key: {
|
|
type: String,
|
|
required: true,
|
|
unique: true,
|
|
default: SETTINGS_KEY,
|
|
index: true
|
|
},
|
|
smsTemplates: {
|
|
type: mongoose.Schema.Types.Mixed,
|
|
default: {}
|
|
}
|
|
}, {
|
|
timestamps: true
|
|
});
|
|
|
|
const Setting = mongoose.model('Setting', settingSchema);
|
|
|
|
module.exports = {
|
|
Setting,
|
|
SETTINGS_KEY
|
|
};
|