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

const SellerGroupMembers = sequelizeConnect.define(
  "seller_group_members",
  {
    id: {
      type: Sequelize.BIGINT,
      primaryKey: true,
      allowNull: false,
      autoIncrement: true,
    },
    seller_group_id: {
        type: Sequelize.BIGINT,
        allowNull: false
    },
    seller_id: {
        type: Sequelize.BIGINT,
        allowNull: false
    },
    status: {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: true,
    },
  },
  {
    tableName: "seller_group_members",
    timestamps: false,
  }
);

SellerGroupMembers.belongsTo(Seller, {
  foreignKey: "seller_id",
  as: "seller"
})

module.exports = SellerGroupMembers;
