5 var crypto = require('crypto');
7 module.exports = function(sequelize, DataTypes) {
9 var FaxRoom = sequelize.define('FaxRoom', {
10 from: DataTypes.STRING,
11 account: DataTypes.STRING,
13 type: DataTypes.ENUM('NEW', 'OPEN', 'CLOSED', 'UNMANAGED'),
17 type: DataTypes.ENUM('SENT', 'SENDING', 'RECEIVED', 'FAILED', 'NOTE')
20 tableName: 'fax_rooms',
22 associate: function(models) {
24 FaxRoom.hasMany(models.FaxMessage);
25 FaxRoom.belongsTo(models.FaxAccount);
26 FaxRoom.belongsToMany(models.User, {
27 through: 'user_has_fax_rooms'
30 FaxRoom.addScope('default', {
35 model: models.FaxAccount
37 model: models.FaxMessage,
39 model: models.FaxAttachment
42 attributes: ['id', 'name', 'fullname', 'email']
46 attributes: ['id', 'name', 'fullname', 'email']