2019-11-18 09:03:20 -05:00
|
|
|
const mongoose = require('../infrastructure/Mongoose')
|
2019-07-18 10:18:56 -04:00
|
|
|
const { UserSchema } = require('./User')
|
|
|
|
|
|
|
|
const { Schema } = mongoose
|
|
|
|
const { ObjectId } = Schema
|
|
|
|
|
|
|
|
const DeleterDataSchema = new Schema({
|
|
|
|
deleterId: { type: ObjectId, ref: 'User' },
|
|
|
|
deleterIpAddress: { type: String },
|
|
|
|
deletedAt: { type: Date },
|
|
|
|
deletedUserId: { type: ObjectId },
|
|
|
|
deletedUserLastLoggedIn: { type: Date },
|
|
|
|
deletedUserSignUpDate: { type: Date },
|
|
|
|
deletedUserLoginCount: { type: Number },
|
|
|
|
deletedUserReferralId: { type: String },
|
|
|
|
deletedUserReferredUsers: [{ type: ObjectId, ref: 'User' }],
|
|
|
|
deletedUserReferredUserCount: { type: Number },
|
2021-04-27 03:52:58 -04:00
|
|
|
deletedUserOverleafId: { type: Number },
|
2019-07-18 10:18:56 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
const DeletedUserSchema = new Schema(
|
|
|
|
{
|
|
|
|
deleterData: DeleterDataSchema,
|
2021-04-27 03:52:58 -04:00
|
|
|
user: UserSchema,
|
2019-07-18 10:18:56 -04:00
|
|
|
},
|
|
|
|
{ collection: 'deletedUsers' }
|
|
|
|
)
|
|
|
|
|
2019-11-18 09:03:20 -05:00
|
|
|
exports.DeletedUser = mongoose.model('DeletedUser', DeletedUserSchema)
|
2019-07-18 10:18:56 -04:00
|
|
|
|
|
|
|
exports.DeletedUserSchema = DeletedUserSchema
|