overleaf/services/web/app/src/models/DeletedUser.js
Alf Eaton 1be43911b4 Merge pull request #3942 from overleaf/prettier-trailing-comma
Set Prettier's "trailingComma" setting to "es5"

GitOrigin-RevId: 9f14150511929a855b27467ad17be6ab262fe5d5
2021-04-28 02:10:01 +00:00

31 lines
932 B
JavaScript

const mongoose = require('../infrastructure/Mongoose')
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 },
deletedUserOverleafId: { type: Number },
})
const DeletedUserSchema = new Schema(
{
deleterData: DeleterDataSchema,
user: UserSchema,
},
{ collection: 'deletedUsers' }
)
exports.DeletedUser = mongoose.model('DeletedUser', DeletedUserSchema)
exports.DeletedUserSchema = DeletedUserSchema