const { DataTypes, Sequelize } = require("sequelize");
const sequelizeConnect = require("../connection/db");

const PurchaseOrderApprovers = sequelizeConnect.define(
  "purchase_order_approvers",
  {
    id: {
      type: DataTypes.BIGINT,
      primaryKey: true,
      allowNull: false,
      autoIncrement: true,
    },
    seller_id: {
      type: DataTypes.BIGINT,
      allowNull: true,
    },
    user_id: {
      type: DataTypes.BIGINT,
      allowNull: false,
    },
    user_type: {
      type: DataTypes.ENUM("Admin", "Seller"),
      allowNull: false
    },
    level: {
      type: DataTypes.INTEGER,
      allowNull: false,
    },
    status: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: true,
    },
  },
  {
    tableName: "purchase_order_approvers",
    timestamps: true,
  }
);

module.exports = PurchaseOrderApprovers;
