const mongoose = require("mongoose");
const timestamp = require("mongoose-timestamp");
const mongoosePaginate = require("mongoose-paginate-v2");

const modelSchema = new mongoose.Schema({
  academy_image: {
    type: String,
    required: false,
    trim: true,
    default: null,
  },
  academy_name: {
    type: String,
    required: false,
    trim: true,
    minLength: 1,
    maxLength: 255,
    default: null,
  },
  userId: {
    type: String,
    required: true,
  },
  rate: {
    type: Number,
    trim: true,
    default: 0
  },
  number_of_rate: {
    type: Number,
    trim: true,
    default: 0
  },
  sheba: {
    type: String,
    required: false,
    default: null
  },
  bio: {
    type: String,
    required: false,
    default: null
  },
  tag: {
    type: Object,
    required: false,
    default: null
  },
  
});

modelSchema.plugin(timestamp);
modelSchema.plugin(mongoosePaginate);
const PostModel = mongoose.model("Academy", modelSchema);
module.exports = PostModel;
