codebase-models 1.0.2 → 1.0.4
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/package.json
CHANGED
package/src/models/Audience.ts
CHANGED
|
@@ -3,24 +3,27 @@ import mongoose, { Document, Schema, model } from "mongoose";
|
|
|
3
3
|
export interface IAudience extends Document {
|
|
4
4
|
name: string;
|
|
5
5
|
rules_js?: string;
|
|
6
|
-
client
|
|
6
|
+
client?: mongoose.Schema.Types.ObjectId;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
const AudienceSchema = new Schema<IAudience>(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const AudienceSchema = new Schema<IAudience>(
|
|
10
|
+
{
|
|
11
|
+
name: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
rules_js: {
|
|
16
|
+
type: String,
|
|
17
|
+
},
|
|
18
|
+
client: {
|
|
19
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
20
|
+
ref: "client",
|
|
21
|
+
},
|
|
13
22
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
client: {
|
|
18
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
19
|
-
ref: "client",
|
|
23
|
+
{
|
|
24
|
+
timestamps: true,
|
|
20
25
|
}
|
|
21
|
-
|
|
22
|
-
timestamps: true,
|
|
23
|
-
});
|
|
26
|
+
);
|
|
24
27
|
|
|
25
28
|
const Audience = model<IAudience>("audience", AudienceSchema);
|
|
26
29
|
|
package/src/models/Client.ts
CHANGED
|
@@ -31,6 +31,8 @@ export interface IClient extends Document {
|
|
|
31
31
|
bqClientId?: string;
|
|
32
32
|
defaultDataSet?: string;
|
|
33
33
|
NDAStatus?: boolean;
|
|
34
|
+
retainerValue: number;
|
|
35
|
+
useIntraDayTable: boolean;
|
|
34
36
|
}
|
|
35
37
|
|
|
36
38
|
const ClientSchema: Schema = new Schema<IClient>(
|
|
@@ -89,6 +91,12 @@ const ClientSchema: Schema = new Schema<IClient>(
|
|
|
89
91
|
type: Boolean,
|
|
90
92
|
default: false,
|
|
91
93
|
},
|
|
94
|
+
retainerValue: {
|
|
95
|
+
type: Number,
|
|
96
|
+
},
|
|
97
|
+
useIntraDayTable: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
},
|
|
92
100
|
},
|
|
93
101
|
{ timestamps: true }
|
|
94
102
|
);
|
|
@@ -28,6 +28,7 @@ const ClientRetentionSchema = new Schema<IClientRetention>(
|
|
|
28
28
|
year: {
|
|
29
29
|
type: Number,
|
|
30
30
|
required: true,
|
|
31
|
+
default: new Date().getFullYear(),
|
|
31
32
|
},
|
|
32
33
|
retentions: {
|
|
33
34
|
type: [
|
|
@@ -36,14 +37,19 @@ const ClientRetentionSchema = new Schema<IClientRetention>(
|
|
|
36
37
|
year: {
|
|
37
38
|
type: Number,
|
|
38
39
|
required: true,
|
|
40
|
+
default: new Date().getFullYear(),
|
|
39
41
|
},
|
|
40
42
|
month: {
|
|
41
43
|
type: Number,
|
|
42
44
|
required: true,
|
|
45
|
+
default: new Date().getMonth() + 1,
|
|
43
46
|
},
|
|
44
47
|
monthName: {
|
|
45
48
|
type: String,
|
|
46
49
|
required: true,
|
|
50
|
+
default: new Date().toLocaleString("default", {
|
|
51
|
+
month: "long",
|
|
52
|
+
}),
|
|
47
53
|
},
|
|
48
54
|
active: {
|
|
49
55
|
type: Boolean,
|
|
@@ -53,6 +59,7 @@ const ClientRetentionSchema = new Schema<IClientRetention>(
|
|
|
53
59
|
retainerValue: {
|
|
54
60
|
type: Number,
|
|
55
61
|
required: true,
|
|
62
|
+
default:0,
|
|
56
63
|
},
|
|
57
64
|
otherPayments: {
|
|
58
65
|
type: Number,
|
|
@@ -26,9 +26,9 @@ export interface IExperiments extends Document {
|
|
|
26
26
|
js: string;
|
|
27
27
|
reset_js: string;
|
|
28
28
|
csscode: string;
|
|
29
|
-
audiences
|
|
29
|
+
audiences?: mongoose.Schema.Types.Array;
|
|
30
30
|
variations: IVariations;
|
|
31
|
-
environments
|
|
31
|
+
environments?: mongoose.Schema.Types.Array;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
const VariationsSchema = new Schema<IVariations>({
|
package/src/models/Test.ts
CHANGED
|
@@ -26,14 +26,14 @@ export interface ITest extends Document {
|
|
|
26
26
|
jscode: string;
|
|
27
27
|
reset_js: string;
|
|
28
28
|
csscode: string;
|
|
29
|
-
audiences
|
|
29
|
+
audiences?: mongoose.Schema.Types.ObjectId[];
|
|
30
30
|
variations: IVariations[];
|
|
31
|
-
environments
|
|
31
|
+
environments?: mongoose.Schema.Types.Array;
|
|
32
32
|
pages?: mongoose.Schema.Types.ObjectId[];
|
|
33
|
-
// OLD SCHEMA VARIABLES
|
|
33
|
+
// OLD SCHEMA VARIABLES
|
|
34
34
|
pageelement?: mongoose.Schema.Types.ObjectId[];
|
|
35
35
|
client?: mongoose.Schema.Types.ObjectId;
|
|
36
|
-
property
|
|
36
|
+
property?: mongoose.Schema.Types.Mixed;
|
|
37
37
|
platform: string;
|
|
38
38
|
viewId: string;
|
|
39
39
|
goal?: mongoose.Schema.Types.ObjectId[];
|