@dynamatix/cat-shared 0.0.103 → 0.0.104
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/models/document-type-model.js +26 -0
- package/models/document.model.js +60 -0
- package/models/index.js +3 -1
- package/package.json +1 -1
|
@@ -0,0 +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.model('DocumentType', documentTypeSchema);
|
|
25
|
+
|
|
26
|
+
export default DocumentTypeModel;
|
|
@@ -0,0 +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.model("Document", documentSchema);
|
|
60
|
+
export default DocumentModel;
|
package/models/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { default as AuditConfigModel } from './audit-config.model.js';
|
|
2
2
|
export { default as AuditModel } from './audit.model.js';
|
|
3
3
|
export { default as ValueReferenceMapModel } from './value-reference-map.model.js';
|
|
4
|
-
export { default as FormConfigurationModel } from './form-configuration.model.js';
|
|
4
|
+
export { default as FormConfigurationModel } from './form-configuration.model.js';
|
|
5
|
+
export { default as DocumentTypeModel } from './document-type-model.js';
|
|
6
|
+
export { default as DocumentModel } from './document.model.js';
|