|
@@ -41,21 +41,21 @@ const inAppNotificationSchema = new Schema<InAppNotificationDocument, InAppNotif
|
|
|
type: Schema.Types.ObjectId,
|
|
type: Schema.Types.ObjectId,
|
|
|
ref: 'User',
|
|
ref: 'User',
|
|
|
index: true,
|
|
index: true,
|
|
|
- require: true,
|
|
|
|
|
|
|
+ required: true,
|
|
|
},
|
|
},
|
|
|
targetModel: {
|
|
targetModel: {
|
|
|
type: String,
|
|
type: String,
|
|
|
- require: true,
|
|
|
|
|
|
|
+ required: true,
|
|
|
enum: AllSupportedTargetModelType,
|
|
enum: AllSupportedTargetModelType,
|
|
|
},
|
|
},
|
|
|
target: {
|
|
target: {
|
|
|
type: Schema.Types.ObjectId,
|
|
type: Schema.Types.ObjectId,
|
|
|
refPath: 'targetModel',
|
|
refPath: 'targetModel',
|
|
|
- require: true,
|
|
|
|
|
|
|
+ required: true,
|
|
|
},
|
|
},
|
|
|
action: {
|
|
action: {
|
|
|
type: String,
|
|
type: String,
|
|
|
- require: true,
|
|
|
|
|
|
|
+ required: true,
|
|
|
enum: AllSupportedActionType,
|
|
enum: AllSupportedActionType,
|
|
|
},
|
|
},
|
|
|
activities: [
|
|
activities: [
|
|
@@ -69,7 +69,7 @@ const inAppNotificationSchema = new Schema<InAppNotificationDocument, InAppNotif
|
|
|
default: STATUS_UNREAD,
|
|
default: STATUS_UNREAD,
|
|
|
enum: InAppNotificationStatuses,
|
|
enum: InAppNotificationStatuses,
|
|
|
index: true,
|
|
index: true,
|
|
|
- require: true,
|
|
|
|
|
|
|
+ required: true,
|
|
|
},
|
|
},
|
|
|
createdAt: {
|
|
createdAt: {
|
|
|
type: Date,
|
|
type: Date,
|
|
@@ -77,7 +77,7 @@ const inAppNotificationSchema = new Schema<InAppNotificationDocument, InAppNotif
|
|
|
},
|
|
},
|
|
|
snapshot: {
|
|
snapshot: {
|
|
|
type: String,
|
|
type: String,
|
|
|
- require: true,
|
|
|
|
|
|
|
+ required: true,
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
inAppNotificationSchema.plugin(mongoosePaginate);
|
|
inAppNotificationSchema.plugin(mongoosePaginate);
|