4 module.exports = function(sequelize, DataTypes) {
5 var SmsAccount = sequelize.define('SmsAccount', {
10 type: DataTypes.STRING
13 type: DataTypes.ENUM('twilio', 'skebby')
16 type: DataTypes.ENUM('basic', 'classic', 'classic+')
18 remote: DataTypes.STRING,
20 type: DataTypes.BOOLEAN,
24 type: DataTypes.INTEGER,
28 type: DataTypes.STRING,
35 type: DataTypes.STRING
38 type: DataTypes.STRING
41 type: DataTypes.STRING
44 type: DataTypes.STRING
47 type: DataTypes.STRING
50 type: DataTypes.STRING
53 type: DataTypes.ENUM('GET', 'POST')
56 type: DataTypes.ENUM('GET', 'POST')
59 type: DataTypes.STRING
62 type: DataTypes.ENUM('GET', 'POST')
65 type: DataTypes.STRING,
67 return this.getDataValue('actions') ? JSON.parse(this.getDataValue('actions')) : [];
70 return this.setDataValue('actions', JSON.stringify(val));
74 tableName: 'sms_accounts',
75 associate: function(models) {
76 SmsAccount.hasMany(models.SmsRoom);
77 SmsAccount.hasMany(models.SmsApplication, {
80 SmsAccount.hasMany(models.SmsMessage);
82 SmsAccount.hasMany(models.SmsDisposition);
83 SmsAccount.belongsTo(models.List);
84 SmsAccount.addScope('default', {
86 model: models.SmsApplication,
96 model: models.SmsQueue