savdobotadmin / models /Product.js
ibrohm's picture
Initial commit V3.0
16a83e0
raw
history blame contribute delete
562 Bytes
const mongoose = require('mongoose');
const productSchema = mongoose.Schema(
{
name: { type: String, required: true },
description: { type: String, required: true },
price: { type: Number, required: true },
category: { type: String, required: true }, // e.g. "Texnika", "Kiyim", "Aksessuar"
imageUrl: { type: String, required: false },
sizes: { type: [String], default: [] }
},
{
timestamps: true,
}
);
const Product = mongoose.model('Product', productSchema);
module.exports = Product;