const mongoose = require("mongoose");

const uomSchema = new mongoose.Schema(
{
  name: {
    type: String,
    required: true,
    trim: true,
    uppercase: true,
      unique: true
  },

  symbol: {
    type: String,
    // required: true,
    trim: true,
    uppercase: true
  },

  description: {
    type: String,
    trim: true,
    default: null
  },

  isActive: {
    type: Boolean,
    default: true
  },

  isDeleted: {
    type: Boolean,
    default: false
  },

  createdBy: {
    type: mongoose.Schema.Types.ObjectId,
    ref: "User",
    default: null
  },

  updatedBy: {
    type: mongoose.Schema.Types.ObjectId,
    ref: "User",
    default: null
  }

},
{
  timestamps: true
}
);

module.exports = mongoose.model("UnitOfMeasurement", uomSchema);