Built motion from commit d127c62.|0.0.151
[motion.git] / server / models / history / report_call_history.js
1 /**
2  * CDR Model
3  */
4
5 module.exports = function(sequelize, DataTypes) {
6
7   var ReportCallHistory = sequelize.define('ReportCallHistory', {
8     uniqueid: {
9       type: DataTypes.STRING,
10       unique: true
11     },
12     type: {
13       type: DataTypes.ENUM,
14       values: ['inbound', 'internal', 'outbound', 'inbound-fax', 'outbound-fax', 'tigerdial']
15     },
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
34   }, {
35     tableName: 'report_call_history',
36     associate: function(models) {
37       // ReportCallHistory.hasMany(models.ReportQueueHistory, {
38       //   as: 'HistoryQueueCalls',
39       //   foreignKey: 'uniqueid',
40       //   constraints: false
41       // });
42       // ReportCallHistory.hasMany(models.ReportAgentHistory, {
43       //   as: 'HistoryReportAgents',
44       //   foreignKey: 'uniqueid',
45       //   constraints: false
46       // });
47     }
48   });
49   ReportCallHistory.removeAttribute('id');
50   return ReportCallHistory;
51 };