module.exports = function(sequelize, DataTypes) {
var VoiceRecording = sequelize.define('VoiceRecording', {
uniqueid: {
- type: DataTypes.STRING,
- primaryKey: true
+ type: DataTypes.STRING
},
channel: {
+ type: DataTypes.STRING,
+ set: function(channel) {
+ if (channel) {
+ this.setDataValue('channel', channel);
+ this.setDataValue('membername', channel.split(/\/|-/)[1]);
+ }
+ }
+ },
+ membername: {
type: DataTypes.STRING
},
calleridnum: {
},
rating: {
type: DataTypes.INTEGER,
- defaultValue: 0,
validate: {
max: 5,
min: 0
}
},
+ queue: {
+ type: DataTypes.STRING
+ },
+ customerPhone: {
+ type: DataTypes.STRING
+ },
createdAt: {
type: DataTypes.DATE,
get: function() {
// 'this' allows you to access attributes of the instance
- return moment(this.getDataValue('agentconnectAt')).format("MM-DD-YYYY HH:mm");
+ return moment(this.getDataValue('createdAt')).format("MM-DD-YYYY HH:mm").toString();
}
},
updatedAt: {
type: DataTypes.DATE,
get: function() {
// 'this' allows you to access attributes of the instance
- return moment(this.getDataValue('agentconnectAt')).format("MM-DD-YYYY HH:mm");
+ return moment(this.getDataValue('updatedAt')).format("MM-DD-YYYY HH:mm").toString();
}
}
}, {