import mongoose from "mongoose";

const campaignSchema = new mongoose.Schema(
  {
    name: String,
    type: { type: String, enum: ["flash_sale", "coupon", "banner", "loyalty", "referral"], required: true },
    startsAt: Date,
    endsAt: Date,
    discountPercent: Number,
    couponCode: String,
    bannerImage: String,
    status: { type: String, enum: ["draft", "active", "paused", "ended"], default: "draft" },
    audience: [String]
  },
  { timestamps: true }
);

export const Campaign = mongoose.model("Campaign", campaignSchema);
