module.exports = function(sequelize, DataTypes) {
var ReportChat = sequelize.define('ReportChat', {
-
uniqueid: DataTypes.STRING,
timeslot: DataTypes.INTEGER,
websitename: DataTypes.STRING,
websiteaddress: DataTypes.STRING,
websiteid: DataTypes.INTEGER,
application: DataTypes.STRING,
- agentid: DataTypes.INTEGER,
- agentname: DataTypes.STRING,
+ memberid: DataTypes.INTEGER,
+ membername: DataTypes.STRING,
visitorid: DataTypes.STRING,
visitorname: DataTypes.STRING,
visitoremail: DataTypes.STRING,
connectid: {
type: DataTypes.STRING,
unique: true,
- set: function(agentconnectedAt) {
- this.setDataValue('connectid', this.uniqueid);
+ set: function(connectid) {
+ this.setDataValue('connectid', connectid);
this.setDataValue('reason', 'connect');
this.setDataValue('connectedAt', moment().format("YYYY-MM-DD HH:mm:ss"));
}
},
calledAt: DataTypes.DATE,
+ rejectedAt: {
+ type: DataTypes.DATE,
+ set: function(rejectedAt) {
+ this.setDataValue('rejectedAt', rejectedAt);
+ this.setDataValue('reason', 'rejected');
+ }
+ },
connectedAt: DataTypes.DATE
}, {
tableName: 'report_chat'