Allow SuperAdmin to disable SMS, email, and bot from dashboard settings on top of env flags. Add admin password reset with credentials SMS, plus payment discounts, notes, and payable amount handling.
42 lines
648 B
JavaScript
42 lines
648 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: {}
|
|
},
|
|
smsEnabled: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
emailEnabled: {
|
|
type: Boolean,
|
|
default: true
|
|
},
|
|
botEnabled: {
|
|
type: Boolean,
|
|
default: true
|
|
}
|
|
}, {
|
|
timestamps: true,
|
|
minimize: false
|
|
});
|
|
|
|
const Setting = mongoose.model('Setting', settingSchema);
|
|
|
|
module.exports = {
|
|
Setting,
|
|
SETTINGS_KEY
|
|
};
|