type: DataTypes.ENUM('NEW', 'OPEN', 'CLOSED', 'UNMANAGED'),
defaultValue: 'NEW'
},
+ lastEvent: {
+ type: DataTypes.ENUM('SENDING', 'SENT', 'RECEIVED', 'FAILED', 'NOTE')
+ },
+ lastEventAt: {
+ type: DataTypes.DATE
+ },
+ waiting: {
+ type: DataTypes.BOOLEAN,
+ defaultValue: false
+ },
tags: {
type: DataTypes.TEXT,
get: function() {
this.setDataValue('tags', val && val.length ? val.join(';') + ';' : null);
}
},
- waiting: {
- type: DataTypes.BOOLEAN,
- defaultValue: false
- },
disposition: {
type: DataTypes.STRING
},
+ openReason: DataTypes.STRING,
+ arrivedAt: {
+ type: DataTypes.DATE
+ },
+ closedAt: {
+ type: DataTypes.DATE
+ },
ParentId: {
type: DataTypes.INTEGER
},
associate: function(models) {
// BINDING
SmsRoom.hasMany(models.SmsMessage);
+ SmsRoom.hasMany(models.SmsRoomStatus, {
+ plural: 'SmsRoomStatuses'
+ });
SmsRoom.belongsToMany(models.User, {
through: 'user_has_sms_rooms'
});