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

const TaxCodes = sequelizeConnect.define(
  "tax_codes",
  {
    id: {
      type: DataTypes.BIGINT,
      primaryKey: true,
      autoIncrement: true,
    },
    name: {
      type: DataTypes.STRING(100),
      allowNull: false,
    },
    rate: {
      type: DataTypes.DECIMAL(5, 2),
      allowNull: false,
    },
    status: {
      type: DataTypes.BOOLEAN,
      defaultValue: true,
    },
  },
  {
    tableName: "tax_codes",
    timestamps: true,
  }
);

module.exports = TaxCodes;
