CVBora / models /GenerationLog.js
ismizo's picture
Upload 19 files
7e054b1 verified
Raw History Blame Contribute Delete
609 Bytes
const mongoose = require('mongoose');
const GenerationLogSchema = new mongoose.Schema({
userId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true },
email: { type: String, default: '' }, // denormalized for fast display
type: { type: String, enum: ['free', 'paid'], required: true },
jobTitle: { type: String, default: '' }, // best-effort extracted from instructions
createdAt: { type: Date, default: Date.now },
});
GenerationLogSchema.index({ createdAt: -1 });
module.exports = mongoose.model('GenerationLog', GenerationLogSchema);