@dynamatix/cat-shared 0.0.108 → 0.0.110
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.
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
|
|
3
|
-
const alertSchema = new Schema({
|
|
4
|
-
contextId: {
|
|
5
|
-
type: Schema.Types.ObjectId,
|
|
6
|
-
required: true
|
|
7
|
-
},
|
|
8
|
-
source: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true,
|
|
11
|
-
index: true
|
|
12
|
-
},
|
|
13
|
-
sourceId: {
|
|
14
|
-
type: Schema.Types.ObjectId,
|
|
15
|
-
required: true,
|
|
16
|
-
index: true
|
|
17
|
-
},
|
|
18
|
-
alertMessage: {
|
|
19
|
-
type: String,
|
|
20
|
-
required: false
|
|
21
|
-
},
|
|
22
|
-
category: {
|
|
23
|
-
type: String,
|
|
24
|
-
required: false,
|
|
25
|
-
index: true
|
|
26
|
-
},
|
|
27
|
-
isActive: {
|
|
28
|
-
type: Boolean,
|
|
29
|
-
required: true,
|
|
30
|
-
default: true,
|
|
31
|
-
index: true
|
|
32
|
-
},
|
|
33
|
-
status: {
|
|
34
|
-
type: String,
|
|
35
|
-
required: true,
|
|
36
|
-
enum: ['raised', 'satisfied'],
|
|
37
|
-
index: true
|
|
38
|
-
},
|
|
39
|
-
rationaleMessage: { type: String },
|
|
40
|
-
formName: { type: Array },
|
|
41
|
-
timestamp: {
|
|
42
|
-
type: Date,
|
|
43
|
-
required: true,
|
|
44
|
-
default: Date.now,
|
|
45
|
-
index: true
|
|
46
|
-
}
|
|
47
|
-
}, {
|
|
48
|
-
timestamps: true
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
// Compound index for efficient querying
|
|
52
|
-
alertSchema.index({ source: 1, sourceId: 1 });
|
|
53
|
-
alertSchema.index({ status: 1, isActive: 1 });
|
|
54
|
-
|
|
55
|
-
const WorkflowAlertModel = mongoose.model('WorkflowAlert', alertSchema);
|
|
56
|
-
export default WorkflowAlertModel;
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const alertSchema = new mongoose.Schema({
|
|
4
|
+
contextId: {
|
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
source: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true,
|
|
11
|
+
index: true
|
|
12
|
+
},
|
|
13
|
+
sourceId: {
|
|
14
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
15
|
+
required: true,
|
|
16
|
+
index: true
|
|
17
|
+
},
|
|
18
|
+
alertMessage: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: false
|
|
21
|
+
},
|
|
22
|
+
category: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false,
|
|
25
|
+
index: true
|
|
26
|
+
},
|
|
27
|
+
isActive: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
required: true,
|
|
30
|
+
default: true,
|
|
31
|
+
index: true
|
|
32
|
+
},
|
|
33
|
+
status: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
enum: ['raised', 'satisfied'],
|
|
37
|
+
index: true
|
|
38
|
+
},
|
|
39
|
+
rationaleMessage: { type: String },
|
|
40
|
+
formName: { type: Array },
|
|
41
|
+
timestamp: {
|
|
42
|
+
type: Date,
|
|
43
|
+
required: true,
|
|
44
|
+
default: Date.now,
|
|
45
|
+
index: true
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
timestamps: true
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Compound index for efficient querying
|
|
52
|
+
alertSchema.index({ source: 1, sourceId: 1 });
|
|
53
|
+
alertSchema.index({ status: 1, isActive: 1 });
|
|
54
|
+
|
|
55
|
+
const WorkflowAlertModel = mongoose.model('WorkflowAlert', alertSchema);
|
|
56
|
+
export default WorkflowAlertModel;
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import mongoose from 'mongoose';
|
|
2
|
-
|
|
3
|
-
const workflowConfigSchema = new Schema({
|
|
4
|
-
id: {
|
|
5
|
-
type: String,
|
|
6
|
-
required: true,
|
|
7
|
-
unique: true
|
|
8
|
-
},
|
|
9
|
-
name: {
|
|
10
|
-
type: String,
|
|
11
|
-
required: true
|
|
12
|
-
},
|
|
13
|
-
tasks: {
|
|
14
|
-
type: [Schema.Types.Mixed],
|
|
15
|
-
required: true
|
|
16
|
-
},
|
|
17
|
-
trigger: {
|
|
18
|
-
type: String,
|
|
19
|
-
required: true
|
|
20
|
-
},
|
|
21
|
-
validations: {
|
|
22
|
-
type: [Schema.Types.Mixed],
|
|
23
|
-
required: true
|
|
24
|
-
}
|
|
25
|
-
}, {
|
|
26
|
-
timestamps: true
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const WorkflowConfigModel = mongoose.model('WorkflowConfig', workflowConfigSchema);
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
const workflowConfigSchema = new mongoose.Schema({
|
|
4
|
+
id: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true,
|
|
7
|
+
unique: true
|
|
8
|
+
},
|
|
9
|
+
name: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true
|
|
12
|
+
},
|
|
13
|
+
tasks: {
|
|
14
|
+
type: [mongoose.Schema.Types.Mixed],
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
trigger: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
validations: {
|
|
22
|
+
type: [mongoose.Schema.Types.Mixed],
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
}, {
|
|
26
|
+
timestamps: true
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const WorkflowConfigModel = mongoose.model('WorkflowConfig', workflowConfigSchema);
|
|
30
30
|
export default WorkflowConfigModel;
|