-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathuserPreferences.js
More file actions
23 lines (21 loc) · 766 Bytes
/
userPreferences.js
File metadata and controls
23 lines (21 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const mongoose = require('mongoose');
const userPreferencesSchema = new mongoose.Schema({
user: { type: mongoose.Schema.Types.ObjectId, ref: 'userProfile', required: true },
notifyInApp: { type: Boolean, default: false },
notifyEmail: { type: Boolean, default: false },
notifySms: { type: Boolean, default: false },
smsPhone: { type: String, default: '' },
smsPhoneLast4: { type: String, default: '' },
users: [
{
userNotifyingFor: {
type: mongoose.Schema.Types.ObjectId,
ref: 'userProfile',
required: true,
},
notifyInApp: { type: Boolean, default: false },
notifyEmail: { type: Boolean, default: false },
},
],
});
module.exports = mongoose.model('UserPreferences', userPreferencesSchema);