module.exports = function (sequelize, DataTypes) {
  const ExpenseType = sequelize.define('ExpenseType', {
    id: {
      type: DataTypes.INTEGER.UNSIGNED,
      allowNull: false,
      primaryKey: true,
      autoIncrement: true,
    },
    type_name: {
      type: DataTypes.STRING,
      allowNull: false
    },
    type_date: {
      type: DataTypes.DATE,  
      allowNull: false
    },
    created_by: {
      type: DataTypes.INTEGER,
      allowNull: false
    },
    created_at: {
      type: DataTypes.DATE,
      allowNull: false,
      defaultValue: DataTypes.NOW
    },
    updated_at: {
      type: DataTypes.DATE,
      allowNull: false,
      defaultValue: DataTypes.NOW
    }
  },
  {
    timestamps: false, 
    underscored: true,
    freezeTableName: true,
    tableName: 'expense_types',
  });

  return ExpenseType;
};
