const mongoose = require("mongoose");


const productSchema = new mongoose.Schema({
	name: {
		type: String,
		required: [true, "Product name is required!"]
	},
	description: {
		type: String,
		required: [true, "Description is required!"]
	},
	price: {
		type: Number,
		required: [true, "Price is required!"]
	},
	isActive: {
		type: Boolean,
		default: true
	},
	createdOn : {
		type: Date,
		default : new Date()
	},
	inventory: {
		type: Number,
		default: 1
	}
})

const Product = mongoose.model("products", productSchema);

module.exports = Product;