// models/admin/productModel.js
const mongoose = require("mongoose");

const productSchema = new mongoose.Schema(
  {
    productName: {
      type: String,
      required: [true, "Product name is required"],
      trim: true,
     
    },

    status: {
      type: Boolean,
      default: true,
    },
    // brand: {
    //   type: String,
    //   trim: true,
    //   required: [true, "Brand is required"],
    // },
    description: {
      type: String,
      trim: true,
    },
    // images: {
    //   type: [String], // Array of image URLs/paths
    //   default: [],
    //   required: [true, "Images are required"],
    // },
    orgId: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "Organization",
      required: [true, "Organization ID is required"],
    },
    isDeleted: {
      type: Boolean,
      default: false, // soft delete
    },
    createdBy: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "User",
    },
    updatedBy: {
      type: mongoose.Schema.Types.ObjectId,
      ref: "User",
    },
  },
  {
    timestamps: true,
  }
);

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