UNPKG

giganet_conecta

Version:

Aplicação com o fim de facilitar conexões com APi's e Banco de Dados (MySql & Mongo).

261 lines (255 loc) 6.14 kB
const { Model, DataTypes } = require("sequelize"); module.exports = CDR; async function CDR(sequelize) { class Model_CDR extends Model {} Model_CDR.init( { protocolo: { type: DataTypes.STRING(50), allowNull: false, }, calldate: { type: DataTypes.DATE, allowNull: false, defaultValue: "0000-00-00 00:00:00", }, agente: { type: DataTypes.STRING(10), allowNull: false, }, tipo_agente: { type: DataTypes.STRING(5), allowNull: false, comment: "De onde vem o número do agente", }, clid: { type: DataTypes.STRING(80), allowNull: false, defaultValue: "", }, ddr: { type: DataTypes.STRING(80), allowNull: false, }, callerid: { type: DataTypes.STRING(80), allowNull: false, }, cod_perfil: { type: DataTypes.STRING(80), allowNull: false, defaultValue: "", }, src: { type: DataTypes.STRING(80), allowNull: false, defaultValue: "", }, agente_src: { type: DataTypes.STRING(30), allowNull: false, }, dst: { type: DataTypes.STRING(80), allowNull: false, defaultValue: "", }, captura_dst: { type: DataTypes.STRING(30), allowNull: false, }, agente_dst: { type: DataTypes.STRING(30), allowNull: false, }, captura_agente_dst: { type: DataTypes.STRING(30), allowNull: false, }, dcontext: { type: DataTypes.STRING(80), allowNull: false, defaultValue: "", }, channel: { type: DataTypes.STRING(80), allowNull: false, defaultValue: "", }, dstchannel: { type: DataTypes.STRING(80), allowNull: false, defaultValue: "", }, lastapp: { type: DataTypes.STRING(80), allowNull: false, defaultValue: "", }, lastdata: { type: DataTypes.STRING(80), allowNull: false, defaultValue: "", }, duration: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, }, billsec: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, }, disposition: { type: DataTypes.STRING(45), allowNull: false, defaultValue: "", }, amaflags: { type: DataTypes.INTEGER, allowNull: false, defaultValue: 0, }, accountcode: { type: DataTypes.STRING(20), allowNull: false, defaultValue: "", }, peeraccount: { type: DataTypes.STRING(50), allowNull: false, }, uniqueid: { type: DataTypes.STRING(32), allowNull: false, defaultValue: "", }, userfield: { type: DataTypes.STRING(255), allowNull: false, defaultValue: "", }, trunkin: { type: DataTypes.STRING(80), allowNull: false, }, trunkout: { type: DataTypes.STRING(80), allowNull: false, }, sequence: { type: DataTypes.STRING(32), allowNull: false, }, linkedid: { type: DataTypes.STRING(32), allowNull: false, }, monitor: { type: DataTypes.STRING(80), allowNull: false, }, uradigito: { type: DataTypes.STRING(10), allowNull: false, }, hang_code: { type: DataTypes.INTEGER, allowNull: false, }, hang_tech: { type: DataTypes.STRING(80), allowNull: false, }, hang_ast: { type: DataTypes.STRING(80), allowNull: false, }, }, { sequelize, tableName: "cdr", timestamps: false, indexes: [ { name: "idx_calldate", using: "BTREE", fields: [{ name: "calldate" }], }, { name: "idx_src", using: "BTREE", fields: [{ name: "src" }], }, { name: "idx_dst", using: "BTREE", fields: [{ name: "dst" }], }, { name: "idx_agente", using: "BTREE", fields: [{ name: "agente" }], }, { name: "idx_ddr", using: "BTREE", fields: [{ name: "ddr" }], }, { name: "idx_dcontext", using: "BTREE", fields: [{ name: "dcontext" }], }, { name: "idx_disposition", using: "BTREE", fields: [{ name: "disposition" }], }, { name: "idx_accountcode", using: "BTREE", fields: [{ name: "accountcode" }], }, { name: "idx_peeraccount", using: "BTREE", fields: [{ name: "peeraccount" }], }, { name: "idx_userfield", using: "BTREE", fields: [{ name: "userfield" }], }, { name: "idx_trunkin", using: "BTREE", fields: [{ name: "trunkin" }], }, { name: "idx_trunkout", using: "BTREE", fields: [{ name: "trunkout" }], }, { name: "idx_uradigito", using: "BTREE", fields: [{ name: "uradigito" }], }, { name: "idx_captura_dst", using: "BTREE", fields: [{ name: "captura_dst" }], }, { name: "idx_captura_agente_dst", using: "BTREE", fields: [{ name: "captura_agente_dst" }], }, ], } ); Model_CDR.removeAttribute("id"); return Model_CDR; }