'use strict';
+
module.exports = function(sequelize, DataTypes) {
var SmsAccount = sequelize.define('SmsAccount', {
name: {
rejectMethod: {
type: DataTypes.ENUM('GET', 'POST')
},
+ closeUrl: {
+ type: DataTypes.STRING
+ },
+ closeMethod: {
+ type: DataTypes.ENUM('GET', 'POST')
+ },
actions: {
type: DataTypes.STRING,
get: function() {
// SCOPES
SmsAccount.hasMany(models.SmsDisposition);
SmsAccount.belongsTo(models.List);
+ SmsAccount.addScope('default', {
+ include: [{
+ model: models.SmsApplication,
+ include: [{
+ model: models.User,
+ attributes: ['id',
+ 'name',
+ 'email',
+ 'internal',
+ 'fullname'
+ ]
+ }, {
+ model: models.SmsQueue
+ }]
+ }]
+ });
}
});
return SmsAccount;