/***
 *
 * @description This model represent the gym products collection schema in mongodb
 * * source : https://mongoosejs.com/docs/guide.html
 */
import mongoose, { Model } from 'mongoose';
import { IProductsSchema } from '@/types/IDB';
// define the schema
const productsSchema = new mongoose.Schema<IProductsSchema>({
    name: String,
    description: String,
    price: Number,
    quantity: Number,
}, { timestamps: true });
// export the model
const productsModel: Model<IProductsSchema> = mongoose.models.products || mongoose.model<IProductsSchema>('products', productsSchema);
export default productsModel