ProjectAuditLogEntry.js 637 B

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