Built motion from commit c56b56e.|0.0.125
[motion.git] / server / models / mail_account.js
index 38dd0cf..b3c5af3 100644 (file)
@@ -26,12 +26,39 @@ module.exports = function(sequelize, DataTypes) {
                timeout: {
                        type: DataTypes.INTEGER,
                        defaultValue: 0
+               },
+               whiteLabel: {
+                       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: 'mail_accounts',
                associate: function(models) {
                        // RELATIONS
+                       MailAccount.belongsTo(models.List);
+                       MailAccount.belongsTo(models.Template);
                        MailAccount.hasMany(models.MailRoom);
+                       MailAccount.hasMany(models.MailDisposition);
                        MailAccount.hasMany(models.MailApplication);
                        MailAccount.hasOne(models.MailServerIn, {
                                onDelete: 'cascade',