Spaces:
Paused
Paused
Download Models/Notification.js from imkrish/campverse-backend: direct link, hf CLI and curl.
- Browser
- Download file 875 Bytes
-
https://huggingface.co/spaces/imkrish/campverse-backend/resolve/main/Models/Notification.js
- Command line
-
hf download hf://spaces/imkrish/campverse-backend/Models/Notification.js
-
curl -L -o Notification.js https://huggingface.co/spaces/imkrish/campverse-backend/resolve/main/Models/Notification.js
875 Bytes
| const mongoose = require('mongoose'); | |
| const notificationSchema = new mongoose.Schema({ | |
| targetUserId: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'User', | |
| required: true, | |
| }, | |
| type: { | |
| type: String, | |
| enum: [ | |
| 'system', | |
| 'feedback', | |
| 'chat', | |
| 'approval', | |
| 'host_request', | |
| 'host_status_update', | |
| 'institution_request', | |
| 'event_reminder', | |
| 'rsvp', | |
| 'attendance', | |
| 'cohost', | |
| 'cohost_request', | |
| 'event_verification', | |
| ], | |
| required: true, | |
| }, | |
| message: { type: String, required: true }, | |
| data: { type: Object, default: {} }, | |
| link: { type: String }, // Link to open when notification is clicked (e.g., /events/:id) | |
| isRead: { type: Boolean, default: false }, | |
| createdAt: { type: Date, default: Date.now }, | |
| }); | |
| module.exports = mongoose.model('Notification', notificationSchema); | |