Skip to content

Instantly share code, notes, and snippets.

@garryyao
Created September 12, 2022 12:53
Show Gist options
  • Save garryyao/7f1013e35b1c5246b69e0495129384cc to your computer and use it in GitHub Desktop.
Save garryyao/7f1013e35b1c5246b69e0495129384cc to your computer and use it in GitHub Desktop.
outbox db schema
const subscriptionEvent = new mongoose.Schema({
martechId: {
type: String,
required: true,
},
subscriptionId: {
type: String,
required: true,
},
clientId: {
type: String,
required: true,
},
expiresAt: {
type: String,
required: true,
},
eventType: {
type: String,
required: true,
},
offerId: {
type: String,
required: true,
},
productIds: {
type: Array,
required: true,
},
provider: {
type: String,
required: true,
},
timestamp: {
type: String,
required: true,
},
location: {
type: String,
required: true,
},
price: {
type: Number,
required: true,
},
currencyCode: {
type: String,
required: true,
},
cancelReason: {
type: String,
},
paymentState: {
type: String,
},
pushedOn: {
type: Date,
default: null,
},
});
subscriptionEvent.index({ subscriptionId: 1 });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment