@dynamatix/cat-shared 0.0.112 → 0.0.114
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/README.md +6 -6
- package/index.js +2 -2
- package/middlewares/audit.middleware.js +340 -340
- package/middlewares/index.js +2 -2
- package/models/audit-config.model.js +15 -15
- package/models/audit.model.js +16 -16
- package/models/document-type.model.js +25 -25
- package/models/document.model.js +59 -59
- package/models/form-configuration.model.js +269 -269
- package/models/index.js +7 -7
- package/models/value-reference-map.model.js +16 -16
- package/models/workflow-alert.model.js +56 -56
- package/models/workflow-config.model.js +29 -29
- package/package.json +22 -21
- package/seeders/value-reference-map.seeder.js +66 -66
- package/services/audit-log.hook.js +2 -2
- package/services/index.js +1 -1
- package/services/request-context.service.js +8 -8
package/middlewares/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {default as applyAuditMiddleware} from './audit.middleware.js';
|
|
2
|
-
export { registerAuditHook } from './audit.middleware.js';
|
|
1
|
+
export {default as applyAuditMiddleware} from './audit.middleware.js';
|
|
2
|
+
export { registerAuditHook } from './audit.middleware.js';
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import mongoose from 'mongoose';
|
|
2
|
-
|
|
3
|
-
const auditConfigSchema = new mongoose.Schema({
|
|
4
|
-
collectionName: String,
|
|
5
|
-
fields: [String],
|
|
6
|
-
trackCreation: { type: Boolean, default: false },
|
|
7
|
-
trackDeletion: { type: Boolean, default: false },
|
|
8
|
-
descriptionResolutorForExternalData: { type: String, default: null },
|
|
9
|
-
descriptionResolutorForDeletion: { type: String, default: null },
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const AuditConfigModel = mongoose.models.AuditConfig || mongoose.model('AuditConfig', auditConfigSchema);
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export default AuditConfigModel;
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
const auditConfigSchema = new mongoose.Schema({
|
|
4
|
+
collectionName: String,
|
|
5
|
+
fields: [String],
|
|
6
|
+
trackCreation: { type: Boolean, default: false },
|
|
7
|
+
trackDeletion: { type: Boolean, default: false },
|
|
8
|
+
descriptionResolutorForExternalData: { type: String, default: null },
|
|
9
|
+
descriptionResolutorForDeletion: { type: String, default: null },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const AuditConfigModel = mongoose.models.AuditConfig || mongoose.model('AuditConfig', auditConfigSchema);
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
export default AuditConfigModel;
|
package/models/audit.model.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import mongoose from 'mongoose';
|
|
2
|
-
|
|
3
|
-
const auditSchema = new mongoose.Schema({
|
|
4
|
-
name: { type: String, default: null },
|
|
5
|
-
recordId: { type: mongoose.Schema.Types.ObjectId, default: null },
|
|
6
|
-
contextId: { type: mongoose.Schema.Types.ObjectId, default: null },
|
|
7
|
-
oldValue: { type: mongoose.Schema.Types.Mixed, default: null },
|
|
8
|
-
newValue: { type: mongoose.Schema.Types.Mixed, default: null },
|
|
9
|
-
timestamp: { type: Date, default: Date.now },
|
|
10
|
-
createdBy: { type: mongoose.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
11
|
-
externalData: { type: mongoose.Schema.Types.Mixed, default: null }
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
const AuditLog = mongoose.models.AuditLog || mongoose.model('AuditLog', auditSchema);
|
|
15
|
-
|
|
16
|
-
export default AuditLog;
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
const auditSchema = new mongoose.Schema({
|
|
4
|
+
name: { type: String, default: null },
|
|
5
|
+
recordId: { type: mongoose.Schema.Types.ObjectId, default: null },
|
|
6
|
+
contextId: { type: mongoose.Schema.Types.ObjectId, default: null },
|
|
7
|
+
oldValue: { type: mongoose.Schema.Types.Mixed, default: null },
|
|
8
|
+
newValue: { type: mongoose.Schema.Types.Mixed, default: null },
|
|
9
|
+
timestamp: { type: Date, default: Date.now },
|
|
10
|
+
createdBy: { type: mongoose.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
11
|
+
externalData: { type: mongoose.Schema.Types.Mixed, default: null }
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const AuditLog = mongoose.models.AuditLog || mongoose.model('AuditLog', auditSchema);
|
|
15
|
+
|
|
16
|
+
export default AuditLog;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
|
|
3
|
-
const documentTypeSchema = new mongoose.Schema({
|
|
4
|
-
name: { type: String, required: true },
|
|
5
|
-
label: { type: String },
|
|
6
|
-
linkedDocTypes: {
|
|
7
|
-
type: [String], // Array of strings
|
|
8
|
-
default: []
|
|
9
|
-
},
|
|
10
|
-
source: { type: String, enum: ['Applicant', 'Application'], default: null },
|
|
11
|
-
parentDocumentTypeId: { type: mongoose.Schema.Types.ObjectId, ref: 'DocumentType', default: null },
|
|
12
|
-
categoryDescription: { // description only for document categories and not doc types
|
|
13
|
-
type: String,
|
|
14
|
-
required: false,
|
|
15
|
-
default: null
|
|
16
|
-
},
|
|
17
|
-
isForBroker: { // there are some doc types are not to be shown to broker
|
|
18
|
-
type: Boolean,
|
|
19
|
-
default: false
|
|
20
|
-
},
|
|
21
|
-
matchRules: { type: mongoose.Schema.Types.Mixed }
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
const DocumentTypeModel = mongoose.models.DocumentType || mongoose.model('DocumentType', documentTypeSchema);
|
|
25
|
-
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const documentTypeSchema = new mongoose.Schema({
|
|
4
|
+
name: { type: String, required: true },
|
|
5
|
+
label: { type: String },
|
|
6
|
+
linkedDocTypes: {
|
|
7
|
+
type: [String], // Array of strings
|
|
8
|
+
default: []
|
|
9
|
+
},
|
|
10
|
+
source: { type: String, enum: ['Applicant', 'Application'], default: null },
|
|
11
|
+
parentDocumentTypeId: { type: mongoose.Schema.Types.ObjectId, ref: 'DocumentType', default: null },
|
|
12
|
+
categoryDescription: { // description only for document categories and not doc types
|
|
13
|
+
type: String,
|
|
14
|
+
required: false,
|
|
15
|
+
default: null
|
|
16
|
+
},
|
|
17
|
+
isForBroker: { // there are some doc types are not to be shown to broker
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: false
|
|
20
|
+
},
|
|
21
|
+
matchRules: { type: mongoose.Schema.Types.Mixed }
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const DocumentTypeModel = mongoose.models.DocumentType || mongoose.model('DocumentType', documentTypeSchema);
|
|
25
|
+
|
|
26
26
|
export default DocumentTypeModel;
|
package/models/document.model.js
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
|
|
3
|
-
const documentSchema = new mongoose.Schema({
|
|
4
|
-
contextId: { // can be application or applicant
|
|
5
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
-
required: false
|
|
7
|
-
},
|
|
8
|
-
externalDocumentId: { // docId by Apprivo
|
|
9
|
-
type: String,
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
filename: { // doc name to be shown in UI
|
|
13
|
-
type: String,
|
|
14
|
-
required: false
|
|
15
|
-
},
|
|
16
|
-
docName: { // doc name of uploaded file to be shown in UI
|
|
17
|
-
type: String,
|
|
18
|
-
required: false
|
|
19
|
-
},
|
|
20
|
-
contentType: {
|
|
21
|
-
type: String,
|
|
22
|
-
required: false
|
|
23
|
-
},
|
|
24
|
-
documentTypeId: {
|
|
25
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
26
|
-
ref: "DocumentType",
|
|
27
|
-
required: false
|
|
28
|
-
},
|
|
29
|
-
documentUrl: { // uploaded doc url
|
|
30
|
-
type: String,
|
|
31
|
-
required: false
|
|
32
|
-
},
|
|
33
|
-
status: { // doc status (pending, approved, rejected, ...)
|
|
34
|
-
type: String,
|
|
35
|
-
required: false
|
|
36
|
-
},
|
|
37
|
-
fileSize: {
|
|
38
|
-
type: String,
|
|
39
|
-
required: false
|
|
40
|
-
},
|
|
41
|
-
createdOn: {
|
|
42
|
-
type: Date,
|
|
43
|
-
required: false
|
|
44
|
-
},
|
|
45
|
-
createdBy: {
|
|
46
|
-
type: String,
|
|
47
|
-
required: false
|
|
48
|
-
},
|
|
49
|
-
externalData: {
|
|
50
|
-
type: {
|
|
51
|
-
ownerName: { type: String, required: false }
|
|
52
|
-
},
|
|
53
|
-
required: false
|
|
54
|
-
}
|
|
55
|
-
}, {
|
|
56
|
-
timestamps: true
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const DocumentModel = mongoose.models.Document || mongoose.model("Document", documentSchema);
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const documentSchema = new mongoose.Schema({
|
|
4
|
+
contextId: { // can be application or applicant
|
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
+
required: false
|
|
7
|
+
},
|
|
8
|
+
externalDocumentId: { // docId by Apprivo
|
|
9
|
+
type: String,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
filename: { // doc name to be shown in UI
|
|
13
|
+
type: String,
|
|
14
|
+
required: false
|
|
15
|
+
},
|
|
16
|
+
docName: { // doc name of uploaded file to be shown in UI
|
|
17
|
+
type: String,
|
|
18
|
+
required: false
|
|
19
|
+
},
|
|
20
|
+
contentType: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: false
|
|
23
|
+
},
|
|
24
|
+
documentTypeId: {
|
|
25
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
26
|
+
ref: "DocumentType",
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
documentUrl: { // uploaded doc url
|
|
30
|
+
type: String,
|
|
31
|
+
required: false
|
|
32
|
+
},
|
|
33
|
+
status: { // doc status (pending, approved, rejected, ...)
|
|
34
|
+
type: String,
|
|
35
|
+
required: false
|
|
36
|
+
},
|
|
37
|
+
fileSize: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: false
|
|
40
|
+
},
|
|
41
|
+
createdOn: {
|
|
42
|
+
type: Date,
|
|
43
|
+
required: false
|
|
44
|
+
},
|
|
45
|
+
createdBy: {
|
|
46
|
+
type: String,
|
|
47
|
+
required: false
|
|
48
|
+
},
|
|
49
|
+
externalData: {
|
|
50
|
+
type: {
|
|
51
|
+
ownerName: { type: String, required: false }
|
|
52
|
+
},
|
|
53
|
+
required: false
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
timestamps: true
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const DocumentModel = mongoose.models.Document || mongoose.model("Document", documentSchema);
|
|
60
60
|
export default DocumentModel;
|