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

const SellerNotifcations = sequelizeConnect.define(
  "seller_notifications",
  {
    id: {
      type: Sequelize.BIGINT,
      primaryKey: true,
      allowNull: false,
      autoIncrement: true,
    },
    seller_company_id: {
      type: Sequelize.BIGINT,
      allowNull: false,
    },
    notification_type: {
      type: Sequelize.ENUM("Order", "Reminder"),
      allowNull: false,
    },
    description: {
      type: Sequelize.TEXT,
      allowNull: true,
    },
    order_id: {
      type: Sequelize.BIGINT,
      allowNull: true,
    },
    order_reference_no: {
      type: Sequelize.STRING(300),
      allowNull: true,
    },
    is_read: {
      type: Sequelize.BOOLEAN,
      allowNull: false,
      defaultValue: true,
    },
  },
  {
    tableName: "seller_notifications",
  }
);

module.exports = SellerNotifcations;
