feat: add soft delete for classes with cascade to sessions and linked records
This commit is contained in:
@@ -45,7 +45,16 @@ const paymentSchema = new mongoose.Schema({
|
||||
enum: ['pending', 'partial', 'paid', 'overdue'],
|
||||
default: 'pending'
|
||||
},
|
||||
notes: { type: String, trim: true, maxlength: 5000 }
|
||||
notes: { type: String, trim: true, maxlength: 5000 },
|
||||
isDeleted: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
index: true
|
||||
},
|
||||
deletedAt: {
|
||||
type: Date,
|
||||
default: null
|
||||
}
|
||||
}, {
|
||||
timestamps: true,
|
||||
toJSON: { virtuals: true },
|
||||
|
||||
Reference in New Issue
Block a user