import mongoose, { Schema, model, models } from "mongoose";

const ExtraPriceSchema = new Schema({
    itemName: String,
    price: Number,
});

const MenuItemSchema = new Schema({
    itemName:{
        type: String
    },
    menuImg:{
        type: String
    },
    description:{
        type: String
    },
    category:{
        type: mongoose.Types.ObjectId
    },
    basePrice:{
        type: Number
    },
    sizes:{
        type: [ExtraPriceSchema]
    },
    extraItems:{
        type: [ExtraPriceSchema]
    },

}, {timestamps: true})

export const MenuItem = models?.MenuItem || model('MenuItem', MenuItemSchema)