codebase-models 1.0.0
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.
- package/dist/index.d.ts +66 -0
- package/dist/index.js +93 -0
- package/dist/src/constant.d.ts +11 -0
- package/dist/src/constant.js +15 -0
- package/dist/src/models/Announcement.d.ts +37 -0
- package/dist/src/models/Announcement.js +59 -0
- package/dist/src/models/CVRReport.d.ts +33 -0
- package/dist/src/models/CVRReport.js +40 -0
- package/dist/src/models/Client.d.ts +51 -0
- package/dist/src/models/Client.js +95 -0
- package/dist/src/models/ClientAdditionalRevenue.d.ts +41 -0
- package/dist/src/models/ClientAdditionalRevenue.js +68 -0
- package/dist/src/models/ClientLearning.d.ts +36 -0
- package/dist/src/models/ClientLearning.js +55 -0
- package/dist/src/models/ClientLinks.d.ts +39 -0
- package/dist/src/models/ClientLinks.js +66 -0
- package/dist/src/models/ClientNextSteps.d.ts +36 -0
- package/dist/src/models/ClientNextSteps.js +55 -0
- package/dist/src/models/ClientNote.d.ts +40 -0
- package/dist/src/models/ClientNote.js +68 -0
- package/dist/src/models/ClientReportsTemp.d.ts +41 -0
- package/dist/src/models/ClientReportsTemp.js +67 -0
- package/dist/src/models/ClientRetention.d.ts +42 -0
- package/dist/src/models/ClientRetention.js +78 -0
- package/dist/src/models/ClientStrategy.d.ts +41 -0
- package/dist/src/models/ClientStrategy.js +73 -0
- package/dist/src/models/ClientSurvay.d.ts +41 -0
- package/dist/src/models/ClientSurvay.js +45 -0
- package/dist/src/models/Faqs.d.ts +36 -0
- package/dist/src/models/Faqs.js +47 -0
- package/dist/src/models/Feedback.d.ts +38 -0
- package/dist/src/models/Feedback.js +58 -0
- package/dist/src/models/Goal.d.ts +37 -0
- package/dist/src/models/Goal.js +30 -0
- package/dist/src/models/Hypothesis.d.ts +39 -0
- package/dist/src/models/Hypothesis.js +38 -0
- package/dist/src/models/HypothesisSheet.d.ts +49 -0
- package/dist/src/models/HypothesisSheet.js +89 -0
- package/dist/src/models/LandingPages.d.ts +38 -0
- package/dist/src/models/LandingPages.js +54 -0
- package/dist/src/models/NewIdeas.d.ts +40 -0
- package/dist/src/models/NewIdeas.js +70 -0
- package/dist/src/models/Notification.d.ts +38 -0
- package/dist/src/models/Notification.js +33 -0
- package/dist/src/models/PageElement.d.ts +35 -0
- package/dist/src/models/PageElement.js +22 -0
- package/dist/src/models/PageTestType.d.ts +35 -0
- package/dist/src/models/PageTestType.js +24 -0
- package/dist/src/models/Portfolio.d.ts +33 -0
- package/dist/src/models/Portfolio.js +40 -0
- package/dist/src/models/QueryLog.d.ts +35 -0
- package/dist/src/models/QueryLog.js +46 -0
- package/dist/src/models/ReadNotification.d.ts +34 -0
- package/dist/src/models/ReadNotification.js +21 -0
- package/dist/src/models/Report.d.ts +47 -0
- package/dist/src/models/Report.js +89 -0
- package/dist/src/models/Role.d.ts +34 -0
- package/dist/src/models/Role.js +21 -0
- package/dist/src/models/SavedSegment.d.ts +34 -0
- package/dist/src/models/SavedSegment.js +44 -0
- package/dist/src/models/Segment.d.ts +37 -0
- package/dist/src/models/Segment.js +54 -0
- package/dist/src/models/SegmentCombination.d.ts +41 -0
- package/dist/src/models/SegmentCombination.js +68 -0
- package/dist/src/models/Snippet.d.ts +43 -0
- package/dist/src/models/Snippet.js +82 -0
- package/dist/src/models/StageInCustomerJourney.d.ts +35 -0
- package/dist/src/models/StageInCustomerJourney.js +21 -0
- package/dist/src/models/Tag.d.ts +34 -0
- package/dist/src/models/Tag.js +20 -0
- package/dist/src/models/Temp.d.ts +35 -0
- package/dist/src/models/Temp.js +22 -0
- package/dist/src/models/Test.d.ts +68 -0
- package/dist/src/models/Test.js +187 -0
- package/dist/src/models/TestSequentialValue.d.ts +38 -0
- package/dist/src/models/TestSequentialValue.js +54 -0
- package/dist/src/models/Tier.d.ts +36 -0
- package/dist/src/models/Tier.js +27 -0
- package/dist/src/models/Trigger.d.ts +36 -0
- package/dist/src/models/Trigger.js +24 -0
- package/dist/src/models/User.d.ts +42 -0
- package/dist/src/models/User.js +70 -0
- package/global.d.ts +1 -0
- package/index.ts +124 -0
- package/package.json +32 -0
- package/src/constant.ts +14 -0
- package/src/models/Announcement.ts +49 -0
- package/src/models/CVRReport.ts +25 -0
- package/src/models/Client.ts +100 -0
- package/src/models/ClientAdditionalRevenue.ts +67 -0
- package/src/models/ClientLearning.ts +48 -0
- package/src/models/ClientLinks.ts +58 -0
- package/src/models/ClientNextSteps.ts +47 -0
- package/src/models/ClientNote.ts +61 -0
- package/src/models/ClientReportsTemp.ts +64 -0
- package/src/models/ClientRetention.ts +76 -0
- package/src/models/ClientStrategy.ts +70 -0
- package/src/models/ClientSurvay.ts +36 -0
- package/src/models/Faqs.ts +32 -0
- package/src/models/Feedback.ts +46 -0
- package/src/models/Goal.ts +40 -0
- package/src/models/Hypothesis.ts +50 -0
- package/src/models/HypothesisSheet.ts +114 -0
- package/src/models/LandingPages.ts +46 -0
- package/src/models/NewIdeas.ts +63 -0
- package/src/models/Notification.ts +47 -0
- package/src/models/PageElement.ts +30 -0
- package/src/models/PageTestType.ts +32 -0
- package/src/models/Portfolio.ts +26 -0
- package/src/models/QueryLog.ts +34 -0
- package/src/models/ReadNotification.ts +34 -0
- package/src/models/Report.ts +87 -0
- package/src/models/Role.ts +28 -0
- package/src/models/SavedSegment.ts +31 -0
- package/src/models/Segment.ts +44 -0
- package/src/models/SegmentCombination.ts +62 -0
- package/src/models/Snippet.ts +78 -0
- package/src/models/StageInCustomerJourney.ts +35 -0
- package/src/models/Tag.ts +27 -0
- package/src/models/Temp.ts +30 -0
- package/src/models/Test.ts +209 -0
- package/src/models/TestSequentialValue.ts +49 -0
- package/src/models/Tier.ts +36 -0
- package/src/models/Trigger.ts +32 -0
- package/src/models/User.ts +61 -0
- package/tsconfig.json +109 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface INotification extends Document {
|
|
4
|
+
title?: string;
|
|
5
|
+
body?: string;
|
|
6
|
+
users?: mongoose.Schema.Types.ObjectId;
|
|
7
|
+
createdBy?: mongoose.Schema.Types.ObjectId;
|
|
8
|
+
archive?: boolean;
|
|
9
|
+
module?: string;
|
|
10
|
+
moduleData?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const NotificationSchema = new Schema<INotification>(
|
|
14
|
+
{
|
|
15
|
+
title: {
|
|
16
|
+
type: String,
|
|
17
|
+
},
|
|
18
|
+
body: {
|
|
19
|
+
type: String,
|
|
20
|
+
},
|
|
21
|
+
users: {
|
|
22
|
+
type: [Schema.Types.ObjectId],
|
|
23
|
+
ref: "user",
|
|
24
|
+
},
|
|
25
|
+
createdBy: {
|
|
26
|
+
type: Schema.Types.ObjectId,
|
|
27
|
+
ref: "user",
|
|
28
|
+
},
|
|
29
|
+
archive: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false,
|
|
32
|
+
},
|
|
33
|
+
module: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
moduleData: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
timestamps: true,
|
|
42
|
+
}
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
const Notification = model<INotification>("notification", NotificationSchema);
|
|
46
|
+
|
|
47
|
+
export default Notification;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IPageElement extends Document {
|
|
4
|
+
name: string;
|
|
5
|
+
slug?: string;
|
|
6
|
+
createdAt?: Date;
|
|
7
|
+
updatedAt?: Date;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const PageElementSchema = new Schema<IPageElement>({
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
slug: {
|
|
16
|
+
type: String,
|
|
17
|
+
},
|
|
18
|
+
createdAt: {
|
|
19
|
+
type: Date,
|
|
20
|
+
default: new Date(),
|
|
21
|
+
},
|
|
22
|
+
updatedAt: {
|
|
23
|
+
type: Date,
|
|
24
|
+
default: new Date(),
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const PageElement = model<IPageElement>("pageelement", PageElementSchema);
|
|
29
|
+
|
|
30
|
+
export default PageElement;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IPageTestType extends Document {
|
|
4
|
+
name: string;
|
|
5
|
+
details?: string;
|
|
6
|
+
createdAt?: Date;
|
|
7
|
+
updatedAt?: Date;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const PageTestTypeSchema = new Schema<IPageTestType>({
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
unique: true,
|
|
15
|
+
},
|
|
16
|
+
details: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: "",
|
|
19
|
+
},
|
|
20
|
+
createdAt: {
|
|
21
|
+
type: Date,
|
|
22
|
+
default: new Date(),
|
|
23
|
+
},
|
|
24
|
+
updatedAt: {
|
|
25
|
+
type: Date,
|
|
26
|
+
default: new Date(),
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
const PageTestType = model<IPageTestType>("pagetesttype", PageTestTypeSchema);
|
|
31
|
+
|
|
32
|
+
export default PageTestType;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IPortfolio extends Document {
|
|
4
|
+
portfoliokey: mongoose.Schema.Types.Mixed;
|
|
5
|
+
portfolioData?: mongoose.Schema.Types.Mixed;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const PortfolioSchema = new Schema<IPortfolio>(
|
|
9
|
+
{
|
|
10
|
+
portfoliokey: {
|
|
11
|
+
type: mongoose.Schema.Types.Mixed,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
portfolioData: {
|
|
15
|
+
type: mongoose.Schema.Types.Mixed,
|
|
16
|
+
default: null,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
timestamps: true,
|
|
21
|
+
}
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const Portfolio = model<IPortfolio>("portfolio", PortfolioSchema);
|
|
25
|
+
|
|
26
|
+
export default Portfolio;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IQueryLog extends Document {
|
|
4
|
+
organisationId?: string;
|
|
5
|
+
query: string;
|
|
6
|
+
timeTaken: number;
|
|
7
|
+
user?: mongoose.Schema.Types.ObjectId;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const QueryLogSchema = new Schema<IQueryLog>(
|
|
11
|
+
{
|
|
12
|
+
organisationId: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: null,
|
|
15
|
+
},
|
|
16
|
+
query: {
|
|
17
|
+
type: String,
|
|
18
|
+
},
|
|
19
|
+
timeTaken: {
|
|
20
|
+
type: Number,
|
|
21
|
+
},
|
|
22
|
+
user: {
|
|
23
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
24
|
+
ref: "user",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
timestamps: true,
|
|
29
|
+
}
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
const QueryLog = model<IQueryLog>("querylog", QueryLogSchema);
|
|
33
|
+
|
|
34
|
+
export default QueryLog;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IReadNotification extends Document {
|
|
4
|
+
notification?: mongoose.Schema.Types.ObjectId;
|
|
5
|
+
user?: mongoose.Schema.Types.ObjectId;
|
|
6
|
+
read?: boolean;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const ReadNotificationSchema = new Schema<IReadNotification>(
|
|
10
|
+
{
|
|
11
|
+
notification: {
|
|
12
|
+
type: Schema.Types.ObjectId,
|
|
13
|
+
ref: "notification",
|
|
14
|
+
},
|
|
15
|
+
user: {
|
|
16
|
+
type: Schema.Types.ObjectId,
|
|
17
|
+
ref: "user",
|
|
18
|
+
},
|
|
19
|
+
read: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: false,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
timestamps: true,
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const ReadNotification = model<IReadNotification>(
|
|
30
|
+
"readnotification",
|
|
31
|
+
ReadNotificationSchema
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
export default ReadNotification;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IReports extends Document {
|
|
4
|
+
name: string;
|
|
5
|
+
segmentName?: string;
|
|
6
|
+
reportLink?: string;
|
|
7
|
+
conclusion?: string;
|
|
8
|
+
variant?: string;
|
|
9
|
+
client?: mongoose.Schema.Types.ObjectId;
|
|
10
|
+
viewId?: string;
|
|
11
|
+
test?: mongoose.Schema.Types.ObjectId;
|
|
12
|
+
gaTestId?: string;
|
|
13
|
+
reportDetails?: mongoose.Schema.Types.Mixed;
|
|
14
|
+
learnings?: mongoose.Schema.Types.Mixed;
|
|
15
|
+
from?: Date;
|
|
16
|
+
to?: Date;
|
|
17
|
+
createdBy?: mongoose.Schema.Types.ObjectId;
|
|
18
|
+
createdAt?: Date;
|
|
19
|
+
updatedAt?: Date;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const ReportsSchema = new Schema<IReports>({
|
|
23
|
+
name: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
segmentName: {
|
|
28
|
+
type: String,
|
|
29
|
+
},
|
|
30
|
+
reportLink: {
|
|
31
|
+
type: String,
|
|
32
|
+
},
|
|
33
|
+
conclusion: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
variant: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
client: {
|
|
40
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
41
|
+
ref: "client",
|
|
42
|
+
},
|
|
43
|
+
viewId: {
|
|
44
|
+
type: String,
|
|
45
|
+
},
|
|
46
|
+
test: {
|
|
47
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
48
|
+
ref: "test",
|
|
49
|
+
},
|
|
50
|
+
gaTestId: {
|
|
51
|
+
type: String,
|
|
52
|
+
},
|
|
53
|
+
reportDetails: {
|
|
54
|
+
type: mongoose.Schema.Types.Mixed,
|
|
55
|
+
},
|
|
56
|
+
learnings: {
|
|
57
|
+
type: mongoose.Schema.Types.Mixed,
|
|
58
|
+
default: [],
|
|
59
|
+
},
|
|
60
|
+
from: {
|
|
61
|
+
type: Date,
|
|
62
|
+
},
|
|
63
|
+
to: {
|
|
64
|
+
type: Date,
|
|
65
|
+
},
|
|
66
|
+
createdBy: {
|
|
67
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
68
|
+
ref: "user",
|
|
69
|
+
},
|
|
70
|
+
createdAt: {
|
|
71
|
+
type: Date,
|
|
72
|
+
default: new Date(),
|
|
73
|
+
},
|
|
74
|
+
updatedAt: {
|
|
75
|
+
type: Date,
|
|
76
|
+
default: new Date(),
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
ReportsSchema.index({
|
|
81
|
+
client: 1,
|
|
82
|
+
conclusion: 1,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const Report = model<IReports>("report", ReportsSchema);
|
|
86
|
+
|
|
87
|
+
export default Report;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IRole extends Document {
|
|
4
|
+
name: string;
|
|
5
|
+
createdAt?: Date;
|
|
6
|
+
updatedAt?: Date;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const RoleSchema = new Schema<IRole>({
|
|
10
|
+
name: {
|
|
11
|
+
type: String,
|
|
12
|
+
unique: true,
|
|
13
|
+
required: true,
|
|
14
|
+
enum: ["USER", "ADMIN", "EDITOR", "COLLABORATOR", "CLIENT"],
|
|
15
|
+
},
|
|
16
|
+
createdAt: {
|
|
17
|
+
type: Date,
|
|
18
|
+
default: new Date(),
|
|
19
|
+
},
|
|
20
|
+
updatedAt: {
|
|
21
|
+
type: Date,
|
|
22
|
+
default: new Date(),
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const Role = model<IRole>("role", RoleSchema);
|
|
27
|
+
|
|
28
|
+
export default Role;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface ISavedSegment extends Document {
|
|
4
|
+
test?: mongoose.Schema.Types.ObjectId;
|
|
5
|
+
segment?: mongoose.Schema.Types.ObjectId;
|
|
6
|
+
segmentFilters?: mongoose.Schema.Types.Mixed;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const SavedSegmentSchema = new Schema<ISavedSegment>(
|
|
10
|
+
{
|
|
11
|
+
test: {
|
|
12
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
13
|
+
ref: "test",
|
|
14
|
+
},
|
|
15
|
+
segment: {
|
|
16
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
17
|
+
ref: "segmentcombination",
|
|
18
|
+
},
|
|
19
|
+
segmentFilters: {
|
|
20
|
+
type: mongoose.Schema.Types.Mixed,
|
|
21
|
+
default: null,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
timestamps: true,
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const SavedSegment = model<ISavedSegment>("savedsegment", SavedSegmentSchema);
|
|
30
|
+
|
|
31
|
+
export default SavedSegment;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface ISegment extends Document {
|
|
4
|
+
name?: string;
|
|
5
|
+
key?: string;
|
|
6
|
+
values?: string;
|
|
7
|
+
segmentType?: string;
|
|
8
|
+
client?: mongoose.Schema.Types.ObjectId;
|
|
9
|
+
published?: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const SegmentSchema = new Schema<ISegment>(
|
|
13
|
+
{
|
|
14
|
+
name: {
|
|
15
|
+
type: String,
|
|
16
|
+
},
|
|
17
|
+
key: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
20
|
+
values: {
|
|
21
|
+
type: String,
|
|
22
|
+
},
|
|
23
|
+
segmentType: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: "general",
|
|
26
|
+
},
|
|
27
|
+
client: {
|
|
28
|
+
type: [mongoose.Schema.Types.ObjectId],
|
|
29
|
+
ref: "client",
|
|
30
|
+
default: null,
|
|
31
|
+
},
|
|
32
|
+
published: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
timestamps: true,
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
|
|
42
|
+
const Segment = model<ISegment>("segment", SegmentSchema);
|
|
43
|
+
|
|
44
|
+
export default Segment;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface ISegmentCombination extends Document {
|
|
4
|
+
name?: string;
|
|
5
|
+
combination?: [];
|
|
6
|
+
gagroup?: string;
|
|
7
|
+
secondaryFilters?: [];
|
|
8
|
+
segmentType?: string;
|
|
9
|
+
client?: mongoose.Schema.Types.ObjectId[];
|
|
10
|
+
published?: boolean;
|
|
11
|
+
order?: Number;
|
|
12
|
+
createdAt?: Date;
|
|
13
|
+
updatedAt?: Date;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const SegmentSchema = new Schema<ISegmentCombination>({
|
|
17
|
+
name: {
|
|
18
|
+
type: String,
|
|
19
|
+
},
|
|
20
|
+
combination: {
|
|
21
|
+
type: [],
|
|
22
|
+
},
|
|
23
|
+
gagroup: {
|
|
24
|
+
typr: String,
|
|
25
|
+
},
|
|
26
|
+
secondaryFilters: {
|
|
27
|
+
type: [],
|
|
28
|
+
default: null,
|
|
29
|
+
},
|
|
30
|
+
segmentType: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "general",
|
|
33
|
+
},
|
|
34
|
+
client: {
|
|
35
|
+
type: [mongoose.Schema.Types.ObjectId],
|
|
36
|
+
ref: "client",
|
|
37
|
+
default: null,
|
|
38
|
+
},
|
|
39
|
+
published: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true,
|
|
42
|
+
},
|
|
43
|
+
order: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: 1,
|
|
46
|
+
},
|
|
47
|
+
createdAt: {
|
|
48
|
+
type: Date,
|
|
49
|
+
default: new Date(),
|
|
50
|
+
},
|
|
51
|
+
updatedAt: {
|
|
52
|
+
type: Date,
|
|
53
|
+
default: new Date(),
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
const SegmentCombination = model<ISegmentCombination>(
|
|
58
|
+
"segmentcombination",
|
|
59
|
+
SegmentSchema
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
export default SegmentCombination;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface ISnippet extends Document {
|
|
4
|
+
organisationId?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
pageelement?: mongoose.Schema.Types.ObjectId[];
|
|
7
|
+
client?: mongoose.Schema.Types.ObjectId;
|
|
8
|
+
details?: string;
|
|
9
|
+
figmaUrl?: string;
|
|
10
|
+
tags?: mongoose.Schema.Types.ObjectId[];
|
|
11
|
+
htmlcode?: string;
|
|
12
|
+
csscode?: string;
|
|
13
|
+
jscode?: string;
|
|
14
|
+
test?: mongoose.Schema.Types.ObjectId;
|
|
15
|
+
status?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const SnippetSchema = new Schema<ISnippet>(
|
|
19
|
+
{
|
|
20
|
+
organisationId: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: null,
|
|
23
|
+
},
|
|
24
|
+
name: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
unique: true,
|
|
28
|
+
},
|
|
29
|
+
pageelement: {
|
|
30
|
+
type: [mongoose.Schema.Types.ObjectId],
|
|
31
|
+
ref: "pageelement",
|
|
32
|
+
default: [],
|
|
33
|
+
},
|
|
34
|
+
client: {
|
|
35
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
36
|
+
ref: "client",
|
|
37
|
+
},
|
|
38
|
+
details: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "",
|
|
41
|
+
},
|
|
42
|
+
figmaUrl: {
|
|
43
|
+
type: String,
|
|
44
|
+
},
|
|
45
|
+
tags: {
|
|
46
|
+
type: [mongoose.Schema.Types.ObjectId],
|
|
47
|
+
ref: "tag",
|
|
48
|
+
default: [],
|
|
49
|
+
},
|
|
50
|
+
htmlcode: {
|
|
51
|
+
type: String,
|
|
52
|
+
default: "",
|
|
53
|
+
},
|
|
54
|
+
csscode: {
|
|
55
|
+
type: String,
|
|
56
|
+
},
|
|
57
|
+
jscode: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "",
|
|
60
|
+
},
|
|
61
|
+
test: {
|
|
62
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
63
|
+
ref: "test",
|
|
64
|
+
},
|
|
65
|
+
status: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "live",
|
|
68
|
+
enum: ["live", "draft"],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
timestamps: true,
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
const Snippet = model<ISnippet>("snippet", SnippetSchema);
|
|
77
|
+
|
|
78
|
+
export default Snippet;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IStageInCustomerJourney extends Document {
|
|
4
|
+
name?: string;
|
|
5
|
+
stages?: string;
|
|
6
|
+
slug?: string;
|
|
7
|
+
organizationId?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const StateInCustomerJourney = new Schema<IStageInCustomerJourney>(
|
|
11
|
+
{
|
|
12
|
+
name: {
|
|
13
|
+
type: String,
|
|
14
|
+
},
|
|
15
|
+
stages: {
|
|
16
|
+
type: String,
|
|
17
|
+
},
|
|
18
|
+
slug: {
|
|
19
|
+
type: String,
|
|
20
|
+
},
|
|
21
|
+
organizationId: {
|
|
22
|
+
type: String,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
timestamps: true,
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
const StageInCustomerJourney = model<IStageInCustomerJourney>(
|
|
31
|
+
"stageincustomerjourney",
|
|
32
|
+
StateInCustomerJourney
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export default StageInCustomerJourney;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface ITag extends Document {
|
|
4
|
+
name: string;
|
|
5
|
+
createdAt?: Date;
|
|
6
|
+
updatedAt?: Date;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const TagSchema = new Schema<ITag>({
|
|
10
|
+
name: {
|
|
11
|
+
type: String,
|
|
12
|
+
unique: true,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
createdAt: {
|
|
16
|
+
type: Date,
|
|
17
|
+
default: new Date(),
|
|
18
|
+
},
|
|
19
|
+
updatedAt: {
|
|
20
|
+
type: Date,
|
|
21
|
+
default: new Date(),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const Tag = model<ITag>("tag", TagSchema);
|
|
26
|
+
|
|
27
|
+
export default Tag;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface ITemp extends Document {
|
|
4
|
+
secret?: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
createdAt?: Date;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const TempSchema = new Schema<ITemp>({
|
|
11
|
+
secret: {
|
|
12
|
+
type: String,
|
|
13
|
+
},
|
|
14
|
+
userId: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
enabled: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: false,
|
|
21
|
+
},
|
|
22
|
+
createdAt: {
|
|
23
|
+
type: Date,
|
|
24
|
+
default: new Date(),
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const Temp = model<ITemp>("temp", TempSchema);
|
|
29
|
+
|
|
30
|
+
export default Temp;
|