const mongoose = require('mongoose');

const EventSchema = new mongoose.Schema({
    userId: String,

    userAgentCategory: String,
    country: String,
    timeBucket: String,

    riskScore: Number,
    reasons: [String],
    isAnomalous: Boolean,

    createdAt: {
        type: Date,
        default: Date.now
    }
});

module.exports = mongoose.model('Event', EventSchema);