const mongoose = require("mongoose");

const productSchema = new mongoose.Schema(
  {
    category: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "Category",
      required: true,
    },

    marble_space: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "MarbleSpace",
    },

    product_name: {
      type: String,
      required: true,
    },

    product_code: String,

    short_description: String,

    origin: String,

    finish: String,

    thickness: String,

    availability: {
      type: String,
      enum: ["In Stock", "Out Of Stock"],
      default: "In Stock",
    },

    long_description: String,

    specification: String,

    application: String,

    catalog_pdf: String,

    product_images: [String],

    gallery_images: [String],

    meta_title: String,

    meta_description: String,
  },
  {
    timestamps: true,
  },
);

module.exports = mongoose.model("Product", productSchema);
