Built motion from commit 82438f7.|0.0.115
[motion.git] / server / models / sms_account.js
index aface5f..1c48ff7 100644 (file)
@@ -43,8 +43,28 @@ module.exports = function(sequelize, DataTypes) {
     },
     password: {
       type: DataTypes.STRING
+    },
+    acceptUrl: {
+      type: DataTypes.STRING
+    },
+    rejectUrl: {
+      type: DataTypes.STRING
+    },
+    acceptMethod: {
+      type: DataTypes.ENUM('GET', 'POST')
+    },
+    rejectMethod: {
+      type: DataTypes.ENUM('GET', 'POST')
+    },
+    actions: {
+      type: DataTypes.STRING,
+      get: function() {
+        return this.getDataValue('actions') ? JSON.parse(this.getDataValue('actions')) : [];
+      },
+      set: function(val) {
+        return this.setDataValue('actions', JSON.stringify(val));
+      }
     }
-
   }, {
     tableName: 'sms_accounts',
     associate: function(models) {
@@ -54,7 +74,8 @@ module.exports = function(sequelize, DataTypes) {
       });
       SmsAccount.hasMany(models.SmsMessage);
       // SCOPES
-
+      SmsAccount.hasMany(models.SmsDisposition);
+      SmsAccount.belongsTo(models.List);
     }
   });
   return SmsAccount;