| const mongoose = require('mongoose'); | |
| const notificationSchema = new mongoose.Schema({ | |
| title: { type: String, required: true }, | |
| message: { type: String, required: true }, | |
| type: { type: String, enum: ['INFO', 'ALERT', 'WIN', 'UPDATE'], default: 'INFO' }, | |
| target_user_id: { type: mongoose.Schema.Types.ObjectId, ref: 'User', default: null }, | |
| created_at: { type: Date, default: Date.now, expires: '3d' } | |
| }); | |
| module.exports = mongoose.model('Notification', notificationSchema); |