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

const Suppliers = sequelizeConnect.define(
  "suppliers",
  {
    id: {
      type: DataTypes.BIGINT,
      primaryKey: true,
      allowNull: false,
      autoIncrement: true,
    },
    supplier_name: {
      type: DataTypes.STRING(500),
      allowNull: false,
    },
    contact_person: {
      type: DataTypes.STRING(500),
      allowNull: false,
    },
    email_address: {
      type: DataTypes.STRING(500),
      allowNull: true,
    },
    phone: {
      type: DataTypes.STRING(500),
      allowNull: true,
    },
    address: {
      type: DataTypes.STRING(500),
      allowNull: true,
    },
    tin_number: {
      type: DataTypes.STRING(500),
      allowNull: true,
    },
    status: {
      type: DataTypes.BOOLEAN,
      allowNull: false,
      defaultValue: true,
    },
  },
  {
    tableName: "suppliers",
    timestamps: true,
  }
);

module.exports = Suppliers;
