const mongoose = require("mongoose"); const Schema = mongoose.Schema; const ObjectId = Schema.Types.ObjectId; const departmentSchema = new mongoose.Schema( { departmentId:{type:String}, departmentName: { type: String }, phone: { type: String, unique: true, trim: true }, address1: String, address2: String, pincode: { type: String }, zone: { type: String }, city: { type: String }, state: String, country: String, services: { password: { bcrypt: String } }, createdAt: { type: Date, default: function () { return Date.now(); }, }, createdBy: ObjectId, updatedAt: { type: Date, default: function () { return Date.now(); }, }, updatedBy: ObjectId, }, { versionKey: false } ); const Department = mongoose.model('Department', departmentSchema); module.exports = { Department};