| import mongoose from "mongoose"; | |
| const AuditLogSchema = new mongoose.Schema( | |
| { | |
| userId: mongoose.Schema.Types.ObjectId, | |
| action: String, | |
| severity: String, | |
| ip: String, | |
| userAgent: String, | |
| isAnomaly: { type: Boolean, default: false }, | |
| }, | |
| { timestamps: true } | |
| ); | |
| export const AuditLog = mongoose.model("AuditLog", AuditLogSchema); | |