text: const mongoose = require("mongoose");
  
  const VoucherSchema = new mongoose.Schema(
    {
      subscriber: {
        type: mongoose.Schema.ObjectId,
        ref: 'User',
      },
      sales_rep: {
        type: mongoose.Schema.ObjectId,
        ref: 'User',
      },
      code: {
        type: String,
        unique: true,
      },
      amount: Number,
      used: {
        type: Boolean,
        default: false,
      },
      active: {
        type: Boolean,
        default: true,
      },
    },
    {
      timestamps: true,
      toObject: {
        virtuals: true,
      },
      toJSON: {
        virtuals: true,
      },
    }
  );
  
  module.exports = mongoose.model("Voucher", VoucherSchema);
  