const mongoose = require('mongoose'); const ProductSchema = new mongoose.Schema({ name: { type: String, required: true, trim: true }, quantity: { type: Number, required: true, default: 0 }, description: { type: String, trim: true }, companyId: { type: mongoose.Schema.Types.ObjectId, ref: 'Company', required: true }, createdBy: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true }, createdAt: { type: Date, default: Date.now } }); module.exports = mongoose.model('Product', ProductSchema);