Skip to content

Instantly share code, notes, and snippets.

@ghaffaru
Created July 24, 2021 15:54
Show Gist options
  • Select an option

  • Save ghaffaru/33be3fda2d80574bb9076f5b7b5bbeb9 to your computer and use it in GitHub Desktop.

Select an option

Save ghaffaru/33be3fda2d80574bb9076f5b7b5bbeb9 to your computer and use it in GitHub Desktop.
const mongoose = require('mongoose');
const PaymentSchema = mongoose.Schema({
userKey: {
type: String,
required: true
},
eventKey: {
type: mongoose.Schema.Types.ObjectId,
ref: "Event",
required: true
},
amount: {
type: Number,
required: true
},
reference: {
type: String,
required: true
},
paid: {
type: Boolean,
default: false
},
createdAt: {
type: Date,
default: Date.now
}
});
module.exports = mongoose.model('Payment', PaymentSchema);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment