codebase-models 2.0.3 → 2.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.
|
@@ -23,8 +23,15 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
|
+
export interface IFilters extends Document {
|
|
27
|
+
matchType: string;
|
|
28
|
+
value: string;
|
|
29
|
+
eventKey: string;
|
|
30
|
+
eventValue: string;
|
|
31
|
+
}
|
|
26
32
|
export interface IPrecalculationFilters extends Document {
|
|
27
33
|
title: string;
|
|
34
|
+
filterString: string;
|
|
28
35
|
organizationId: mongoose.Schema.Types.ObjectId;
|
|
29
36
|
client: mongoose.Schema.Types.ObjectId;
|
|
30
37
|
filters: any;
|
|
@@ -24,11 +24,21 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
27
|
+
const FiltersSchema = new mongoose_1.Schema({
|
|
28
|
+
matchType: { type: String, required: true },
|
|
29
|
+
value: { type: String, required: true },
|
|
30
|
+
eventKey: { type: String },
|
|
31
|
+
eventValue: { type: String },
|
|
32
|
+
});
|
|
27
33
|
const PrecalculationFiltersSchema = new mongoose_1.Schema({
|
|
28
34
|
title: {
|
|
29
35
|
type: String,
|
|
30
36
|
trim: true,
|
|
31
37
|
},
|
|
38
|
+
filterString: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
32
42
|
organizationId: {
|
|
33
43
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
34
44
|
ref: "organization",
|
|
@@ -38,7 +48,7 @@ const PrecalculationFiltersSchema = new mongoose_1.Schema({
|
|
|
38
48
|
ref: "client",
|
|
39
49
|
},
|
|
40
50
|
filters: {
|
|
41
|
-
type:
|
|
51
|
+
type: FiltersSchema,
|
|
42
52
|
required: true,
|
|
43
53
|
},
|
|
44
54
|
otherFilters: {
|
package/package.json
CHANGED
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
2
|
|
|
3
|
+
export interface IFilters extends Document {
|
|
4
|
+
matchType: string;
|
|
5
|
+
value: string;
|
|
6
|
+
eventKey: string;
|
|
7
|
+
eventValue: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
export interface IPrecalculationFilters extends Document {
|
|
4
11
|
title: string;
|
|
12
|
+
filterString: string;
|
|
5
13
|
organizationId: mongoose.Schema.Types.ObjectId;
|
|
6
14
|
client: mongoose.Schema.Types.ObjectId;
|
|
7
15
|
filters: any;
|
|
8
16
|
otherFilters: any;
|
|
9
17
|
}
|
|
10
18
|
|
|
19
|
+
const FiltersSchema = new Schema<IFilters>({
|
|
20
|
+
matchType: { type: String, required: true },
|
|
21
|
+
value: { type: String, required: true },
|
|
22
|
+
eventKey: { type: String },
|
|
23
|
+
eventValue: { type: String },
|
|
24
|
+
});
|
|
25
|
+
|
|
11
26
|
const PrecalculationFiltersSchema = new Schema<IPrecalculationFilters>({
|
|
12
27
|
title: {
|
|
13
28
|
type: String,
|
|
14
29
|
trim: true,
|
|
15
30
|
},
|
|
31
|
+
filterString: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
16
35
|
organizationId: {
|
|
17
36
|
type: mongoose.Schema.Types.ObjectId,
|
|
18
37
|
ref: "organization",
|
|
@@ -22,7 +41,7 @@ const PrecalculationFiltersSchema = new Schema<IPrecalculationFilters>({
|
|
|
22
41
|
ref: "client",
|
|
23
42
|
},
|
|
24
43
|
filters: {
|
|
25
|
-
type:
|
|
44
|
+
type: FiltersSchema,
|
|
26
45
|
required: true,
|
|
27
46
|
},
|
|
28
47
|
otherFilters: {
|