|
|
@@ -5,30 +5,17 @@ export interface ISubscribeRule {
|
|
|
name: string,
|
|
|
isEnabled: boolean;
|
|
|
}
|
|
|
-
|
|
|
-export interface ISubscribeSettings {
|
|
|
- subscribeRules: ISubscribeRule[];
|
|
|
-}
|
|
|
-
|
|
|
export interface IInAppNotificationSettings {
|
|
|
userId: Schema.Types.ObjectId;
|
|
|
- subscribeSettings: ISubscribeSettings;
|
|
|
+ subscribeRules: ISubscribeRule[];
|
|
|
}
|
|
|
|
|
|
export interface InAppNotificationSettingsDocument extends IInAppNotificationSettings, Document {}
|
|
|
export type InAppNotificationSettingsModel = Model<InAppNotificationSettingsDocument>
|
|
|
|
|
|
-const subscribeSettingsSchema = new Schema<ISubscribeSettings>({
|
|
|
- subscribeRules: {
|
|
|
- type: [
|
|
|
- { name: { type: String }, isEnabled: { type: Boolean } },
|
|
|
- ],
|
|
|
- },
|
|
|
-});
|
|
|
-
|
|
|
const inAppNotificationSettingsSchema = new Schema<IInAppNotificationSettings>({
|
|
|
userId: { type: String },
|
|
|
- subscribeSettings: subscribeSettingsSchema,
|
|
|
+ subscribeRules: [{ name: { type: String }, isEnabled: { type: Boolean } }],
|
|
|
});
|
|
|
|
|
|
// eslint-disable-next-line max-len
|