const mongoose = require("mongoose");
const OrderSchema = new mongoose.Schema({
 tableNumber: String,
    offer: String,
    items: [
        {
            itemId: String,
            name: String,
            price: Number,
            quantity: Number,
            image: String
        }
    ],
    subtotal: Number,
    tax: Number,
    total: Number,
    status: {
    type: String,
    enum: ['active', 'completed', 'cancelled'],
    default: 'active'
    },
    created_at: { type: Date, default: Date.now }
});

module.exports = mongoose.model("Order", OrderSchema);


