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