feat: add soft delete for classes with cascade to sessions and linked records

This commit is contained in:
2026-08-21 13:19:50 +03:30
parent 5b56171328
commit e34fd25af7
15 changed files with 184 additions and 33 deletions
@@ -51,7 +51,16 @@ const pendingStudentSchema = new mongoose.Schema({
paymentReference: { type: String, trim: true },
adminNotes: { type: String, trim: true, maxlength: 2000 },
reviewedBy: { type: mongoose.Schema.Types.ObjectId, ref: 'User' },
reviewedAt: { type: Date }
reviewedAt: { type: Date },
isDeleted: {
type: Boolean,
default: false,
index: true
},
deletedAt: {
type: Date,
default: null
}
}, {
timestamps: true
});