5 module.exports = function(sequelize, DataTypes) {
7 var ReportCallHistory = sequelize.define('ReportCallHistory', {
9 type: DataTypes.STRING,
14 values: ['inbound', 'internal', 'outbound', 'inbound-fax', 'outbound-fax', 'tigerdial']
16 tag: DataTypes.STRING,
17 accountcode: DataTypes.STRING,
18 source: DataTypes.STRING,
19 destination: DataTypes.STRING,
20 destinationcontext: DataTypes.STRING,
21 callerid: DataTypes.STRING,
22 channel: DataTypes.STRING,
23 destinationchannel: DataTypes.STRING,
24 lastapplication: DataTypes.STRING,
25 lastdata: DataTypes.STRING,
26 starttime: DataTypes.DATE,
27 answertime: DataTypes.DATE,
28 endtime: DataTypes.DATE,
29 duration: DataTypes.INTEGER,
30 billableseconds: DataTypes.INTEGER,
31 disposition: DataTypes.STRING,
32 amaflags: DataTypes.STRING,
33 userfield: DataTypes.STRING
35 tableName: 'report_call_history',
36 associate: function(models) {
37 // ReportCallHistory.hasMany(models.ReportQueueHistory, {
38 // as: 'HistoryQueueCalls',
39 // foreignKey: 'uniqueid',
42 // ReportCallHistory.hasMany(models.ReportAgentHistory, {
43 // as: 'HistoryReportAgents',
44 // foreignKey: 'uniqueid',
49 ReportCallHistory.removeAttribute('id');
50 return ReportCallHistory;