@dynamatix/gb-schemas 2.0.24 → 2.0.26
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/dist/applicants/applicant-additional-income.model.d.ts +47 -927
- package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-additional-income.model.js +3 -23
- package/dist/applicants/applicant-commitment-creditCard.model.d.ts +32 -0
- package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-creditCard.model.js +1 -0
- package/dist/applicants/applicant-commitment-loan.model.d.ts +32 -0
- package/dist/applicants/applicant-commitment-loan.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-loan.model.js +1 -0
- package/dist/applicants/applicant-commitment-mortgage.model.d.ts +32 -0
- package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-mortgage.model.js +1 -0
- package/dist/applicants/applicant-commitment-residence.model.d.ts +26 -0
- package/dist/applicants/applicant-commitment-residence.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-secureLoan.model.d.ts +26 -0
- package/dist/applicants/applicant-commitment-secureLoan.model.d.ts.map +1 -1
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts +26 -0
- package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts.map +1 -1
- package/dist/applicants/applicant-credit-data.model.d.ts +27 -0
- package/dist/applicants/applicant-credit-data.model.d.ts.map +1 -1
- package/dist/applicants/applicant-credit-profile.model.d.ts +27 -0
- package/dist/applicants/applicant-credit-profile.model.d.ts.map +1 -1
- package/dist/applicants/applicant-direct-debit.model.d.ts +27 -0
- package/dist/applicants/applicant-direct-debit.model.d.ts.map +1 -1
- package/dist/applicants/applicant-employment-income.model.d.ts +26 -0
- package/dist/applicants/applicant-employment-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-employment.model.d.ts +26 -0
- package/dist/applicants/applicant-employment.model.d.ts.map +1 -1
- package/dist/applicants/applicant-expenditure.model.d.ts +26 -0
- package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -1
- package/dist/applicants/applicant-income-source.model.d.ts +27 -0
- package/dist/applicants/applicant-income-source.model.d.ts.map +1 -1
- package/dist/applicants/applicant-income.model.d.ts +26 -12
- package/dist/applicants/applicant-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-pension-income.model.d.ts +314 -0
- package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-pension-income.model.js +13 -0
- package/dist/applicants/applicant-property-income.model.d.ts +26 -0
- package/dist/applicants/applicant-property-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-risk-narrative.model.d.ts +27 -0
- package/dist/applicants/applicant-risk-narrative.model.d.ts.map +1 -1
- package/dist/applicants/applicant-uk-tax-credits.model.d.ts +314 -0
- package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -1
- package/dist/applicants/applicant-uk-tax-credits.model.js +2 -0
- package/dist/applicants/applicant.model.d.ts +27 -0
- package/dist/applicants/applicant.model.d.ts.map +1 -1
- package/dist/applications/application-audit.model.d.ts +27 -0
- package/dist/applications/application-audit.model.d.ts.map +1 -1
- package/dist/applications/application-checklist-Item.model.d.ts +27 -0
- package/dist/applications/application-checklist-Item.model.d.ts.map +1 -1
- package/dist/applications/application-company-model.d.ts +26 -0
- package/dist/applications/application-company-model.d.ts.map +1 -1
- package/dist/applications/application-credit-profile.model.d.ts +27 -0
- package/dist/applications/application-credit-profile.model.d.ts.map +1 -1
- package/dist/applications/application-direct-debit.model.d.ts +26 -0
- package/dist/applications/application-direct-debit.model.d.ts.map +1 -1
- package/dist/applications/application-document.model.d.ts +27 -0
- package/dist/applications/application-document.model.d.ts.map +1 -1
- package/dist/applications/application-fieldconfig.model.d.ts +27 -0
- package/dist/applications/application-fieldconfig.model.d.ts.map +1 -1
- package/dist/applications/application-illustration-model.d.ts +27 -0
- package/dist/applications/application-illustration-model.d.ts.map +1 -1
- package/dist/applications/application-legal.model.d.ts +27 -0
- package/dist/applications/application-legal.model.d.ts.map +1 -1
- package/dist/applications/application-mortgage.model.d.ts +26 -0
- package/dist/applications/application-mortgage.model.d.ts.map +1 -1
- package/dist/applications/application-note.model.d.ts +27 -0
- package/dist/applications/application-note.model.d.ts.map +1 -1
- package/dist/applications/application-offer.model.d.ts +27 -0
- package/dist/applications/application-offer.model.d.ts.map +1 -1
- package/dist/applications/application-onboarding.model.d.ts +27 -0
- package/dist/applications/application-onboarding.model.d.ts.map +1 -1
- package/dist/applications/application-product.model.d.ts +27 -0
- package/dist/applications/application-product.model.d.ts.map +1 -1
- package/dist/applications/application-productfeatures.model.d.ts +27 -0
- package/dist/applications/application-productfeatures.model.d.ts.map +1 -1
- package/dist/applications/application-rationale.model.d.ts +27 -0
- package/dist/applications/application-rationale.model.d.ts.map +1 -1
- package/dist/applications/application-risk-narrative.model.d.ts +27 -0
- package/dist/applications/application-risk-narrative.model.d.ts.map +1 -1
- package/dist/applications/application-valuation.model.d.ts +27 -0
- package/dist/applications/application-valuation.model.d.ts.map +1 -1
- package/dist/applications/application.model.d.ts +27 -0
- package/dist/applications/application.model.d.ts.map +1 -1
- package/dist/applications/broker.model.d.ts +27 -0
- package/dist/applications/broker.model.d.ts.map +1 -1
- package/dist/applications/document.model.d.ts +27 -0
- package/dist/applications/document.model.d.ts.map +1 -1
- package/dist/applications/solicitor.model.d.ts +26 -0
- package/dist/applications/solicitor.model.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/product-catalogues/product-catalogue.model.d.ts +27 -0
- package/dist/product-catalogues/product-catalogue.model.d.ts.map +1 -1
- package/dist/product-catalogues/product-definitions.model.d.ts +27 -0
- package/dist/product-catalogues/product-definitions.model.d.ts.map +1 -1
- package/dist/product-catalogues/product-variant.model.d.ts +27 -0
- package/dist/product-catalogues/product-variant.model.d.ts.map +1 -1
- package/dist/properties/property.model.d.ts +26 -0
- package/dist/properties/property.model.d.ts.map +1 -1
- package/dist/properties/security.model.d.ts +27 -0
- package/dist/properties/security.model.d.ts.map +1 -1
- package/dist/shared/alert.model.d.ts +27 -0
- package/dist/shared/alert.model.d.ts.map +1 -1
- package/dist/shared/apprivo-sync-journey.model.d.ts +27 -0
- package/dist/shared/apprivo-sync-journey.model.d.ts.map +1 -1
- package/dist/shared/checklist.model.d.ts +27 -0
- package/dist/shared/checklist.model.d.ts.map +1 -1
- package/dist/shared/document-type-model.d.ts +27 -0
- package/dist/shared/document-type-model.d.ts.map +1 -1
- package/dist/shared/job-run.model.d.ts +27 -0
- package/dist/shared/job-run.model.d.ts.map +1 -1
- package/dist/shared/job-setting.model.d.ts +27 -0
- package/dist/shared/job-setting.model.d.ts.map +1 -1
- package/dist/shared/lookup-group.model.d.ts +27 -0
- package/dist/shared/lookup-group.model.d.ts.map +1 -1
- package/dist/shared/lookup.model.d.ts +27 -0
- package/dist/shared/lookup.model.d.ts.map +1 -1
- package/dist/shared/schema-doc.model.d.ts +27 -0
- package/dist/shared/schema-doc.model.d.ts.map +1 -1
- package/dist/shared/system-parameter.model.d.ts +27 -0
- package/dist/shared/system-parameter.model.d.ts.map +1 -1
- package/dist/shared/task-document.model.d.ts +27 -0
- package/dist/shared/task-document.model.d.ts.map +1 -1
- package/dist/shared/task.model.d.ts +27 -0
- package/dist/shared/task.model.d.ts.map +1 -1
- package/dist/underwriter/underwriter.model.d.ts +27 -0
- package/dist/underwriter/underwriter.model.d.ts.map +1 -1
- package/dist/users/auth-log.model.d.ts +27 -0
- package/dist/users/auth-log.model.d.ts.map +1 -1
- package/dist/users/permission.model.d.ts +27 -0
- package/dist/users/permission.model.d.ts.map +1 -1
- package/dist/users/role-group.model.d.ts +27 -0
- package/dist/users/role-group.model.d.ts.map +1 -1
- package/dist/users/role.model.d.ts +27 -0
- package/dist/users/role.model.d.ts.map +1 -1
- package/dist/users/tasks.model.d.ts +27 -0
- package/dist/users/tasks.model.d.ts.map +1 -1
- package/dist/users/user.model.d.ts +27 -0
- package/dist/users/user.model.d.ts.map +1 -1
- package/dist/value-objects/pound.d.ts +26 -0
- package/dist/value-objects/pound.d.ts.map +1 -1
- package/dist/value-objects/sort-code.d.ts +26 -0
- package/dist/value-objects/sort-code.d.ts.map +1 -1
- package/entities/applications/application-direct-debit.entity.ts +1 -1
- package/package.json +1 -1
- package/prisma/applicants/applicant.prisma +123 -124
- package/prisma/applications/application-direct-debit.prisma +3 -3
- package/prisma/applications/application.prisma +2 -0
- package/prisma/migrations/20250508092417_update_application_schema/migration.sql +3 -0
- package/prisma/migrations/20250508094735_update_direct_debit_schema/migration.sql +2 -0
- package/prisma/schema.prisma +126 -125
- package/dist/applicants/applicant-credit-data.model.js +0 -11
- package/dist/applicants/applicant-credit-profile.model.js +0 -20
- package/dist/applicants/applicant-direct-debit.model.js +0 -17
- package/dist/applicants/applicant-employment.model.js +0 -50
- package/dist/applicants/applicant-expenditure.model.js +0 -54
- package/dist/applicants/applicant-income-source.model.js +0 -9
- package/dist/applicants/applicant-income.model.js +0 -81
- package/dist/applicants/applicant-risk-narrative.model.js +0 -13
- package/dist/applicants/applicant.model.js +0 -223
- package/dist/applicants/index.js +0 -13
- package/dist/applications/application-audit.model.js +0 -42
- package/dist/applications/application-checklist-Item.model.js +0 -45
- package/dist/applications/application-company-model.js +0 -120
- package/dist/applications/application-credit-profile.model.js +0 -12
- package/dist/applications/application-direct-debit.model.js +0 -92
- package/dist/applications/application-document.model.js +0 -35
- package/dist/applications/application-fieldconfig.model.js +0 -7
- package/dist/applications/application-illustration-model.js +0 -6
- package/dist/applications/application-legal.model.js +0 -7
- package/dist/applications/application-mortgage.model.js +0 -271
- package/dist/applications/application-note.model.js +0 -78
- package/dist/applications/application-offer.model.js +0 -6
- package/dist/applications/application-onboarding.model.js +0 -9
- package/dist/applications/application-product.model.js +0 -67
- package/dist/applications/application-rationale.model.js +0 -38
- package/dist/applications/application-risk-narrative.model.js +0 -12
- package/dist/applications/application-valuation.model.js +0 -15
- package/dist/applications/application.model.js +0 -153
- package/dist/applications/broker.model.js +0 -21
- package/dist/applications/document.model.js +0 -35
- package/dist/applications/index.js +0 -20
- package/dist/applications/solicitor.model.js +0 -114
- package/dist/index.js +0 -9
- package/dist/product-catalogues/index.js +0 -3
- package/dist/product-catalogues/product-catalogue.model.js +0 -18
- package/dist/product-catalogues/product-definitions.model.js +0 -26
- package/dist/product-catalogues/product-variant.model.js +0 -12
- package/dist/properties/index.js +0 -2
- package/dist/properties/property.model.js +0 -144
- package/dist/shared/alert.model.js +0 -24
- package/dist/shared/apprivo-sync-journey.model.js +0 -17
- package/dist/shared/checklist.model.js +0 -30
- package/dist/shared/document-type-model.js +0 -10
- package/dist/shared/index.js +0 -12
- package/dist/shared/job-run.model.js +0 -14
- package/dist/shared/job-setting.model.js +0 -11
- package/dist/shared/lookup-group.model.js +0 -16
- package/dist/shared/lookup.model.js +0 -20
- package/dist/shared/system-parameter.model.js +0 -32
- package/dist/shared/task-document.model.js +0 -23
- package/dist/shared/task.model.js +0 -15
- package/dist/underwriter/index.js +0 -1
- package/dist/underwriter/underwriter.model.js +0 -17
- package/dist/users/auth-log.model.js +0 -21
- package/dist/users/index.js +0 -6
- package/dist/users/permission.model.js +0 -10
- package/dist/users/role-group.model.js +0 -14
- package/dist/users/role.model.js +0 -13
- package/dist/users/tasks.model.js +0 -15
- package/dist/users/user.model.js +0 -30
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
import mongoose from 'mongoose';
|
|
2
|
-
import { Pound } from '../value-objects/pound';
|
|
3
|
-
const propertySchema = new mongoose.Schema({
|
|
4
|
-
applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application",
|
|
5
|
-
description: "Unique identifier for the application",
|
|
6
|
-
required: true
|
|
7
|
-
},
|
|
8
|
-
pageValidFlag: {
|
|
9
|
-
type: Boolean,
|
|
10
|
-
default: true,
|
|
11
|
-
description: "Flag indicating if the page is valid",
|
|
12
|
-
},
|
|
13
|
-
propertyId: {
|
|
14
|
-
type: String,
|
|
15
|
-
required: true,
|
|
16
|
-
unique: true,
|
|
17
|
-
description: "Unique identifier for the property"
|
|
18
|
-
},
|
|
19
|
-
addressLine1: {
|
|
20
|
-
type: String,
|
|
21
|
-
required: true,
|
|
22
|
-
maxLength: 35,
|
|
23
|
-
description: "First line of the property address"
|
|
24
|
-
},
|
|
25
|
-
addressLine2: {
|
|
26
|
-
type: String,
|
|
27
|
-
required: false,
|
|
28
|
-
maxLength: 35,
|
|
29
|
-
description: "Second line of the property address"
|
|
30
|
-
},
|
|
31
|
-
addressLine3: {
|
|
32
|
-
type: String,
|
|
33
|
-
required: false,
|
|
34
|
-
maxLength: 35,
|
|
35
|
-
description: "Third line of the property address"
|
|
36
|
-
},
|
|
37
|
-
associatedLoanPartiesIds: {
|
|
38
|
-
type: [mongoose.Schema.Types.ObjectId],
|
|
39
|
-
required: false,
|
|
40
|
-
description: "List of associated loan parties (either applicant or company)"
|
|
41
|
-
},
|
|
42
|
-
city: {
|
|
43
|
-
type: String,
|
|
44
|
-
required: false,
|
|
45
|
-
maxLength: 30,
|
|
46
|
-
description: "City where the property is located"
|
|
47
|
-
},
|
|
48
|
-
countryLid: {
|
|
49
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
50
|
-
ref: 'Lookup',
|
|
51
|
-
required: true,
|
|
52
|
-
description: "Country where the property is located",
|
|
53
|
-
},
|
|
54
|
-
lender: {
|
|
55
|
-
type: String,
|
|
56
|
-
required: true,
|
|
57
|
-
maxLength: 35,
|
|
58
|
-
description: "Lender providing the loan for the property"
|
|
59
|
-
},
|
|
60
|
-
marketValue: {
|
|
61
|
-
type: Pound,
|
|
62
|
-
required: true,
|
|
63
|
-
default: 0.00,
|
|
64
|
-
description: "The market value of the property",
|
|
65
|
-
},
|
|
66
|
-
monthlyRent: {
|
|
67
|
-
type: Pound,
|
|
68
|
-
required: true,
|
|
69
|
-
default: 0.00,
|
|
70
|
-
description: "The monthly rent value of the property"
|
|
71
|
-
},
|
|
72
|
-
monthlyRepayment: {
|
|
73
|
-
type: Pound,
|
|
74
|
-
required: true,
|
|
75
|
-
default: 0.00,
|
|
76
|
-
description: "The monthly repayment value for the property"
|
|
77
|
-
},
|
|
78
|
-
originalLoanBalance: {
|
|
79
|
-
type: Pound,
|
|
80
|
-
required: true,
|
|
81
|
-
default: 0.00,
|
|
82
|
-
description: "The original loan balance for the property"
|
|
83
|
-
},
|
|
84
|
-
outstandingBalance: {
|
|
85
|
-
type: Pound,
|
|
86
|
-
required: true,
|
|
87
|
-
default: 0.00,
|
|
88
|
-
description: "The remaining outstanding balance of the property loan"
|
|
89
|
-
},
|
|
90
|
-
otherOwnershipParties: {
|
|
91
|
-
type: String,
|
|
92
|
-
required: false,
|
|
93
|
-
maxLength: 500,
|
|
94
|
-
description: "Other parties that own the property"
|
|
95
|
-
},
|
|
96
|
-
postCode: {
|
|
97
|
-
type: String,
|
|
98
|
-
required: true,
|
|
99
|
-
maxLength: 50,
|
|
100
|
-
description: "The postCode for the property"
|
|
101
|
-
},
|
|
102
|
-
remainingTerm: {
|
|
103
|
-
type: Number,
|
|
104
|
-
required: true,
|
|
105
|
-
max: 4,
|
|
106
|
-
description: "The remaining term of the loan in years"
|
|
107
|
-
},
|
|
108
|
-
portfolioFile: {
|
|
109
|
-
type: String,
|
|
110
|
-
required: false,
|
|
111
|
-
description: "File containing the portfolio details"
|
|
112
|
-
}
|
|
113
|
-
}, {
|
|
114
|
-
timestamps: true,
|
|
115
|
-
toJSON: { virtuals: true },
|
|
116
|
-
toObject: { virtuals: true }
|
|
117
|
-
});
|
|
118
|
-
propertySchema.virtual('country').get(function () {
|
|
119
|
-
return this.countryLid instanceof mongoose.Types.ObjectId ? null : this.countryLid?.name || null;
|
|
120
|
-
});
|
|
121
|
-
propertySchema.virtual('stressedRCR').get(function () {
|
|
122
|
-
const monthlyRentValue = this.monthlyRent ? parseFloat(this.monthlyRent.toString()) : 0.00;
|
|
123
|
-
const monthlyRepaymentValue = this.monthlyRepayment ? parseFloat(this.monthlyRepayment.toString()) : 0.00;
|
|
124
|
-
// Avoid division by zero
|
|
125
|
-
if (monthlyRepaymentValue === 0) {
|
|
126
|
-
return '0.00'; // Return 0.00 if monthlyRepayment is zero
|
|
127
|
-
}
|
|
128
|
-
const stressedRCR = (monthlyRentValue / monthlyRepaymentValue) * 100;
|
|
129
|
-
return stressedRCR.toFixed(2);
|
|
130
|
-
});
|
|
131
|
-
// virtual property 'applicationType'
|
|
132
|
-
propertySchema.virtual('applicationType').get(function () {
|
|
133
|
-
return this.applicationId?.applicationTypeLid instanceof mongoose.Types.ObjectId
|
|
134
|
-
? null
|
|
135
|
-
: this.applicationId?.applicationTypeLid?.name || null;
|
|
136
|
-
});
|
|
137
|
-
// virtual property 'lendingType'
|
|
138
|
-
propertySchema.virtual('lendingType').get(function () {
|
|
139
|
-
return this.applicationId?.lendingTypeLid instanceof mongoose.Types.ObjectId
|
|
140
|
-
? null
|
|
141
|
-
: this.applicationId?.lendingTypeLid?.name || null;
|
|
142
|
-
});
|
|
143
|
-
const PropertyModel = mongoose.model('Property', propertySchema);
|
|
144
|
-
export default PropertyModel;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const alertSchema = new mongoose.Schema({
|
|
3
|
-
alertTypeLid: {
|
|
4
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
5
|
-
ref: "Lookup"
|
|
6
|
-
},
|
|
7
|
-
applicationId: {
|
|
8
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
9
|
-
ref: "Application",
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
alertMessage: { type: String },
|
|
13
|
-
documentId: {
|
|
14
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
15
|
-
ref: "Document",
|
|
16
|
-
},
|
|
17
|
-
statusLid: {
|
|
18
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
19
|
-
ref: "Lookup"
|
|
20
|
-
},
|
|
21
|
-
isActive: { type: String, default: true },
|
|
22
|
-
}, { timestamps: true });
|
|
23
|
-
const AlertModel = mongoose.model("Alert", alertSchema);
|
|
24
|
-
export default AlertModel;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const ApprivoSyncJourneySchema = new mongoose.Schema({
|
|
3
|
-
applicationId: { type: String, required: true },
|
|
4
|
-
milestoneLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
5
|
-
mileStoneStatus: {
|
|
6
|
-
type: String,
|
|
7
|
-
enum: ['Completed', 'Errored', 'Not Applicable'],
|
|
8
|
-
required: true
|
|
9
|
-
},
|
|
10
|
-
error: { type: String, default: null },
|
|
11
|
-
isFirstPull: { type: String, required: true },
|
|
12
|
-
jobRunId: { type: mongoose.Schema.Types.ObjectId, ref: "Job_Run" },
|
|
13
|
-
startTime: { type: Date, default: null },
|
|
14
|
-
endTime: { type: Date, default: null },
|
|
15
|
-
}, { timestamps: true });
|
|
16
|
-
const ApprivoSyncJourneyModel = mongoose.model('ApprivoSyncJourney', ApprivoSyncJourneySchema);
|
|
17
|
-
export default ApprivoSyncJourneyModel;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const checklistSchema = new mongoose.Schema({
|
|
3
|
-
checkTypeLid: {
|
|
4
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
5
|
-
ref: "Lookup",
|
|
6
|
-
required: true
|
|
7
|
-
},
|
|
8
|
-
source: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true
|
|
11
|
-
},
|
|
12
|
-
sourceId: {
|
|
13
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
14
|
-
required: false
|
|
15
|
-
},
|
|
16
|
-
applicationId: {
|
|
17
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
18
|
-
ref: "Application",
|
|
19
|
-
required: true
|
|
20
|
-
},
|
|
21
|
-
checkDescription: { type: String },
|
|
22
|
-
checkStatusLid: {
|
|
23
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
24
|
-
ref: "Lookup",
|
|
25
|
-
required: true
|
|
26
|
-
}
|
|
27
|
-
}, { timestamps: true });
|
|
28
|
-
checklistSchema.index({ checkDescription: 'text', source: 'text' });
|
|
29
|
-
const CheckListModel = mongoose.model("CheckList", checklistSchema);
|
|
30
|
-
export default CheckListModel;
|
|
@@ -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;
|
package/dist/shared/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { default as LookupGroupModel } from './lookup-group.model';
|
|
2
|
-
export { default as LookupModel } from './lookup.model';
|
|
3
|
-
export { default as SystemParameterModel } from './system-parameter.model';
|
|
4
|
-
export { default as AlertModel } from './alert.model';
|
|
5
|
-
export { default as CheckListModel } from './checklist.model';
|
|
6
|
-
export { default as JobSettingModel } from './job-setting.model';
|
|
7
|
-
export { default as TaskModel } from './task.model';
|
|
8
|
-
export { default as ApprivoSyncJourneyModel } from './apprivo-sync-journey.model';
|
|
9
|
-
export { default as JobRunModel } from './job-run.model';
|
|
10
|
-
export { default as TaskDocumentTypeModel } from './task-document.model';
|
|
11
|
-
export { default as DocumentTypeModel } from './document-type-model';
|
|
12
|
-
export { default as SchemaDocModel } from './schema-doc.model';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import mongoose, { Schema } from "mongoose";
|
|
2
|
-
const jobRunSchema = new Schema({
|
|
3
|
-
jobName: { type: String, required: true },
|
|
4
|
-
status: {
|
|
5
|
-
type: String,
|
|
6
|
-
enum: ['Running', 'Completed', 'Errored'],
|
|
7
|
-
required: true
|
|
8
|
-
},
|
|
9
|
-
error: { type: String, default: null },
|
|
10
|
-
startTime: { type: Date, default: null },
|
|
11
|
-
endTime: { type: Date, default: null }
|
|
12
|
-
});
|
|
13
|
-
const JobRunModel = mongoose.model('Job_Run', jobRunSchema);
|
|
14
|
-
export default JobRunModel;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const jobSettingSchema = new mongoose.Schema({
|
|
3
|
-
name: { type: String, required: true },
|
|
4
|
-
isActive: { type: String, default: true },
|
|
5
|
-
frequency: {
|
|
6
|
-
type: String, default: '2 hours'
|
|
7
|
-
},
|
|
8
|
-
jobParams: { type: [mongoose.Schema.Types.Mixed] }
|
|
9
|
-
});
|
|
10
|
-
const JobSettingModel = mongoose.model("Job_Setting", jobSettingSchema);
|
|
11
|
-
export default JobSettingModel;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const lookupGroupSchema = new mongoose.Schema({
|
|
3
|
-
name: {
|
|
4
|
-
type: String,
|
|
5
|
-
required: true,
|
|
6
|
-
unique: true,
|
|
7
|
-
},
|
|
8
|
-
lookups: [
|
|
9
|
-
{
|
|
10
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
11
|
-
ref: "Lookup", // References the Lookup collection
|
|
12
|
-
},
|
|
13
|
-
],
|
|
14
|
-
});
|
|
15
|
-
const LookupGroupModel = mongoose.model('LookupGroup', lookupGroupSchema);
|
|
16
|
-
export default LookupGroupModel;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const lookupSchema = new mongoose.Schema({
|
|
3
|
-
name: {
|
|
4
|
-
type: String,
|
|
5
|
-
required: true
|
|
6
|
-
},
|
|
7
|
-
text: {
|
|
8
|
-
type: String,
|
|
9
|
-
required: true
|
|
10
|
-
},
|
|
11
|
-
lookupGroupId: {
|
|
12
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
13
|
-
ref: "LookupGroup", // References the LookupGroup collection
|
|
14
|
-
},
|
|
15
|
-
value: {
|
|
16
|
-
type: String
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const LookupModel = mongoose.model('Lookup', lookupSchema);
|
|
20
|
-
export default LookupModel;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const systemParameterSchema = new mongoose.Schema({
|
|
3
|
-
parameterName: {
|
|
4
|
-
type: String,
|
|
5
|
-
required: true,
|
|
6
|
-
},
|
|
7
|
-
parameterValue: {
|
|
8
|
-
type: mongoose.Schema.Types.Mixed,
|
|
9
|
-
required: true,
|
|
10
|
-
},
|
|
11
|
-
notes: {
|
|
12
|
-
type: String,
|
|
13
|
-
},
|
|
14
|
-
createdByUserId: {
|
|
15
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
16
|
-
ref: 'User',
|
|
17
|
-
required: true,
|
|
18
|
-
},
|
|
19
|
-
createdOn: {
|
|
20
|
-
type: Date,
|
|
21
|
-
default: Date.now,
|
|
22
|
-
},
|
|
23
|
-
updatedByUserId: {
|
|
24
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
25
|
-
ref: 'User',
|
|
26
|
-
},
|
|
27
|
-
updatedOn: {
|
|
28
|
-
type: Date,
|
|
29
|
-
},
|
|
30
|
-
});
|
|
31
|
-
const SystemParameterModel = mongoose.model('SystemParameter', systemParameterSchema);
|
|
32
|
-
export default SystemParameterModel;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import mongoose from 'mongoose';
|
|
2
|
-
// Define the schema for TaskDocumentType
|
|
3
|
-
const taskDocumentTypeSchema = new mongoose.Schema({
|
|
4
|
-
name: {
|
|
5
|
-
type: String,
|
|
6
|
-
required: true,
|
|
7
|
-
},
|
|
8
|
-
value: {
|
|
9
|
-
type: String,
|
|
10
|
-
required: true,
|
|
11
|
-
},
|
|
12
|
-
parentDocumentTypeId: {
|
|
13
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
14
|
-
default: null, // Null for parent categories
|
|
15
|
-
},
|
|
16
|
-
source: {
|
|
17
|
-
type: String,
|
|
18
|
-
required: true,
|
|
19
|
-
enum: ['applicant', 'application'], // Only allow these two values
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
const TaskDocumentTypeModel = mongoose.model('TaskDocumentType', taskDocumentTypeSchema);
|
|
23
|
-
export default TaskDocumentTypeModel;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const { Schema } = mongoose;
|
|
3
|
-
const actionSchema = new Schema({
|
|
4
|
-
type: { type: String, required: true }, // Type of the action
|
|
5
|
-
message: { type: String, required: false },
|
|
6
|
-
target: { type: String, required: false },
|
|
7
|
-
});
|
|
8
|
-
const taskSchema = new Schema({
|
|
9
|
-
name: { type: String, required: true },
|
|
10
|
-
description: { type: String, required: true },
|
|
11
|
-
actionsOnFailure: { type: [actionSchema], default: [] },
|
|
12
|
-
actionsOnSuccess: { type: [actionSchema], default: [] },
|
|
13
|
-
}, { timestamps: true });
|
|
14
|
-
const TaskModel = mongoose.model("Task", taskSchema);
|
|
15
|
-
export default TaskModel;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as UnderwriterModel } from './underwriter.model';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const underwriterSchema = new mongoose.Schema({
|
|
3
|
-
fullName: { type: String, required: true },
|
|
4
|
-
mandateLevel: { type: Number, required: true },
|
|
5
|
-
underwriterId: { type: Number, required: true },
|
|
6
|
-
totalBTLCaseCount: { type: Number, required: true },
|
|
7
|
-
btlPreOfferCaseCount: { type: Number, required: true },
|
|
8
|
-
btlPostOfferCaseCount: { type: Number, required: true },
|
|
9
|
-
totalBridgingCaseCount: { type: Number, required: true },
|
|
10
|
-
bridgingPreOfferCaseCount: { type: Number, required: true },
|
|
11
|
-
bridgingPostOfferCaseCount: { type: Number, required: true },
|
|
12
|
-
bridgingMandateLevel: { type: Number, required: true }
|
|
13
|
-
}, {
|
|
14
|
-
timestamps: true
|
|
15
|
-
});
|
|
16
|
-
const UnderwriterModel = mongoose.model('Underwriter', underwriterSchema);
|
|
17
|
-
export default UnderwriterModel;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const AuthLogSchema = new mongoose.Schema({
|
|
3
|
-
userEmail: {
|
|
4
|
-
type: String,
|
|
5
|
-
required: true
|
|
6
|
-
},
|
|
7
|
-
loggedInTimestamp: {
|
|
8
|
-
type: Date,
|
|
9
|
-
default: Date.now
|
|
10
|
-
},
|
|
11
|
-
isSuccess: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
15
|
-
activity: {
|
|
16
|
-
type: String,
|
|
17
|
-
enum: ["LOGIN", "LOGOUT", "PASSWORD_RESET"]
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
const AuthLogModel = mongoose.model("AuthLog", AuthLogSchema);
|
|
21
|
-
export default AuthLogModel;
|
package/dist/users/index.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { default as UserModel } from './user.model';
|
|
2
|
-
export { default as RoleModel } from './role.model';
|
|
3
|
-
export { default as RoleGroupModel } from './role-group.model';
|
|
4
|
-
export { default as PermissionModel } from './permission.model';
|
|
5
|
-
export { default as TasksModel } from './tasks.model';
|
|
6
|
-
export { default as AuthLogModel } from './auth-log.model';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const permissionSchema = new mongoose.Schema({
|
|
3
|
-
name: { type: String, required: true },
|
|
4
|
-
controllerName: { type: String, required: true },
|
|
5
|
-
methodName: { type: String, required: true }
|
|
6
|
-
}, {
|
|
7
|
-
timestamps: true
|
|
8
|
-
});
|
|
9
|
-
const PermissionModel = mongoose.model('Permission', permissionSchema);
|
|
10
|
-
export default PermissionModel;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const RoleGroupSchema = new mongoose.Schema({
|
|
3
|
-
groupId: { type: String, required: true },
|
|
4
|
-
name: { type: String, required: true },
|
|
5
|
-
description: { type: String },
|
|
6
|
-
roles: [{
|
|
7
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
8
|
-
ref: 'Role'
|
|
9
|
-
}]
|
|
10
|
-
}, {
|
|
11
|
-
timestamps: true
|
|
12
|
-
});
|
|
13
|
-
const RoleGroupModel = mongoose.model('RoleGroup', RoleGroupSchema);
|
|
14
|
-
export default RoleGroupModel;
|
package/dist/users/role.model.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const RoleSchema = new mongoose.Schema({
|
|
3
|
-
roleId: { type: String, required: true },
|
|
4
|
-
name: { type: String, required: true },
|
|
5
|
-
description: { type: String },
|
|
6
|
-
permissions: [{
|
|
7
|
-
type: mongoose.Schema.Types.ObjectId, ref: 'Permission'
|
|
8
|
-
}]
|
|
9
|
-
}, {
|
|
10
|
-
timestamps: true
|
|
11
|
-
});
|
|
12
|
-
const RoleModel = mongoose.model('Role', RoleSchema);
|
|
13
|
-
export default RoleModel;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const TasksSchema = new mongoose.Schema({
|
|
3
|
-
taskTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null }, // LookupGroup: TaskType ["Document", "Information"]
|
|
4
|
-
actionTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null }, // Example: "Request Document Delete"
|
|
5
|
-
entityId: { type: mongoose.Schema.Types.ObjectId, required: true }, // Could be documentId, applicationId, applicantId
|
|
6
|
-
createdByUserId: { ref: "User", type: mongoose.Schema.Types.ObjectId, required: true },
|
|
7
|
-
assignedToUserId: { ref: "User", type: mongoose.Schema.Types.ObjectId, required: true },
|
|
8
|
-
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null }, // LookupGroup: TaskStatus ["Requested", "Completed", "Cancelled"]
|
|
9
|
-
priorityLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null }, // LookupGroup: TaskPriority ["High", "Medium", "Low"]
|
|
10
|
-
expiryDate: { type: Date, required: true },
|
|
11
|
-
}, {
|
|
12
|
-
timestamps: true
|
|
13
|
-
});
|
|
14
|
-
const TasksModel = mongoose.model("Tasks", TasksSchema);
|
|
15
|
-
export default TasksModel;
|
package/dist/users/user.model.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const ClaimSchema = new mongoose.Schema({
|
|
3
|
-
key: { type: String, required: true },
|
|
4
|
-
value: { type: String, required: true }
|
|
5
|
-
});
|
|
6
|
-
const userSchema = new mongoose.Schema({
|
|
7
|
-
accountId: { type: String, required: true },
|
|
8
|
-
email: { type: String, required: true },
|
|
9
|
-
fullName: { type: String, required: true },
|
|
10
|
-
password: { type: String, required: true },
|
|
11
|
-
organisationId: { type: mongoose.Schema.Types.Mixed },
|
|
12
|
-
status: { type: String, required: true },
|
|
13
|
-
groups: [{
|
|
14
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
15
|
-
ref: 'RoleGroup'
|
|
16
|
-
}],
|
|
17
|
-
claims: [ClaimSchema],
|
|
18
|
-
externalData: { type: mongoose.Schema.Types.Mixed },
|
|
19
|
-
modifiedOn: { type: String },
|
|
20
|
-
modifiedById: { type: String },
|
|
21
|
-
createdOnInApprivo: { type: String },
|
|
22
|
-
createdById: { type: String },
|
|
23
|
-
deletedOn: { type: String },
|
|
24
|
-
deletedById: { type: String },
|
|
25
|
-
token: { type: String }
|
|
26
|
-
}, {
|
|
27
|
-
timestamps: true
|
|
28
|
-
});
|
|
29
|
-
const UserModel = mongoose.model('User', userSchema);
|
|
30
|
-
export default UserModel;
|