@dynamatix/gb-schemas 1.3.241 → 1.3.244

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.
@@ -30,9 +30,9 @@ import mongoose from "mongoose";
30
30
  declare const ApplictionNoteModel: mongoose.Model<{
31
31
  comment: string;
32
32
  applicationId: mongoose.Types.ObjectId;
33
- createdBy: string;
34
33
  noteId: string;
35
34
  createdOn: string;
35
+ createdBy: string;
36
36
  username: string;
37
37
  subject: string;
38
38
  note: string;
@@ -52,9 +52,9 @@ declare const ApplictionNoteModel: mongoose.Model<{
52
52
  }, {}, {}, {}, mongoose.Document<unknown, {}, {
53
53
  comment: string;
54
54
  applicationId: mongoose.Types.ObjectId;
55
- createdBy: string;
56
55
  noteId: string;
57
56
  createdOn: string;
57
+ createdBy: string;
58
58
  username: string;
59
59
  subject: string;
60
60
  note: string;
@@ -74,9 +74,9 @@ declare const ApplictionNoteModel: mongoose.Model<{
74
74
  }, {}> & {
75
75
  comment: string;
76
76
  applicationId: mongoose.Types.ObjectId;
77
- createdBy: string;
78
77
  noteId: string;
79
78
  createdOn: string;
79
+ createdBy: string;
80
80
  username: string;
81
81
  subject: string;
82
82
  note: string;
@@ -100,9 +100,9 @@ declare const ApplictionNoteModel: mongoose.Model<{
100
100
  }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
101
101
  comment: string;
102
102
  applicationId: mongoose.Types.ObjectId;
103
- createdBy: string;
104
103
  noteId: string;
105
104
  createdOn: string;
105
+ createdBy: string;
106
106
  username: string;
107
107
  subject: string;
108
108
  note: string;
@@ -122,9 +122,9 @@ declare const ApplictionNoteModel: mongoose.Model<{
122
122
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
123
123
  comment: string;
124
124
  applicationId: mongoose.Types.ObjectId;
125
- createdBy: string;
126
125
  noteId: string;
127
126
  createdOn: string;
127
+ createdBy: string;
128
128
  username: string;
129
129
  subject: string;
130
130
  note: string;
@@ -144,9 +144,9 @@ declare const ApplictionNoteModel: mongoose.Model<{
144
144
  }>, {}> & mongoose.FlatRecord<{
145
145
  comment: string;
146
146
  applicationId: mongoose.Types.ObjectId;
147
- createdBy: string;
148
147
  noteId: string;
149
148
  createdOn: string;
149
+ createdBy: string;
150
150
  username: string;
151
151
  subject: string;
152
152
  note: string;
@@ -12,10 +12,8 @@ export { default as ApplicationValuationModel } from './application-valuation.mo
12
12
  export { default as BrokerModel } from './broker.model';
13
13
  export { default as ProductModel } from './application-product.model';
14
14
  export { default as SolicitorModel } from './solicitor.model';
15
- export { default as ApplicationDocumentModel } from './application-document.model';
16
15
  export { default as ApplicationRiskNarrativeModel } from './application-risk-narrative.model';
17
16
  export { default as ApplicationFieldConfigModel } from './application-fieldconfig.model';
18
- export { default as DocumentModel } from './document.model';
19
17
  export { default as MortgageModel } from './application-mortgage.model';
20
18
  export { default as ApplicationProductFeaturesModel } from './application-productfeatures.model';
21
19
  export { default as ApplicationEucModel } from './application-euc.model';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../applications/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAC7E,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AAC9F,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AACzF,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAA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ation.mo
12
12
  export { default as BrokerModel } from './broker.model';
13
13
  export { default as ProductModel } from './application-product.model';
14
14
  export { default as SolicitorModel } from './solicitor.model';
15
- export { default as ApplicationDocumentModel } from './application-document.model';
16
15
  export { default as ApplicationRiskNarrativeModel } from './application-risk-narrative.model';
17
16
  export { default as ApplicationFieldConfigModel } from './application-fieldconfig.model';
18
- export { default as DocumentModel } from './document.model';
19
17
  export { default as MortgageModel } from './application-mortgage.model';
20
18
  export { default as ApplicationProductFeaturesModel } from './application-productfeatures.model';
21
19
  export { default as ApplicationEucModel } from './application-euc.model';
@@ -33,30 +33,30 @@ declare const AlertModel: mongoose.Model<{
33
33
  } & {
34
34
  applicationId: mongoose.Types.ObjectId;
35
35
  isActive: string;
36
- documentId?: mongoose.Types.ObjectId | null | undefined;
37
36
  statusLid?: mongoose.Types.ObjectId | null | undefined;
38
37
  alertTypeLid?: mongoose.Types.ObjectId | null | undefined;
39
38
  alertMessage?: string | null | undefined;
39
+ documentId?: mongoose.Types.ObjectId | null | undefined;
40
40
  }, {}, {}, {}, mongoose.Document<unknown, {}, {
41
41
  createdAt: NativeDate;
42
42
  updatedAt: NativeDate;
43
43
  } & {
44
44
  applicationId: mongoose.Types.ObjectId;
45
45
  isActive: string;
46
- documentId?: mongoose.Types.ObjectId | null | undefined;
47
46
  statusLid?: mongoose.Types.ObjectId | null | undefined;
48
47
  alertTypeLid?: mongoose.Types.ObjectId | null | undefined;
49
48
  alertMessage?: string | null | undefined;
49
+ documentId?: mongoose.Types.ObjectId | null | undefined;
50
50
  }, {}> & {
51
51
  createdAt: NativeDate;
52
52
  updatedAt: NativeDate;
53
53
  } & {
54
54
  applicationId: mongoose.Types.ObjectId;
55
55
  isActive: string;
56
- documentId?: mongoose.Types.ObjectId | null | undefined;
57
56
  statusLid?: mongoose.Types.ObjectId | null | undefined;
58
57
  alertTypeLid?: mongoose.Types.ObjectId | null | undefined;
59
58
  alertMessage?: string | null | undefined;
59
+ documentId?: mongoose.Types.ObjectId | null | undefined;
60
60
  } & {
61
61
  _id: mongoose.Types.ObjectId;
62
62
  } & {
@@ -69,30 +69,30 @@ declare const AlertModel: mongoose.Model<{
69
69
  } & {
70
70
  applicationId: mongoose.Types.ObjectId;
71
71
  isActive: string;
72
- documentId?: mongoose.Types.ObjectId | null | undefined;
73
72
  statusLid?: mongoose.Types.ObjectId | null | undefined;
74
73
  alertTypeLid?: mongoose.Types.ObjectId | null | undefined;
75
74
  alertMessage?: string | null | undefined;
75
+ documentId?: mongoose.Types.ObjectId | null | undefined;
76
76
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
77
77
  createdAt: NativeDate;
78
78
  updatedAt: NativeDate;
79
79
  } & {
80
80
  applicationId: mongoose.Types.ObjectId;
81
81
  isActive: string;
82
- documentId?: mongoose.Types.ObjectId | null | undefined;
83
82
  statusLid?: mongoose.Types.ObjectId | null | undefined;
84
83
  alertTypeLid?: mongoose.Types.ObjectId | null | undefined;
85
84
  alertMessage?: string | null | undefined;
85
+ documentId?: mongoose.Types.ObjectId | null | undefined;
86
86
  }>, {}> & mongoose.FlatRecord<{
87
87
  createdAt: NativeDate;
88
88
  updatedAt: NativeDate;
89
89
  } & {
90
90
  applicationId: mongoose.Types.ObjectId;
91
91
  isActive: string;
92
- documentId?: mongoose.Types.ObjectId | null | undefined;
93
92
  statusLid?: mongoose.Types.ObjectId | null | undefined;
94
93
  alertTypeLid?: mongoose.Types.ObjectId | null | undefined;
95
94
  alertMessage?: string | null | undefined;
95
+ documentId?: mongoose.Types.ObjectId | null | undefined;
96
96
  }> & {
97
97
  _id: mongoose.Types.ObjectId;
98
98
  } & {
@@ -8,6 +8,5 @@ export { default as TaskModel } from './task.model';
8
8
  export { default as ApprivoSyncJourneyModel } from './apprivo-sync-journey.model';
9
9
  export { default as JobRunModel } from './job-run.model';
10
10
  export { default as TaskDocumentTypeModel } from './task-document.model';
11
- export { default as DocumentTypeModel } from './document-type-model';
12
11
  export { default as SchemaDocModel } from './schema-doc.model';
13
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../shared/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAC,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAC,MAAM,uBAAuB,CAAA;AACvE,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../shared/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,UAAU,EAAC,MAAM,eAAe,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAC,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAC,MAAM,uBAAuB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
@@ -8,5 +8,4 @@ export { default as TaskModel } from './task.model';
8
8
  export { default as ApprivoSyncJourneyModel } from './apprivo-sync-journey.model';
9
9
  export { default as JobRunModel } from './job-run.model';
10
10
  export { default as TaskDocumentTypeModel } from './task-document.model';
11
- export { default as DocumentTypeModel } from './document-type-model';
12
11
  export { default as SchemaDocModel } from './schema-doc.model';
@@ -1 +1 @@
1
- {"version":3,"file":"pound.d.ts","sourceRoot":"","sources":["../../value-objects/pound.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,QAAQ,UAAU,CAAC;IACtB,UAAU,MAAM,CAAC;QACb,UAAU,KAAK,CAAC;YACZ,MAAM,KAAM,SAAQ,UAAU;aAAI;SACrC;KACJ;CACJ;AAED,cAAM,KAAM,SAAQ,QAAQ,CAAC,UAAU;gBACvB,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,SAAS,GAAG,SAAS;IAKhE,IAAI,CAAC,GAAG,EAAE,GAAG;CA6ChB;AAMD,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,CAMnD;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"pound.d.ts","sourceRoot":"","sources":["../../value-objects/pound.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAGhC,OAAO,QAAQ,UAAU,CAAC;IACtB,UAAU,MAAM,CAAC;QACb,UAAU,KAAK,CAAC;YACZ,MAAM,KAAM,SAAQ,UAAU;aAAI;SACrC;KACJ;CACJ;AAED,cAAM,KAAM,SAAQ,QAAQ,CAAC,UAAU;gBACvB,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,SAAS,GAAG,SAAS;IAKhE,IAAI,CAAC,GAAG,EAAE,GAAG;CAkDhB;AAMD,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,GAAG,IAAI,CAMnD;AAED,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -9,6 +9,10 @@ class Pound extends mongoose.SchemaType {
9
9
  if (val == null) {
10
10
  return val; // Allow null or undefined values
11
11
  }
12
+ // Handle empty string by treating it as 0
13
+ if (val === '') {
14
+ return 0.00;
15
+ }
12
16
  // If it's already a number, validate and return
13
17
  if (typeof val === 'number') {
14
18
  if (isNaN(val)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.3.241",
3
+ "version": "1.3.244",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "homepage": "https://github.com/DynamatixAnalyticsPvtLtd/gb-schemas#readme",
27
27
  "dependencies": {
28
- "@dynamatix/cat-shared": "^0.0.100",
28
+ "@dynamatix/cat-shared": "^0.0.104",
29
29
  "dotenv": "^16.4.5",
30
30
  "mongodb": "^6.14.2",
31
31
  "mongoose": "^8.9.5"
@@ -1,82 +0,0 @@
1
- import mongoose from "mongoose";
2
- import { Pound, formatPound } from "../value-objects/pound";
3
- import { applyAuditMiddleware } from "@dynamatix/cat-shared/middlewares";
4
- const incomeSchema = new mongoose.Schema({
5
- applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
6
- accountantsAddressLine1: { type: String, },
7
- accountantsAddressLine2: { type: String, },
8
- accountantsAddressLine3: { type: String, },
9
- accountantsCity: { type: String, default: '' },
10
- accountantsCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", },
11
- accountantsEmail: { type: String, },
12
- accountantsPostCode: { type: String, },
13
- accountantsPractice: { type: String, },
14
- accountantsTelephoneNumber: { type: String, },
15
- businessAddressLine1: { type: String, },
16
- businessAddressLine2: { type: String, },
17
- businessAddressLine3: { type: String, },
18
- businessCity: { type: String, default: '' },
19
- businessCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", },
20
- businessPostCode: { type: String, },
21
- businessTelephoneNumber: { type: String, },
22
- businessTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", },
23
- charteredCertifiedOrOtherLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", },
24
- contactName: { type: String, },
25
- currentYearEnd: { type: String, },
26
- dateEstablished: { type: String, },
27
- doYouHaveAccountant: {
28
- type: Boolean,
29
- default: false
30
- },
31
- isBusinessAddressDifferent: {
32
- type: Boolean,
33
- default: false
34
- },
35
- nameOfBusiness: { type: String, },
36
- natureOfBusiness: { type: String, },
37
- netAssets1: { type: Pound, default: 0.00, get: formatPound },
38
- netAssets2: { type: Pound, default: 0.00, get: formatPound },
39
- netAssets3: { type: Pound, default: 0.00, get: formatPound },
40
- pageValidFlag: { type: String, default: true },
41
- percentageOfShareholding: { type: Number, min: 0, max: 100 },
42
- registeredAddressLine1: { type: String, },
43
- registeredAddressLine2: { type: String, },
44
- registeredAddressLine3: { type: String, },
45
- registeredCity: { type: String, default: '' },
46
- registeredCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", },
47
- registeredPostCode: { type: String, },
48
- registeredTelephone: { type: String, },
49
- selfEmployedDate: { type: String, },
50
- totalEmploymentGrossIncome: { type: Pound, default: 0.00 },
51
- totalEmploymentNetIncome: { type: Pound, default: 0.00 },
52
- isEmploymentIncomeConfirmed: { type: Boolean, default: false },
53
- employmentIncomeRationale: { type: String, default: null },
54
- isPensionIncomeConfirmed: { type: Boolean, default: false },
55
- pensionIncomeRationale: { type: String, default: null },
56
- totalPensionGrossIncome: { type: Pound, get: formatPound, default: 0.00 },
57
- totalPensionNetIncome: { type: Pound, get: formatPound, default: 0.00 },
58
- totalAdditionalGrossIncome: { type: Pound, get: formatPound, default: 0.00 },
59
- totalAdditionalNetIncome: { type: Pound, get: formatPound, default: 0.00 },
60
- isAdditionalIncomeConfirmed: { type: Boolean, default: false },
61
- additionalIncomeRationale: { type: String, default: null },
62
- isUKTaxCreditsIncomeConfirmed: { type: Boolean, default: false },
63
- totalUKTaxCreditsNetIncome: { type: Pound, get: formatPound, default: 0.00 },
64
- ukTaxCreditsIncomeRationale: { type: String, default: null },
65
- totalUKTaxCreditsGrossIncome: { type: Pound, get: formatPound, default: 0.00 },
66
- isPropertyIncomeConfirmed: { type: Boolean, default: false },
67
- propertyIncomeRationale: { type: String, default: null },
68
- selfEmployedIncomeRationale: { type: String, default: null },
69
- isSelfEmployedIncomeConfirmed: { type: Boolean, default: false },
70
- totalSelfEmployedGrossIncome: { type: Pound, get: formatPound, default: 0.00 },
71
- totalSelfEmployedNetIncome: { type: Pound, get: formatPound, default: 0.00 },
72
- soleTraderIncomeRationale: { type: String, default: null },
73
- isSoleTraderIncomeConfirmed: { type: Boolean, default: false },
74
- soleTraderGrossIncome: { type: Pound, get: formatPound, default: 0.00 },
75
- soleTraderNetIncome: { type: Pound, get: formatPound, default: 0.00 },
76
- }, {
77
- toJSON: { getters: true },
78
- toObject: { getters: true }
79
- });
80
- applyAuditMiddleware(incomeSchema, "Applicant_Income");
81
- const ApplicantIncomeModel = mongoose.model("Applicant_Income", incomeSchema);
82
- export default ApplicantIncomeModel;
@@ -1,35 +0,0 @@
1
- import mongoose from "mongoose";
2
- const documentSchema = new mongoose.Schema({
3
- applicationId: {
4
- type: mongoose.Schema.Types.ObjectId,
5
- ref: "Application",
6
- required: false,
7
- },
8
- documentId: { type: String, required: true },
9
- owningEntityId: { type: String, required: false },
10
- documentTypeLid: {
11
- type: mongoose.Schema.Types.ObjectId,
12
- ref: "Lookup",
13
- required: false,
14
- },
15
- documentTypeId: { type: String, required: false },
16
- fileName: { type: String, required: false },
17
- contentType: { type: String, required: false },
18
- created: { type: String, required: false },
19
- createdBy: { type: String, required: false },
20
- isGenerated: { type: String, required: false },
21
- data: { type: String, required: false },
22
- envelopeId: { type: String, required: false },
23
- signers: { type: Array, default: [] },
24
- documentType: {
25
- documentTypeId: { type: String, required: false },
26
- displayName: { type: String, required: false },
27
- value: { type: String, required: false },
28
- data: { type: Object, required: false },
29
- },
30
- documentUrl: { type: String, required: false },
31
- }, {
32
- timestamps: true
33
- });
34
- const ApplicationDocumentModel = mongoose.model("ApplicationDocument", documentSchema);
35
- export default ApplicationDocumentModel;
@@ -1,35 +0,0 @@
1
- import mongoose from "mongoose";
2
- const documentSchema = new mongoose.Schema({
3
- applicationId: {
4
- type: mongoose.Schema.Types.ObjectId,
5
- ref: "Application",
6
- required: false,
7
- },
8
- documentId: { type: String, required: true },
9
- owningEntityId: { type: String, required: false },
10
- documentTypeLid: {
11
- type: mongoose.Schema.Types.ObjectId,
12
- ref: "Lookup",
13
- required: false,
14
- },
15
- documentTypeId: { type: mongoose.Schema.Types.ObjectId, ref: "DocumentType", required: false },
16
- fileName: { type: String, required: false },
17
- contentType: { type: String, required: false },
18
- created: { type: String, required: false },
19
- createdBy: { type: String, required: false },
20
- isGenerated: { type: String, required: false },
21
- data: { type: String, required: false },
22
- envelopeId: { type: String, required: false },
23
- signers: { type: Array, default: [] },
24
- documentType: {
25
- documentTypeId: { type: String, required: false },
26
- displayName: { type: String, required: false },
27
- value: { type: String, required: false },
28
- data: { type: Object, required: false },
29
- },
30
- documentUrl: { type: String, required: false },
31
- }, {
32
- timestamps: true
33
- });
34
- const DocumentModel = mongoose.model("Document", documentSchema);
35
- export default DocumentModel;
@@ -1,10 +0,0 @@
1
- import mongoose from "mongoose";
2
- const DocumentTypeSchema = new mongoose.Schema({
3
- name: { type: String, required: true },
4
- label: { type: String },
5
- source: { type: String, default: null },
6
- parentDocumentTypeId: { type: mongoose.Schema.Types.ObjectId, ref: 'DocumentType', default: null },
7
- matchRules: { type: mongoose.Schema.Types.Mixed }
8
- });
9
- const DocumentTypeModel = mongoose.model('DocumentType', DocumentTypeSchema);
10
- export default DocumentTypeModel;