UNPKG

giganet_conecta

Version:

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

90 lines (85 loc) 2.09 kB
const { Model, DataTypes } = require("sequelize"); module.exports = Fechamento; async function Fechamento(sequelize) { class FechamentoModel extends Model {} FechamentoModel.init( { id: { type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true, }, id_conta: { type: DataTypes.INTEGER, allowNull: false, }, id_inicial: { type: DataTypes.INTEGER, allowNull: false, }, id_final: { type: DataTypes.INTEGER, allowNull: false, }, lacre_informado: { type: DataTypes.STRING(45), allowNull: true, }, troco_informado: { type: DataTypes.DECIMAL(10, 0), allowNull: true, }, dinheiro_informado: { type: DataTypes.DECIMAL(10, 0), allowNull: true, }, cartao_informado: { type: DataTypes.DECIMAL(10, 0), allowNull: true, }, cheque_informado: { type: DataTypes.DECIMAL(10, 0), allowNull: true, }, pix_informado: { type: DataTypes.DECIMAL(10, 0), allowNull: true, }, dinheiro_calculado: { type: DataTypes.DECIMAL(10, 0), allowNull: false, }, cartao_calculado: { type: DataTypes.DECIMAL(10, 0), allowNull: false, }, pix_calculado: { type: DataTypes.DECIMAL(10, 0), allowNull: false, }, correto: { type: DataTypes.BOOLEAN, allowNull: false, }, obs: { type: DataTypes.TEXT, allowNull: true, }, feitoEm: { type: DataTypes.DATE, allowNull: false, }, updatedAt: { type: DataTypes.DATE, allowNull: false, }, }, { sequelize, modelName: "Fechamento", tableName: "fechamentos", timestamps: false, // já está definindo manualmente `feitoEm` e `updatedAt` } ); return FechamentoModel; }