UserAuditLogEntry.js 592 B

12345678910111213141516171819202122
  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. info: { type: Object },
  7. initiatorId: { type: Schema.Types.ObjectId },
  8. ipAddress: { type: String },
  9. operation: { type: String },
  10. timestamp: { type: Date, default: Date.now },
  11. },
  12. {
  13. collection: 'userAuditLogEntries',
  14. }
  15. )
  16. exports.UserAuditLogEntry = mongoose.model(
  17. 'UserAuditLogEntry',
  18. UserAuditLogEntrySchema
  19. )
  20. exports.UserAuditLogEntrySchema = UserAuditLogEntrySchema