@cool-digital-solutions/interferir-models 1.0.80 → 1.0.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,14 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const mongoose_1 = require("mongoose");
|
|
4
4
|
const _config_1 = require("../config");
|
|
5
|
+
const notification_type_1 = require("../types/notification.type");
|
|
5
6
|
const notificationSchema = new mongoose_1.Schema({
|
|
6
7
|
user: {
|
|
7
8
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
9
|
ref: 'User',
|
|
9
10
|
required: [true, 'user required!'],
|
|
10
11
|
},
|
|
12
|
+
company: {
|
|
13
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
14
|
+
ref: 'Company',
|
|
15
|
+
default: null,
|
|
16
|
+
},
|
|
11
17
|
title: { type: String, required: [true, 'title required!'] },
|
|
12
18
|
message: { type: String, required: [true, 'message required!'] },
|
|
19
|
+
type: { type: String, enum: Object.values(notification_type_1.NotificationType), required: [true, 'type is required!'] },
|
|
20
|
+
messageType: { type: String, enum: Object.values(notification_type_1.MessageType), required: [true, 'messageType is required!'] },
|
|
21
|
+
url: { type: String },
|
|
22
|
+
isRead: { type: Boolean, default: null },
|
|
13
23
|
updatedDate: { type: Number, index: -1 },
|
|
14
24
|
createdDate: { type: Number, index: -1 },
|
|
15
25
|
}, _config_1.schemaOptions);
|
|
@@ -23,12 +23,27 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Types } from 'mongoose';
|
|
26
|
-
import { IUser } from './';
|
|
26
|
+
import { ICompany, IUser } from './';
|
|
27
27
|
import { BaseModel, BaseSchema } from '../config';
|
|
28
|
+
export declare enum NotificationType {
|
|
29
|
+
POPUP = "popup",
|
|
30
|
+
NOTIFICATION = "notification"
|
|
31
|
+
}
|
|
32
|
+
export declare enum MessageType {
|
|
33
|
+
AI_AGENT = "aiAgent",
|
|
34
|
+
COMPETITOR = "competitor",
|
|
35
|
+
INSTANT_RESEARCH = "instantResearch",
|
|
36
|
+
FOLLOW = "follow"
|
|
37
|
+
}
|
|
28
38
|
export interface INotification extends BaseSchema {
|
|
29
39
|
user: Types.ObjectId | IUser;
|
|
40
|
+
company: Types.ObjectId | ICompany;
|
|
41
|
+
type: NotificationType;
|
|
30
42
|
title: string;
|
|
31
43
|
message: string;
|
|
44
|
+
messageType: MessageType;
|
|
45
|
+
url: string;
|
|
46
|
+
isRead: boolean;
|
|
32
47
|
}
|
|
33
48
|
export interface INotificationModel extends BaseModel<INotification> {
|
|
34
49
|
}
|
|
@@ -1,2 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageType = exports.NotificationType = void 0;
|
|
4
|
+
var NotificationType;
|
|
5
|
+
(function (NotificationType) {
|
|
6
|
+
NotificationType["POPUP"] = "popup";
|
|
7
|
+
NotificationType["NOTIFICATION"] = "notification";
|
|
8
|
+
})(NotificationType || (exports.NotificationType = NotificationType = {}));
|
|
9
|
+
var MessageType;
|
|
10
|
+
(function (MessageType) {
|
|
11
|
+
MessageType["AI_AGENT"] = "aiAgent";
|
|
12
|
+
MessageType["COMPETITOR"] = "competitor";
|
|
13
|
+
MessageType["INSTANT_RESEARCH"] = "instantResearch";
|
|
14
|
+
MessageType["FOLLOW"] = "follow";
|
|
15
|
+
})(MessageType || (exports.MessageType = MessageType = {}));
|