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

const WebhookCatch = sequelizeConnect.define(
  "webhook_catch",
  {
    id: {
      type: Sequelize.BIGINT,
      primaryKey: true,
      allowNull: false,
      autoIncrement: true,
    },
    response_data: {
      type: Sequelize.TEXT,
      allowNull: true,
    },
    from_api: {
      type: Sequelize.STRING(100),
      allowNull: true,
    },
    webhook_timestamp: {
      type: Sequelize.DATE,
      allowNull: false,
    },
    type: {
      type: Sequelize.STRING(100),
      allowNull: true,
    },
  },
  {
    tableName: "webhook_catch",
    timestamps: false,
  }
);

module.exports = WebhookCatch;
