You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
789 B
21 lines
789 B
// user-notification.js
|
|
// Copyright (C) 2022 DTP Technologies, LLC
|
|
// License: Apache-2.0
|
|
|
|
'use strict';
|
|
|
|
const mongoose = require('mongoose');
|
|
const Schema = mongoose.Schema;
|
|
|
|
/*
|
|
* A notification is really just a user-specific bookmark to an event we know
|
|
* the user is interested in. These are the "timelines" presented to members.
|
|
*/
|
|
const UserNotificationSchema = new Schema({
|
|
created: { type: Date, default: Date.now, required: true, index: -1, expires: '7d' },
|
|
user: { type: Schema.ObjectId, required: true, index: 1, ref: 'User' },
|
|
status: { type: String, enum: ['new', 'seen'], default: 'new', required: true },
|
|
event: { type: Schema.ObjectId, required: true, ref: 'KaleidoscopeEvent' },
|
|
});
|
|
|
|
module.exports = mongoose.model('UserNotification', UserNotificationSchema);
|