const mongoose = require("mongoose");
const Schema = mongoose.Schema;

const couponSchema = new Schema({
    couponBy: {
        type: Schema.Types.ObjectId,
        ref: "Admin",
        required: true
    },
    barName:{
        type: String,
        required: true
    },
    couponCode: {
        type: String,
        required: true
    },
    discountPercent:{
        type: Number, 
        required: true
    },
    discountType:{
        type: String
    },
    minOrders: {
        type: Number,
        required: true
    },
    areaOfService: {
        type: String,
        required: true
    },
    startDate: {
        type: String,
        required: true
    },
    endDate: {
        type: String,
        required: true
    },
    status:{
        type: String,
        enum: ["Active", "InActive"],
        required: true
    },
    couponImage:{
        type: String,
        required: true
    }
});

const couponModel = mongoose.model("Coupon", couponSchema);
module.exports = couponModel; 