-var _0x9f07=["\x6D\x6F\x6D\x65\x6E\x74","\x65\x78\x70\x6F\x72\x74\x73","\x56\x6F\x69\x63\x65\x52\x65\x63\x6F\x72\x64\x69\x6E\x67","\x53\x54\x52\x49\x4E\x47","\x49\x4E\x54\x45\x47\x45\x52","\x44\x41\x54\x45","\x4D\x4D\x2D\x44\x44\x2D\x59\x59\x59\x59\x20\x48\x48\x3A\x6D\x6D","\x66\x6F\x72\x6D\x61\x74","\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74\x41\x74","\x67\x65\x74\x44\x61\x74\x61\x56\x61\x6C\x75\x65","\x76\x6F\x69\x63\x65\x5F\x72\x65\x63\x6F\x72\x64\x69\x6E\x67\x73","\x64\x65\x66\x69\x6E\x65"];var moment=require(_0x9f07[0]);module[_0x9f07[1]]=function(_0x8252x2,_0x8252x3){var _0x8252x4=_0x8252x2[_0x9f07[11]](_0x9f07[2],{uniqueid:{type:_0x8252x3[_0x9f07[3]],primaryKey:true},channel:{type:_0x8252x3[_0x9f07[3]]},calleridnum:{type:_0x8252x3[_0x9f07[3]]},calleridname:{type:_0x8252x3[_0x9f07[3]]},connectedlinenum:{type:_0x8252x3[_0x9f07[3]]},connectedlinename:{type:_0x8252x3[_0x9f07[3]]},language:{type:_0x8252x3[_0x9f07[3]]},accountcode:{type:_0x8252x3[_0x9f07[3]]},context:{type:_0x8252x3[_0x9f07[3]]},exten:{type:_0x8252x3[_0x9f07[3]]},value:{type:_0x8252x3[_0x9f07[3]]},type:{type:_0x8252x3[_0x9f07[3]]},rating:{type:_0x8252x3[_0x9f07[4]],defaultValue:0,validate:{max:5,min:0}},createdAt:{type:_0x8252x3[_0x9f07[5]],get:function(){return moment(this[_0x9f07[9]](_0x9f07[8]))[_0x9f07[7]](_0x9f07[6])}},updatedAt:{type:_0x8252x3[_0x9f07[5]],get:function(){return moment(this[_0x9f07[9]](_0x9f07[8]))[_0x9f07[7]](_0x9f07[6])}}},{tableName:_0x9f07[10],associate:function(_0x8252x5){}});return _0x8252x4}
\ No newline at end of file
+/* jshint indent: 2 */
+var moment = require('moment');
+
+module.exports = function(sequelize, DataTypes) {
+ var VoiceRecording = sequelize.define('VoiceRecording', {
+ uniqueid: {
+ 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: {
+ type: DataTypes.STRING
+ },
+ calleridname: {
+ type: DataTypes.STRING
+ },
+ connectedlinenum: {
+ type: DataTypes.STRING
+ },
+ connectedlinename: {
+ type: DataTypes.STRING
+ },
+ language: {
+ type: DataTypes.STRING
+ },
+ accountcode: {
+ type: DataTypes.STRING
+ },
+ context: {
+ type: DataTypes.STRING
+ },
+ exten: {
+ type: DataTypes.STRING
+ },
+ value: {
+ type: DataTypes.STRING
+ },
+ type: {
+ type: DataTypes.STRING
+ },
+ rating: {
+ type: DataTypes.INTEGER,
+ defaultValue: 0,
+ validate: {
+ max: 5,
+ min: 0
+ }
+ },
+ queue: {
+ type: DataTypes.STRING
+ },
+ createdAt: {
+ type: DataTypes.DATE,
+ get: function() {
+ // 'this' allows you to access attributes of the instance
+ 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('updatedAt')).format("MM-DD-YYYY HH:mm").toString();
+ }
+ }
+ }, {
+ tableName: 'voice_recordings',
+ associate: function(models) {
+ // VoiceRecording.belongsTo(models.ReportCall, {
+ // foreignKey: 'uniqueid'
+ // });
+ }
+ });
+
+ return VoiceRecording;
+};