feat: send account and invoice SMS from stored template IDs
Move sms.ir template IDs out of env into settings so SuperAdmin can manage them, and record every outbound SMS status in notifications.
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
'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
|
||||
};
|
||||
Reference in New Issue
Block a user