2019-11-18 09:03:20 -05:00
|
|
|
const mongoose = require('../infrastructure/Mongoose')
|
2019-07-18 10:18:56 -04:00
|
|
|
const { ProjectSchema } = require('./Project')
|
2019-05-29 05:21:06 -04:00
|
|
|
|
|
|
|
const { Schema } = mongoose
|
|
|
|
const { ObjectId } = Schema
|
|
|
|
|
|
|
|
const DeleterDataSchema = new Schema({
|
|
|
|
deleterId: { type: ObjectId, ref: 'User' },
|
|
|
|
deleterIpAddress: { type: String },
|
2019-07-18 10:18:56 -04:00
|
|
|
deletedAt: { type: Date },
|
|
|
|
deletedProjectId: { type: ObjectId },
|
|
|
|
deletedProjectOwnerId: { type: ObjectId, ref: 'User' },
|
|
|
|
deletedProjectCollaboratorIds: [{ type: ObjectId, ref: 'User' }],
|
|
|
|
deletedProjectReadOnlyIds: [{ type: ObjectId, ref: 'User' }],
|
|
|
|
deletedProjectReadWriteTokenAccessIds: [{ type: ObjectId, ref: 'User' }],
|
|
|
|
deletedProjectReadOnlyTokenAccessIds: [{ type: ObjectId, ref: 'User' }],
|
|
|
|
deletedProjectReadWriteToken: { type: String },
|
|
|
|
deletedProjectReadOnlyToken: { type: String },
|
2019-07-26 10:26:25 -04:00
|
|
|
deletedProjectLastUpdatedAt: { type: Date },
|
|
|
|
deletedProjectOverleafId: { type: Number },
|
2022-12-07 15:08:30 -05:00
|
|
|
deletedProjectOverleafHistoryId: { type: Schema.Types.Mixed },
|
2019-05-29 05:21:06 -04:00
|
|
|
})
|
|
|
|
|
|
|
|
const DeletedProjectSchema = new Schema(
|
|
|
|
{
|
2019-07-18 10:18:56 -04:00
|
|
|
deleterData: DeleterDataSchema,
|
2021-04-27 03:52:58 -04:00
|
|
|
project: ProjectSchema,
|
2019-05-29 05:21:06 -04:00
|
|
|
},
|
2023-02-28 08:26:18 -05:00
|
|
|
{ collection: 'deletedProjects', minimize: false }
|
2019-05-29 05:21:06 -04:00
|
|
|
)
|
|
|
|
|
2019-11-18 09:03:20 -05:00
|
|
|
exports.DeletedProject = mongoose.model('DeletedProject', DeletedProjectSchema)
|
2019-05-29 05:21:06 -04:00
|
|
|
exports.DeletedProjectSchema = DeletedProjectSchema
|