UNPKG

giganet_conecta

Version:

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

544 lines (539 loc) 13.2 kB
const { Model, DataTypes, fn } = require("sequelize"); module.exports = Funcionarios; async function Funcionarios(sequelize) { class Model_Funcionarios extends Model {} Model_Funcionarios.init( { id: { autoIncrement: true, type: DataTypes.INTEGER, allowNull: false, primaryKey: true, }, funcionario: { type: DataTypes.STRING(100), allowNull: false, }, id_funcao: { type: DataTypes.INTEGER, allowNull: true, }, id_conta: { type: DataTypes.INTEGER, allowNull: true, }, coeficiente: { type: DataTypes.DECIMAL(15, 9), allowNull: true, }, filial_id: { type: DataTypes.INTEGER, allowNull: false, references: { model: "filial", key: "id", }, }, fone_celular: { type: DataTypes.STRING(20), allowNull: true, }, email: { type: DataTypes.STRING(120), allowNull: true, }, envia_email_os: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "S", }, envia_sms_os: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "N", }, integracao_calendario: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "N", }, id_setor_padrao: { type: DataTypes.INTEGER, allowNull: true, }, endereco: { type: DataTypes.STRING(200), allowNull: true, }, cidade: { type: DataTypes.INTEGER, allowNull: true, references: { model: "cidade", key: "id", }, }, numero: { type: DataTypes.STRING(20), allowNull: true, }, bairro: { type: DataTypes.STRING(100), allowNull: true, }, uf: { type: DataTypes.INTEGER, allowNull: true, }, cep: { type: DataTypes.STRING(20), allowNull: true, }, complemento: { type: DataTypes.STRING(100), allowNull: true, }, referencia: { type: DataTypes.STRING(100), allowNull: true, }, cpf_cnpj: { type: DataTypes.STRING(30), allowNull: true, }, ie_identidade: { type: DataTypes.STRING(30), allowNull: true, }, rg_orgao_emissor: { type: DataTypes.CHAR(20), allowNull: true, }, nacionalidade: { type: DataTypes.STRING(30), allowNull: true, }, data_nascimento: { type: DataTypes.DATEONLY, allowNull: true, }, fone: { type: DataTypes.STRING(20), allowNull: true, }, telefone_comercial: { type: DataTypes.STRING(20), allowNull: true, }, assinatura_email: { type: DataTypes.BLOB, allowNull: true, }, id_email_smtp: { type: DataTypes.INTEGER, allowNull: true, }, ativo: { type: DataTypes.ENUM("S", "N"), allowNull: true, defaultValue: "S", }, banco: { type: DataTypes.STRING(11), allowNull: true, }, agencia: { type: DataTypes.STRING(100), allowNull: true, }, numero_conta_dv: { type: DataTypes.STRING(3), allowNull: true, }, agencia_dv: { type: DataTypes.STRING(3), allowNull: true, }, conta: { type: DataTypes.STRING(20), allowNull: true, }, tipo_recebimento: { type: DataTypes.ENUM("C", "B", "D"), allowNull: true, }, pipe_id_usuario: { type: DataTypes.INTEGER, allowNull: true, }, data_admissao: { type: DataTypes.DATEONLY, allowNull: true, }, data_demissao: { type: DataTypes.DATEONLY, allowNull: true, }, obs: { type: DataTypes.TEXT, allowNull: true, }, img_assinatura: { type: DataTypes.STRING(255), allowNull: true, }, ultima_latitude: { type: DataTypes.STRING(45), allowNull: true, }, ultima_longitude: { type: DataTypes.STRING(45), allowNull: true, }, percen_max_desc_areceber: { type: DataTypes.DECIMAL(15, 2), allowNull: true, }, ramal: { type: DataTypes.INTEGER, allowNull: true, }, envia_telegram_os: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "N", }, telegram_chat_id_funcionario: { type: DataTypes.STRING(200), allowNull: true, }, id_chat_telegram_funcionario: { type: DataTypes.INTEGER, allowNull: true, }, cor_mapa: { type: DataTypes.STRING(45), allowNull: true, }, prj_custo_hora_base: { type: DataTypes.DECIMAL(15, 2), allowNull: true, }, prj_custo_hora_adicionais: { type: DataTypes.DECIMAL(15, 2), allowNull: true, }, camara_centralizadora: { type: DataTypes.STRING(3), allowNull: true, }, id_perfil_jornada_trabalho: { type: DataTypes.INTEGER, allowNull: false, }, nome_pai: { type: DataTypes.STRING(120), allowNull: true, }, nome_mae: { type: DataTypes.STRING(120), allowNull: true, }, estado_civil: { type: DataTypes.ENUM("S", "C", "UE", "D", "V", "SE"), allowNull: false, defaultValue: "S", }, nome_conjuge: { type: DataTypes.STRING(120), allowNull: true, }, dependentes_ir: { type: DataTypes.INTEGER, allowNull: true, }, num_dependentes: { type: DataTypes.INTEGER, allowNull: true, }, cor_raca: { type: DataTypes.ENUM("A", "B", "I", "P", "N", "O"), allowNull: false, defaultValue: "B", }, num_manequim: { type: DataTypes.INTEGER, allowNull: true, }, camiseta: { type: DataTypes.ENUM("P", "PP", "M", "G", "GG", "O"), allowNull: false, defaultValue: "M", }, possui_deficiencia: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "N", }, tipo_deficiencia: { type: DataTypes.ENUM("F", "A", "V", "M", "MR"), allowNull: true, }, grau_escolaridade: { type: DataTypes.ENUM("EF", "EM", "ES", "PG", "M", "D"), allowNull: true, }, periodo_escolaridade: { type: DataTypes.ENUM("M", "V", "N"), allowNull: true, }, estagio_escolaridade: { type: DataTypes.ENUM("C", "CR", "I"), allowNull: true, }, fone_emergencia: { type: DataTypes.STRING(20), allowNull: true, }, falar_com: { type: DataTypes.STRING(60), allowNull: true, }, salario: { type: DataTypes.DECIMAL(15, 2), allowNull: true, }, cnh_categoria: { type: "SET('A','B','C','D','E')", allowNull: true, }, cnh_numero: { type: DataTypes.STRING(25), allowNull: true, }, ctps_numero: { type: DataTypes.STRING(25), allowNull: true, }, ctps_serie: { type: DataTypes.STRING(10), allowNull: true, }, ctps_data_emissao: { type: DataTypes.DATEONLY, allowNull: true, }, ctps_cidade_emissao: { type: DataTypes.INTEGER, allowNull: true, }, titulo_numero: { type: DataTypes.STRING(20), allowNull: true, }, titulo_zona: { type: DataTypes.STRING(5), allowNull: true, }, titulo_secao: { type: DataTypes.STRING(5), allowNull: true, }, cnh_vencimento: { type: DataTypes.DATEONLY, allowNull: true, }, rg_conjuge: { type: DataTypes.STRING(30), allowNull: true, }, cpf_conjuge: { type: DataTypes.STRING(30), allowNull: true, }, pis_numero: { type: DataTypes.STRING(20), allowNull: true, }, pis_data: { type: DataTypes.DATEONLY, allowNull: true, }, rg_data_emissao: { type: DataTypes.DATEONLY, allowNull: true, }, dep_um_nome: { type: DataTypes.STRING(120), allowNull: true, }, dep_um_rg: { type: DataTypes.STRING(20), allowNull: true, }, dep_um_cpf: { type: DataTypes.STRING(20), allowNull: true, }, dep_dois_nome: { type: DataTypes.STRING(120), allowNull: true, }, dep_dois_rg: { type: DataTypes.STRING(20), allowNull: true, }, dep_dois_cpf: { type: DataTypes.STRING(20), allowNull: true, }, dep_tres_nome: { type: DataTypes.STRING(120), allowNull: true, }, dep_tres_rg: { type: DataTypes.STRING(20), allowNull: true, }, dep_tres_cpf: { type: DataTypes.STRING(20), allowNull: true, }, id_departamento: { type: DataTypes.INTEGER, allowNull: true, }, rastreador: { type: DataTypes.STRING(50), allowNull: true, }, last_location_update: { type: DataTypes.DATE, allowNull: true, }, ultima_atualizacao: { type: DataTypes.DATE, allowNull: true, defaultValue: fn("current_timestamp"), }, id_conta_salario: { type: DataTypes.INTEGER, allowNull: true, }, cod_integracao_folha: { type: DataTypes.INTEGER, allowNull: true, }, gps_time: { type: DataTypes.DATE, allowNull: true, }, ferias_colaborador: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "N", }, exibir_colaborador_inmap: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "S", }, id_conta_decimo: { type: DataTypes.INTEGER.UNSIGNED, allowNull: true, }, chave_pix: { type: DataTypes.STRING(120), allowNull: true, }, tipo_chave_pix: { type: DataTypes.ENUM( "cpf_cnpj", "celular", "email", "aleatoria", "codigo_copia_cola" ), allowNull: true, }, mostrar_no_quadro_kanban: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "S", }, rastreador_tipo: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "S", }, maximo_os_dia: { type: DataTypes.INTEGER.UNSIGNED, allowNull: true, }, vinculo_config_roteirizacao: { type: DataTypes.ENUM("S", "N"), allowNull: false, defaultValue: "N", }, tipo_documento_identificacao_col: { type: DataTypes.ENUM( "11", "12", "13", "21", "22", "31", "41", "42", "47", "50", "91", "CI", "RUC", "NUIT" ), allowNull: false, defaultValue: "13", }, }, { sequelize, tableName: "funcionarios", timestamps: false, indexes: [ { name: "PRIMARY", unique: true, using: "BTREE", fields: [{ name: "id" }], }, { name: "filial_id", using: "BTREE", fields: [{ name: "filial_id" }], }, { name: "id_funcao", using: "BTREE", fields: [{ name: "id_funcao" }], }, { name: "id_setor_padrao", using: "BTREE", fields: [{ name: "id_setor_padrao" }], }, { name: "cidade", using: "BTREE", fields: [{ name: "cidade" }], }, { name: "id_conta_salario", using: "BTREE", fields: [{ name: "id_conta_salario" }], }, ], } ); return Model_Funcionarios; }