UserAuditLogEntry.js 686 B

123456789101112131415161718192021222324
  1. const mongoose = require('../infrastructure/Mongoose')
  2. const { Schema } = mongoose
  3. const UserAuditLogEntrySchema = new Schema(
  4. {
  5. userId: { type: Schema.Types.ObjectId, index: true },
  6. managedSubscriptionId: { type: Schema.Types.ObjectId, index: true },
  7. info: { type: Object },
  8. initiatorId: { type: Schema.Types.ObjectId },
  9. ipAddress: { type: String },
  10. operation: { type: String },
  11. timestamp: { type: Date, default: Date.now },
  12. },
  13. {
  14. collection: 'userAuditLogEntries',
  15. minimize: false,
  16. }
  17. )
  18. exports.UserAuditLogEntry = mongoose.model(
  19. 'UserAuditLogEntry',
  20. UserAuditLogEntrySchema
  21. )
  22. exports.UserAuditLogEntrySchema = UserAuditLogEntrySchema