const Sequelize = require("sequelize");
const sequelizeConnect = require("../connection/db");

const PilonDataDumpLogs = sequelizeConnect.define(
  "pilon_data_dump_logs",
  {
    id: {
      type: Sequelize.BIGINT,
      primaryKey: true,
      allowNull: false,
      autoIncrement: true,
    },
    distributorCode: {
      type: Sequelize.STRING,
      allowNull: false,
    },
    documentNo: {
      type: Sequelize.STRING,
      allowNull: false,
    },
    docDate: {
      type: Sequelize.DATEONLY,
      allowNull: false,
    },
    dueDate: {
      type: Sequelize.DATEONLY,
      allowNull: false,
    },
    amount: {
      type: Sequelize.DECIMAL(10, 2),
      allowNull: false,
    },
    status: {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: true,
    },
    responseData: {
      type: Sequelize.TEXT,
      allowNull: true,
    },
  },
  {
    tableName: "pilon_data_dump_logs",
    timestamps: true,
  }
);

module.exports = PilonDataDumpLogs;
