3 module.exports = function(sequelize, DataTypes) {
5 var FaxAccount = sequelize.define('FaxAccount', {
7 type: DataTypes.STRING,
12 description: DataTypes.STRING,
14 type: DataTypes.ENUM('yes', 'no'),
18 type: DataTypes.STRING,
19 defaultValue: 'xCALLY Motion Fax'
22 type: DataTypes.STRING,
26 type: DataTypes.ENUM('2400', '4800', '7200', '9600', '12000', '14400'),
30 type: DataTypes.ENUM('2400', '4800', '7200', '9600', '12000', '14400'),
34 type: DataTypes.STRING,
35 defaultValue: 'v17,v27,v29'
38 type: DataTypes.STRING,
41 is: /^(?:yes|no|[0-9]+)$/
45 type: DataTypes.STRING,
48 is: /^(?:yes|no|t38|cng|[0-9]+)$/
52 type: DataTypes.INTEGER,
59 type: DataTypes.ENUM('SIP', 'IAX', 'DADHI', 'KHOMP'),
63 type: DataTypes.BOOLEAN,
67 type: DataTypes.INTEGER,
71 type: DataTypes.STRING
74 type: DataTypes.STRING
77 type: DataTypes.ENUM('GET', 'POST')
80 type: DataTypes.ENUM('GET', 'POST')
83 type: DataTypes.STRING,
85 return this.getDataValue('actions') ? JSON.parse(this.getDataValue('actions')) : [];
88 return this.setDataValue('actions', JSON.stringify(val));
92 type: DataTypes.STRING
95 type: DataTypes.ENUM('GET', 'POST')
98 tableName: 'fax_accounts',
99 associate: function(models) {
100 FaxAccount.belongsTo(models.Trunk);
101 FaxAccount.hasMany(models.FaxRoom);
102 FaxAccount.hasMany(models.FaxApplication);
103 FaxAccount.hasMany(models.VoiceExtension, {
107 FaxAccount.belongsTo(models.List);
108 FaxAccount.hasMany(models.FaxDisposition);
111 FaxAccount.addScope('default', {
113 model: models.FaxApplication,
123 model: models.FaxQueue