Express/MongoDB backend with JWT auth, RBAC, S3 uploads, notifications, and scheduled jobs.
26 lines
459 B
JavaScript
26 lines
459 B
JavaScript
// /events/eventLogModel.js
|
|
|
|
const mongoose = require('mongoose');
|
|
|
|
const eventLogSchema = new mongoose.Schema({
|
|
eventName: {
|
|
type: String,
|
|
required: true,
|
|
index: true
|
|
},
|
|
payload: {
|
|
type: mongoose.Schema.Types.Mixed
|
|
},
|
|
actor: {
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
ref: 'User',
|
|
default: null
|
|
},
|
|
createdAt: {
|
|
type: Date,
|
|
default: Date.now
|
|
}
|
|
});
|
|
|
|
module.exports = mongoose.model('EventLog', eventLogSchema);
|