@dynamatix/cat-shared 0.0.115 → 0.0.117
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.
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const documentHistorySchema = new mongoose.Schema({
|
|
4
|
+
linkToDocumentId: {
|
|
5
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
+
ref: "Document",
|
|
7
|
+
required: false
|
|
8
|
+
},
|
|
9
|
+
respondedOn: { // when was the document responded
|
|
10
|
+
type: Date,
|
|
11
|
+
required: false
|
|
12
|
+
},
|
|
13
|
+
responderRemarks: { // remarks for response given by UW or Broker
|
|
14
|
+
type: String,
|
|
15
|
+
required: false
|
|
16
|
+
},
|
|
17
|
+
responderBy: { // who changed the status - user id
|
|
18
|
+
type: String,
|
|
19
|
+
required: false
|
|
20
|
+
},
|
|
21
|
+
docName: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: false
|
|
24
|
+
},
|
|
25
|
+
contentType: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: false
|
|
28
|
+
},
|
|
29
|
+
documentTypeId: {
|
|
30
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
31
|
+
ref: "DocumentType",
|
|
32
|
+
required: false
|
|
33
|
+
},
|
|
34
|
+
documentUrl: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: false
|
|
37
|
+
},
|
|
38
|
+
fileSize: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: false
|
|
41
|
+
},
|
|
42
|
+
externalData: { // will add any other external data here for future use
|
|
43
|
+
type: mongoose.Schema.Types.Mixed,
|
|
44
|
+
required: false,
|
|
45
|
+
default: {}
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
timestamps: false
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const DocumentHistoryModel = mongoose.models.DocumentHistory || mongoose.model("DocumentHistory", documentHistorySchema);
|
|
52
|
+
export default DocumentHistoryModel;
|
package/models/document.model.js
CHANGED
|
@@ -7,7 +7,8 @@ const documentSchema = new mongoose.Schema({
|
|
|
7
7
|
},
|
|
8
8
|
externalDocumentId: { // docId by Apprivo
|
|
9
9
|
type: String,
|
|
10
|
-
|
|
10
|
+
default: null,
|
|
11
|
+
required: false
|
|
11
12
|
},
|
|
12
13
|
filename: { // doc name to be shown in UI
|
|
13
14
|
type: String,
|
|
@@ -30,7 +31,7 @@ const documentSchema = new mongoose.Schema({
|
|
|
30
31
|
type: String,
|
|
31
32
|
required: false
|
|
32
33
|
},
|
|
33
|
-
status: { // doc status (pending, approved, rejected, ...)
|
|
34
|
+
status: { // doc current status (pending, approved, rejected, ...)
|
|
34
35
|
type: String,
|
|
35
36
|
required: false
|
|
36
37
|
},
|
|
@@ -38,22 +39,25 @@ const documentSchema = new mongoose.Schema({
|
|
|
38
39
|
type: String,
|
|
39
40
|
required: false
|
|
40
41
|
},
|
|
41
|
-
|
|
42
|
+
uploadedOn: {
|
|
42
43
|
type: Date,
|
|
43
44
|
required: false
|
|
44
45
|
},
|
|
45
|
-
|
|
46
|
+
uploadedBy: {
|
|
46
47
|
type: String,
|
|
47
48
|
required: false
|
|
48
49
|
},
|
|
49
|
-
|
|
50
|
-
type:
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
requesterDescription: { // description of the document request given by UW while requesting document
|
|
51
|
+
type: String,
|
|
52
|
+
default: "",
|
|
53
|
+
},
|
|
54
|
+
externalData: { // will add any other external data here
|
|
55
|
+
type: mongoose.Schema.Types.Mixed,
|
|
56
|
+
required: false,
|
|
57
|
+
default: {}
|
|
54
58
|
}
|
|
55
59
|
}, {
|
|
56
|
-
timestamps:
|
|
60
|
+
timestamps: false
|
|
57
61
|
});
|
|
58
62
|
|
|
59
63
|
const DocumentModel = mongoose.models.Document || mongoose.model("Document", documentSchema);
|
package/models/index.js
CHANGED
|
@@ -5,4 +5,5 @@ export { default as FormConfigurationModel } from './form-configuration.model.js
|
|
|
5
5
|
export { default as DocumentTypeModel } from './document-type.model.js';
|
|
6
6
|
export { default as DocumentModel } from './document.model.js';
|
|
7
7
|
export { default as WorkflowAlertModel } from './workflow-alert.model.js';
|
|
8
|
-
export { default as WorkflowConfigModel } from './workflow-config.model.js';
|
|
8
|
+
export { default as WorkflowConfigModel } from './workflow-config.model.js';
|
|
9
|
+
export { default as DocumentHistoryModel } from './document-history.model.js';
|