mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-01-16 20:32:21 +01:00
53 lines
887 B
JavaScript
53 lines
887 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Module dependencies
|
|
*/
|
|
var mongoose = require('mongoose'),
|
|
Schema = mongoose.Schema;
|
|
|
|
/**
|
|
* Invitation Schema
|
|
*/
|
|
var InvitationSchema = new Schema({
|
|
user: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: 'User'
|
|
},
|
|
to_user: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: 'User'
|
|
},
|
|
to_email: {
|
|
type: String,
|
|
//unique: 'email already exists',
|
|
//required: 'Please fill in a email address',
|
|
lowercase: true,
|
|
trim: true,
|
|
default: ''
|
|
},
|
|
status: {
|
|
type: Number,
|
|
default: 0 //0 is unregistered invitation, 1 already invite friend, 2 is already registered
|
|
},
|
|
token: {
|
|
type: String,
|
|
default: ''
|
|
},
|
|
expiresat: {
|
|
type: Date
|
|
},
|
|
invitedat: {
|
|
type: Date
|
|
},
|
|
registeredat: {
|
|
type: Date
|
|
},
|
|
createdat: {
|
|
type: Date,
|
|
default: Date.now
|
|
}
|
|
});
|
|
|
|
mongoose.model('Invitation', InvitationSchema);
|