giganet_conecta
Version:
Aplicação com o fim de facilitar conexões com APi's e Banco de Dados (MySql, Mongo e Elasticsearch).
228 lines (223 loc) • 5.25 kB
JavaScript
const { Model, DataTypes } = require("sequelize");
module.exports = Lis_Ramais
async function Lis_Ramais(sequelize) {
class Model_Lis_Ramais extends Model { }
Model_Lis_Ramais.init({
id_ramal: {
autoIncrement: true,
type: DataTypes.INTEGER,
allowNull: false,
primaryKey: true
},
id_instituicao: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "Instituição"
},
id_cr: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "Centro de Responsabilidade"
},
id_uo: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "Unidade Organizacional"
},
id_discagem: {
type: DataTypes.INTEGER,
allowNull: true,
references: {
model: 'lis_grupo_discagem',
key: 'id_discagem'
}
},
id_playlist: {
type: DataTypes.INTEGER,
allowNull: false
},
nome: {
type: DataTypes.STRING(150),
allowNull: false
},
ramal: {
type: DataTypes.STRING(50),
allowNull: false,
unique: "ramal"
},
email: {
type: DataTypes.STRING(50),
allowNull: false
},
tipo: {
type: DataTypes.STRING(50),
allowNull: false,
comment: "Ramal | Fila | Ura | Conferência"
},
interface: {
type: DataTypes.STRING(50),
allowNull: false
},
gravar_efetuadas: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "0= Não | 1 = SIM"
},
gravar_recebidas: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "0= Não | 1 = SIM"
},
bloquear_gravacao: {
type: DataTypes.INTEGER,
allowNull: false
},
cota: {
type: DataTypes.DECIMAL(9, 2),
allowNull: false
},
cota_min: {
type: DataTypes.INTEGER,
allowNull: false
},
bloq_ramal: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "0= Não | 1 = SIM"
},
limite: {
type: DataTypes.INTEGER,
allowNull: false
},
sip: {
type: DataTypes.STRING(50),
allowNull: false
},
usuario: {
type: DataTypes.STRING(50),
allowNull: false
},
brigde: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "0= Não | 1 = SIM"
},
dtmf: {
type: DataTypes.STRING(50),
allowNull: false
},
tempo_limite: {
type: DataTypes.INTEGER,
allowNull: false
},
chamada_espera: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "0= Não | 1 = SIM"
},
sequencia: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "Número de sequencia Khomp"
},
porta_habilitar: {
type: DataTypes.STRING(15),
allowNull: false
},
ips_permitidos: {
type: DataTypes.TEXT,
allowNull: false
},
id_discagem_noturno: {
type: DataTypes.INTEGER,
allowNull: true,
references: {
model: 'lis_grupo_discagem',
key: 'id_discagem'
}
},
noturno_habilitado: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "Quando estivar 1 o modo noturno esta habilitado no ramal"
},
criptografia: {
type: DataTypes.INTEGER,
allowNull: false,
comment: "0 = Não | 1 = Sim"
},
desviar_para: {
type: DataTypes.STRING(50),
allowNull: false,
comment: "Desvio modo noturno"
},
protocolo: {
type: DataTypes.STRING(20),
allowNull: false,
defaultValue: "SIP"
},
lista_telefonica: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: 0
},
temporario: {
type: DataTypes.BOOLEAN,
allowNull: true,
defaultValue: 0,
comment: "Flag para o cadastro de ramais temporarios no sistema"
},
user_cloud_soft: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "Usuario do servico de cloudsoftphone"
},
password_cloud_soft: {
type: DataTypes.STRING(255),
allowNull: true,
comment: "Senha do usuario do servico de cloudsoftphone"
},
peer_cloud_soft: {
type: DataTypes.BOOLEAN,
allowNull: true,
comment: "Flag para identificar se o ramal é do tipo Cloudsoftphone"
}
}, {
sequelize,
tableName: 'lis_ramais',
timestamps: false,
indexes: [
{
name: "PRIMARY",
unique: true,
using: "BTREE",
fields: [
{ name: "id_ramal" },
]
},
{
name: "ramal",
unique: true,
using: "BTREE",
fields: [
{ name: "ramal" },
]
},
{
name: "id_discagem",
using: "BTREE",
fields: [
{ name: "id_discagem" },
]
},
{
name: "id_discagem_noturno",
using: "BTREE",
fields: [
{ name: "id_discagem_noturno" },
]
},
]
});
return Model_Lis_Ramais
}