const mongoose = require("mongoose");

const CmsSectionSchema = new mongoose.Schema(
  {
    sectionName: { type: String, default: "" },
    heading: { type: String, default: "" },
    paragraph: { type: String, default: "" },
    page: {
      type: String,
      required: true,
      enum: ["aboutus", "homepage"],
    },
    type: {
      type: String,
      required: true,
      enum: ["img", "plain"],
    },
    img: {
      type: Object,
      default: {},
    },
  },
  {
    timestamps: true,
  }
);

module.exports =
  mongoose.model("CmsSection", CmsSectionSchema) || mongoose.models.CmsSection;
