@dynamatix/gb-schemas 2.0.27 → 2.0.28
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 +21 -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 +6 -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 +6 -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 +6 -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-employment.model.d.ts +1234 -6
- package/dist/applicants/applicant-employment.model.d.ts.map +1 -1
- package/dist/applicants/applicant-income-settings.model.d.ts +81 -0
- package/dist/applicants/applicant-income-settings.model.d.ts.map +1 -0
- package/dist/applicants/applicant-income-settings.model.js +11 -0
- package/dist/applicants/applicant-income.model.d.ts +0 -12
- package/dist/applicants/applicant-income.model.d.ts.map +1 -1
- package/dist/applicants/applicant-pension-income.model.d.ts +288 -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-uk-tax-credits.model.d.ts +288 -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 +0 -1
- package/dist/applicants/applicant.model.d.ts.map +1 -1
- package/dist/applicants/index.d.ts +2 -0
- package/dist/applicants/index.d.ts.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/entities/applicants/applicant.entity.ts +3 -3
- package/package.json +1 -1
- package/prisma/applicants/applicant.prisma +3 -3
- package/prisma/migrations/20250509073536_update_applicant_schema/migration.sql +4 -0
- package/prisma/schema.prisma +3 -3
- 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,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,7 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const fieldConfigSchema = new mongoose.Schema({
|
|
3
|
-
fieldName: { type: String, required: true, unique: true },
|
|
4
|
-
validateProductOnChange: { type: String, default: true }
|
|
5
|
-
});
|
|
6
|
-
const ApplicationFieldConfigModel = mongoose.model('FieldConfig', fieldConfigSchema);
|
|
7
|
-
export default ApplicationFieldConfigModel;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const legalSchema = new mongoose.Schema({
|
|
3
|
-
assignedSolicitor: { type: String, default: "" },
|
|
4
|
-
solicitorsReference: { type: String, default: "" }
|
|
5
|
-
});
|
|
6
|
-
const LegalModel = mongoose.model("Legal", legalSchema);
|
|
7
|
-
export default LegalModel;
|
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
import { Pound } from "../value-objects/pound";
|
|
3
|
-
const mortgageSchema = new mongoose.Schema({
|
|
4
|
-
applicationId: {
|
|
5
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
6
|
-
ref: "Application",
|
|
7
|
-
required: true,
|
|
8
|
-
description: "Unique identifier for the application",
|
|
9
|
-
},
|
|
10
|
-
pageValidFlag: {
|
|
11
|
-
type: Boolean,
|
|
12
|
-
default: false,
|
|
13
|
-
description: "True if all mandatory fields have been completed, otherwise false",
|
|
14
|
-
},
|
|
15
|
-
existingMortgageLender: {
|
|
16
|
-
type: String,
|
|
17
|
-
maxlength: 35,
|
|
18
|
-
description: "Name of the existing mortgage lender",
|
|
19
|
-
},
|
|
20
|
-
topSlicing: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false,
|
|
23
|
-
description: "Indicates if the mortgage is being paid off using top slicing",
|
|
24
|
-
},
|
|
25
|
-
purposeOfMortgage: {
|
|
26
|
-
type: String,
|
|
27
|
-
required: true,
|
|
28
|
-
maxlength: 50,
|
|
29
|
-
description: "Purpose of the mortgage (e.g., purchase, refinance)",
|
|
30
|
-
},
|
|
31
|
-
depositComeFromLids: {
|
|
32
|
-
type: [mongoose.Schema.Types.ObjectId],
|
|
33
|
-
ref: "Lookup",
|
|
34
|
-
required: true,
|
|
35
|
-
default: null,
|
|
36
|
-
description: "Where the deposit for the mortgage will come from",
|
|
37
|
-
},
|
|
38
|
-
ifOtherDetails: {
|
|
39
|
-
type: String,
|
|
40
|
-
maxlength: 50,
|
|
41
|
-
required: true,
|
|
42
|
-
description: "Details if the deposit comes from 'Other'",
|
|
43
|
-
},
|
|
44
|
-
purchasePrice: {
|
|
45
|
-
type: Pound,
|
|
46
|
-
required: true,
|
|
47
|
-
description: "Purchase price of the property",
|
|
48
|
-
},
|
|
49
|
-
repaymentTypeLid: {
|
|
50
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
51
|
-
ref: "Lookup",
|
|
52
|
-
required: true,
|
|
53
|
-
default: null,
|
|
54
|
-
description: "Lookup ID representing the type of repayment (e.g., interest-only, repayment)",
|
|
55
|
-
},
|
|
56
|
-
exitStrategyLid: {
|
|
57
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
58
|
-
ref: "Lookup",
|
|
59
|
-
required: true,
|
|
60
|
-
default: null,
|
|
61
|
-
description: "Lookup ID representing the Exit strategy for the mortgage)",
|
|
62
|
-
},
|
|
63
|
-
isCapitalRaise: {
|
|
64
|
-
type: Boolean,
|
|
65
|
-
default: false,
|
|
66
|
-
description: "Indicates if capital raising is part of this finance",
|
|
67
|
-
},
|
|
68
|
-
purchaseDate: {
|
|
69
|
-
type: String,
|
|
70
|
-
required: true,
|
|
71
|
-
default: null,
|
|
72
|
-
description: "Purchase date of the property",
|
|
73
|
-
},
|
|
74
|
-
estimatedValue: {
|
|
75
|
-
type: Pound,
|
|
76
|
-
required: true,
|
|
77
|
-
description: "Estimated value of the property",
|
|
78
|
-
},
|
|
79
|
-
loanRequired: {
|
|
80
|
-
type: Pound,
|
|
81
|
-
required: true,
|
|
82
|
-
description: "Amount of finance required",
|
|
83
|
-
},
|
|
84
|
-
monthlyRentalIncome: {
|
|
85
|
-
type: Pound,
|
|
86
|
-
required: true,
|
|
87
|
-
description: "Monthly rental income from the property",
|
|
88
|
-
},
|
|
89
|
-
outstandingBalance: {
|
|
90
|
-
type: Pound,
|
|
91
|
-
required: true,
|
|
92
|
-
description: "Outstanding balance on the existing mortgage",
|
|
93
|
-
},
|
|
94
|
-
fundRaisedFor: {
|
|
95
|
-
type: String,
|
|
96
|
-
maxlength: 250,
|
|
97
|
-
required: true,
|
|
98
|
-
description: "What the funds raised will be used for",
|
|
99
|
-
},
|
|
100
|
-
sourceOfFundsLid: {
|
|
101
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
102
|
-
ref: "Lookup",
|
|
103
|
-
required: true,
|
|
104
|
-
default: null,
|
|
105
|
-
description: "Lookup ID representing the Main source of income for monthly finance payments",
|
|
106
|
-
},
|
|
107
|
-
sourceOfFundDetails: {
|
|
108
|
-
type: String,
|
|
109
|
-
maxlength: 50,
|
|
110
|
-
required: true,
|
|
111
|
-
description: "Additional details if the source of funds is 'Other'",
|
|
112
|
-
},
|
|
113
|
-
propertyValuationDetails: {
|
|
114
|
-
type: String,
|
|
115
|
-
maxlength: 35,
|
|
116
|
-
required: true,
|
|
117
|
-
description: "Details on who to contact for property valuation",
|
|
118
|
-
},
|
|
119
|
-
telephoneNumber: {
|
|
120
|
-
type: String,
|
|
121
|
-
maxlength: 15,
|
|
122
|
-
required: true,
|
|
123
|
-
description: "Contact number for property valuation",
|
|
124
|
-
},
|
|
125
|
-
isDistressedSale: {
|
|
126
|
-
type: Boolean,
|
|
127
|
-
default: false,
|
|
128
|
-
required: true,
|
|
129
|
-
description: "Indicates if this is a distressed sale",
|
|
130
|
-
},
|
|
131
|
-
isPurchasedBelowMarketValue: {
|
|
132
|
-
type: Boolean,
|
|
133
|
-
default: false,
|
|
134
|
-
required: true,
|
|
135
|
-
description: "Indicates if the property is purchased below market value",
|
|
136
|
-
},
|
|
137
|
-
isPurchasedAsSale: {
|
|
138
|
-
type: Boolean,
|
|
139
|
-
default: false,
|
|
140
|
-
required: true,
|
|
141
|
-
description: "Indicates if the property is purchased as a sale and rent back",
|
|
142
|
-
},
|
|
143
|
-
isReadyToSell: {
|
|
144
|
-
type: Boolean,
|
|
145
|
-
default: false,
|
|
146
|
-
description: "Indicates if the property is ready to sell or let out",
|
|
147
|
-
},
|
|
148
|
-
isGovernmentInitiative: {
|
|
149
|
-
type: Boolean,
|
|
150
|
-
default: false,
|
|
151
|
-
description: "Indicates if this purchase is part of a government initiative",
|
|
152
|
-
},
|
|
153
|
-
vendorsName: {
|
|
154
|
-
type: String,
|
|
155
|
-
maxlength: 35,
|
|
156
|
-
description: "Vendor's name in case of property sale",
|
|
157
|
-
},
|
|
158
|
-
saleMadeLid: {
|
|
159
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
160
|
-
ref: "Lookup",
|
|
161
|
-
description: "Method of sale made",
|
|
162
|
-
},
|
|
163
|
-
isTheIntentionToLet: {
|
|
164
|
-
type: Boolean,
|
|
165
|
-
default: false,
|
|
166
|
-
description: "Indicates if the intention is to let out the property",
|
|
167
|
-
},
|
|
168
|
-
proposedTenantsLids: {
|
|
169
|
-
type: [mongoose.Schema.Types.ObjectId],
|
|
170
|
-
ref: "Lookup",
|
|
171
|
-
description: "Proposed tenants for the property",
|
|
172
|
-
},
|
|
173
|
-
leaseTypeLid: {
|
|
174
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
175
|
-
ref: "Lookup",
|
|
176
|
-
required: true,
|
|
177
|
-
default: null,
|
|
178
|
-
description: "Lease type for the property",
|
|
179
|
-
},
|
|
180
|
-
}, {
|
|
181
|
-
timestamps: true,
|
|
182
|
-
toJSON: { virtuals: true },
|
|
183
|
-
toObject: { virtuals: true },
|
|
184
|
-
});
|
|
185
|
-
// const virtualDepositComeFrom = mortgageSchema.virtual("depositComeFrom", {
|
|
186
|
-
// ref: "Lookup",
|
|
187
|
-
// localField: "depositComeFromLid",
|
|
188
|
-
// foreignField: "_id",
|
|
189
|
-
// justOne: false,
|
|
190
|
-
// }) as VirtualWithDescription;
|
|
191
|
-
// virtualDepositComeFrom.description =
|
|
192
|
-
// "Populated lookup values for where the deposit for the mortgage will come from";
|
|
193
|
-
// const virtualRepaymentType = mortgageSchema.virtual("repaymentType", {
|
|
194
|
-
// ref: "Lookup",
|
|
195
|
-
// localField: "repaymentTypeLid",
|
|
196
|
-
// foreignField: "_id",
|
|
197
|
-
// justOne: true,
|
|
198
|
-
// }) as VirtualWithDescription;
|
|
199
|
-
// virtualRepaymentType.description =
|
|
200
|
-
// "Populated lookup value representing the type of repayment";
|
|
201
|
-
// const virtualExitStrategy = mortgageSchema.virtual("exitStrategy", {
|
|
202
|
-
// ref: "Lookup",
|
|
203
|
-
// localField: "exitStrategyLid",
|
|
204
|
-
// foreignField: "_id",
|
|
205
|
-
// justOne: true,
|
|
206
|
-
// }) as VirtualWithDescription;
|
|
207
|
-
// virtualExitStrategy.description = "Populated lookup value for exit strategy";
|
|
208
|
-
// const virtualSourceOfFunds = mortgageSchema.virtual("sourceOfFunds", {
|
|
209
|
-
// ref: "Lookup",
|
|
210
|
-
// localField: "sourceOfFundsLid",
|
|
211
|
-
// foreignField: "_id",
|
|
212
|
-
// justOne: true,
|
|
213
|
-
// }) as VirtualWithDescription;
|
|
214
|
-
// virtualSourceOfFunds.description =
|
|
215
|
-
// "Populated lookup value for the main source of income for monthly finance payments";
|
|
216
|
-
// const virtualSaleMade = mortgageSchema.virtual("saleMade", {
|
|
217
|
-
// ref: "Lookup",
|
|
218
|
-
// localField: "saleMadeLid",
|
|
219
|
-
// foreignField: "_id",
|
|
220
|
-
// justOne: true,
|
|
221
|
-
// }) as VirtualWithDescription;
|
|
222
|
-
// virtualSaleMade.description = "Populated lookup value for method of sale made";
|
|
223
|
-
// const virtualProposedTenants = mortgageSchema.virtual("proposedTenants", {
|
|
224
|
-
// ref: "Lookup",
|
|
225
|
-
// localField: "proposedTenantsLid",
|
|
226
|
-
// foreignField: "_id",
|
|
227
|
-
// justOne: false,
|
|
228
|
-
// }) as VirtualWithDescription;
|
|
229
|
-
// virtualProposedTenants.description =
|
|
230
|
-
// "Populated lookup values for proposed tenants of the property";
|
|
231
|
-
// const virtualLeaseType = mortgageSchema.virtual("leaseType", {
|
|
232
|
-
// ref: "Lookup",
|
|
233
|
-
// localField: "leaseTypeLid",
|
|
234
|
-
// foreignField: "_id",
|
|
235
|
-
// justOne: true,
|
|
236
|
-
// }) as VirtualWithDescription;
|
|
237
|
-
// virtualLeaseType.description = "Populated lookup value for lease type";
|
|
238
|
-
// virtual property 'applicationType'
|
|
239
|
-
mortgageSchema.virtual("applicationType").get(function () {
|
|
240
|
-
return this.applicationId?.applicationTypeLid instanceof
|
|
241
|
-
mongoose.Types.ObjectId
|
|
242
|
-
? null
|
|
243
|
-
: this.applicationId?.applicationTypeLid?.text || null;
|
|
244
|
-
});
|
|
245
|
-
// virtual property 'lendingType'
|
|
246
|
-
mortgageSchema.virtual("lendingType").get(function () {
|
|
247
|
-
return this.applicationId?.lendingTypeLid instanceof
|
|
248
|
-
mongoose.Types.ObjectId
|
|
249
|
-
? null
|
|
250
|
-
: this.applicationId?.lendingTypeLid?.text || null;
|
|
251
|
-
});
|
|
252
|
-
// virtual property 'purchaseType'
|
|
253
|
-
mortgageSchema.virtual("purchaseType").get(function () {
|
|
254
|
-
return this.applicationId?.purchaseTypeLid instanceof
|
|
255
|
-
mongoose.Types.ObjectId
|
|
256
|
-
? null
|
|
257
|
-
: this.applicationId?.purchaseTypeLid?.text || null;
|
|
258
|
-
});
|
|
259
|
-
// virtual property 'lendingType'
|
|
260
|
-
mortgageSchema.virtual("sourceOfWealth").get(function () {
|
|
261
|
-
const sourceOfWealthLids = this.applicationId?.sourceOfWealthLids;
|
|
262
|
-
if (!Array.isArray(sourceOfWealthLids)) {
|
|
263
|
-
return null;
|
|
264
|
-
}
|
|
265
|
-
return sourceOfWealthLids
|
|
266
|
-
.filter((lid) => !(lid instanceof mongoose.Types.ObjectId))
|
|
267
|
-
.map((lid) => lid?.text || null)
|
|
268
|
-
.filter((text) => text !== null);
|
|
269
|
-
});
|
|
270
|
-
const MortgageModel = mongoose.model("Mortgage", mortgageSchema);
|
|
271
|
-
export default MortgageModel;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const noteSchema = new mongoose.Schema({
|
|
3
|
-
applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true },
|
|
4
|
-
noteId: {
|
|
5
|
-
type: String,
|
|
6
|
-
default: null
|
|
7
|
-
},
|
|
8
|
-
createdOn: {
|
|
9
|
-
type: String,
|
|
10
|
-
default: null
|
|
11
|
-
},
|
|
12
|
-
createdBy: {
|
|
13
|
-
type: String,
|
|
14
|
-
default: null
|
|
15
|
-
},
|
|
16
|
-
username: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: null
|
|
19
|
-
},
|
|
20
|
-
createdByUserId: {
|
|
21
|
-
type: mongoose.Schema.Types.ObjectId, ref: "User",
|
|
22
|
-
},
|
|
23
|
-
typeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
24
|
-
subTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
25
|
-
subject: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: null
|
|
28
|
-
},
|
|
29
|
-
note: {
|
|
30
|
-
type: String,
|
|
31
|
-
required: true
|
|
32
|
-
},
|
|
33
|
-
reminderDate: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: null
|
|
36
|
-
},
|
|
37
|
-
attachmentDocumentId: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: null
|
|
40
|
-
},
|
|
41
|
-
assignedOperation: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: ''
|
|
44
|
-
},
|
|
45
|
-
autoCreated: {
|
|
46
|
-
type: String,
|
|
47
|
-
default: false
|
|
48
|
-
},
|
|
49
|
-
additionalData: {
|
|
50
|
-
type: mongoose.Schema.Types.Mixed,
|
|
51
|
-
default: null
|
|
52
|
-
},
|
|
53
|
-
autoCreatedId: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: null
|
|
56
|
-
},
|
|
57
|
-
assignedTo: {
|
|
58
|
-
type: String,
|
|
59
|
-
default: ''
|
|
60
|
-
},
|
|
61
|
-
assignedBy: {
|
|
62
|
-
type: String,
|
|
63
|
-
default: null
|
|
64
|
-
},
|
|
65
|
-
assignedByUserId: {
|
|
66
|
-
type: mongoose.Schema.Types.ObjectId, ref: "User",
|
|
67
|
-
},
|
|
68
|
-
comment: {
|
|
69
|
-
type: String,
|
|
70
|
-
default: null
|
|
71
|
-
},
|
|
72
|
-
reminderStatus: {
|
|
73
|
-
type: String,
|
|
74
|
-
default: 'None'
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
const ApplictionNoteModel = mongoose.model("ApplictionNote", noteSchema);
|
|
78
|
-
export default ApplictionNoteModel;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const onboardingSchema = new mongoose.Schema({
|
|
3
|
-
errors: { type: String, default: "" },
|
|
4
|
-
status: { type: String, default: "" },
|
|
5
|
-
statusDate: { type: String },
|
|
6
|
-
warnings: { type: String, default: "" }
|
|
7
|
-
});
|
|
8
|
-
const ApplicationOnboardingModel = mongoose.model("ApplicationOnboarding", onboardingSchema);
|
|
9
|
-
export default ApplicationOnboardingModel;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
import { Pound } from "../value-objects/pound";
|
|
3
|
-
const productSchema = new mongoose.Schema({
|
|
4
|
-
applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true,
|
|
5
|
-
description: "Unique identifier for the application"
|
|
6
|
-
},
|
|
7
|
-
selectedProduct: { type: String, default: "" },
|
|
8
|
-
lendingTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
9
|
-
pageValidFlag: { type: Boolean, get: (value) => (value ? "Yes" : "No") },
|
|
10
|
-
repaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
11
|
-
numberOfYearsToRepay: { type: Number, default: 0 },
|
|
12
|
-
repaymentVehicle: { type: String, required: true, default: '', maxLength: 100 },
|
|
13
|
-
fixedAmount: { type: Pound, default: 0.00, required: false },
|
|
14
|
-
isFinanceRecommendedToApplicantLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
15
|
-
procFeeRateLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
16
|
-
networkClubSubmission: { type: Boolean, required: true, get: (value) => (value ? "Yes" : "No") },
|
|
17
|
-
clubNetworkNameLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
18
|
-
introducerSubmission: { type: Boolean, required: true, get: (value) => (value ? "Yes" : "No") },
|
|
19
|
-
introducer: { type: String, default: '' },
|
|
20
|
-
bdm: { type: String, required: true, default: '' },
|
|
21
|
-
tempAppFee: { type: Pound, default: 0.00, required: true },
|
|
22
|
-
productFeePaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" }
|
|
23
|
-
});
|
|
24
|
-
// virtual property 'lendingType'
|
|
25
|
-
productSchema.virtual('lendingType').get(function () {
|
|
26
|
-
const lendingType = this.lendingTypeLid;
|
|
27
|
-
return lendingType && lendingType instanceof mongoose.Types.ObjectId
|
|
28
|
-
? null
|
|
29
|
-
: lendingType?.name || null;
|
|
30
|
-
});
|
|
31
|
-
// virtual property 'repaymentType'
|
|
32
|
-
productSchema.virtual('repaymentType').get(function () {
|
|
33
|
-
const repaymentType = this.repaymentTypeLid;
|
|
34
|
-
return repaymentType && repaymentType instanceof mongoose.Types.ObjectId
|
|
35
|
-
? null
|
|
36
|
-
: repaymentType?.name || null;
|
|
37
|
-
});
|
|
38
|
-
// virtual property 'isFinanceRecommendedToApplicant'
|
|
39
|
-
productSchema.virtual('isFinanceRecommendedToApplicant').get(function () {
|
|
40
|
-
const isFinanceRecommendedToApplicant = this.isFinanceRecommendedToApplicantLid;
|
|
41
|
-
return isFinanceRecommendedToApplicant && isFinanceRecommendedToApplicant instanceof mongoose.Types.ObjectId
|
|
42
|
-
? null
|
|
43
|
-
: isFinanceRecommendedToApplicant?.name || null;
|
|
44
|
-
});
|
|
45
|
-
// virtual property 'procFeeRate'
|
|
46
|
-
productSchema.virtual('procFeeRate').get(function () {
|
|
47
|
-
const procFeeRate = this.procFeeRateLid;
|
|
48
|
-
return procFeeRate && procFeeRate instanceof mongoose.Types.ObjectId
|
|
49
|
-
? null
|
|
50
|
-
: procFeeRate?.name || null;
|
|
51
|
-
});
|
|
52
|
-
// virtual property 'clubNetworkName'
|
|
53
|
-
productSchema.virtual('clubNetworkName').get(function () {
|
|
54
|
-
const clubNetworkName = this.clubNetworkNameLid;
|
|
55
|
-
return clubNetworkName && clubNetworkName instanceof mongoose.Types.ObjectId
|
|
56
|
-
? null
|
|
57
|
-
: clubNetworkName?.name || null;
|
|
58
|
-
});
|
|
59
|
-
// virtual property 'productFeePaymentType'
|
|
60
|
-
productSchema.virtual('productFeePaymentType').get(function () {
|
|
61
|
-
const productFeePaymentType = this.productFeePaymentTypeLid;
|
|
62
|
-
return productFeePaymentType && productFeePaymentType instanceof mongoose.Types.ObjectId
|
|
63
|
-
? null
|
|
64
|
-
: productFeePaymentType?.name || null;
|
|
65
|
-
});
|
|
66
|
-
const ProductModel = mongoose.model("Product", productSchema);
|
|
67
|
-
export default ProductModel;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const rationaleSchema = new mongoose.Schema({
|
|
3
|
-
applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true },
|
|
4
|
-
affordabilityDescription: { type: String, default: "" },
|
|
5
|
-
affordabilityAreaOfOfferCondition: { type: String, default: "" },
|
|
6
|
-
affordabilityAreaOfConcern: { type: String, default: "" },
|
|
7
|
-
affordabilityStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
8
|
-
applicantsDescription: { type: String, default: "" },
|
|
9
|
-
applicantsAreaOfOfferCondition: { type: String, default: "" },
|
|
10
|
-
applicantsAreaOfConcern: { type: String, default: "" },
|
|
11
|
-
applicantsStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
12
|
-
creditConductDescription: { type: String, default: "" },
|
|
13
|
-
creditConductAreaOfOfferCondition: { type: String, default: "" },
|
|
14
|
-
creditConductAreaOfConcern: { type: String, default: "" },
|
|
15
|
-
creditConductStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
16
|
-
fraudCheckDescription: { type: String, default: "" },
|
|
17
|
-
fraudCheckAreaOfOfferCondition: { type: String, default: "" },
|
|
18
|
-
fraudCheckAreaOfConcern: { type: String, default: "" },
|
|
19
|
-
fraudCheckStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
20
|
-
incomeSourceDescription: { type: String, default: "" },
|
|
21
|
-
incomeSourceAreaOfOfferCondition: { type: String, default: "" },
|
|
22
|
-
incomeSourceAreaOfConcern: { type: String, default: "" },
|
|
23
|
-
incomeSourceStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
24
|
-
loanDescription: { type: String, default: "" },
|
|
25
|
-
loanAreaOfOfferCondition: { type: String, default: "" },
|
|
26
|
-
loanAreaOfConcern: { type: String, default: "" },
|
|
27
|
-
loanStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
28
|
-
securityDescription: { type: String, default: "" },
|
|
29
|
-
securityAreaOfOfferCondition: { type: String, default: "" },
|
|
30
|
-
securityAreaOfConcern: { type: String, default: "" },
|
|
31
|
-
securityStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
32
|
-
propertyDescription: { type: String, default: "" },
|
|
33
|
-
propertyAreaOfOfferCondition: { type: String, default: "" },
|
|
34
|
-
propertyAreaOfConcern: { type: String, default: "" },
|
|
35
|
-
propertyStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
|
|
36
|
-
});
|
|
37
|
-
const ApplicationRationaleModel = mongoose.model("ApplicationRationale", rationaleSchema);
|
|
38
|
-
export default ApplicationRationaleModel;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import mongoose from 'mongoose';
|
|
2
|
-
const applicantionRiskNarrativeSchema = new mongoose.Schema({
|
|
3
|
-
call1RequestedOn: { type: String },
|
|
4
|
-
call2RequestedOn: { type: String },
|
|
5
|
-
call2StatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
6
|
-
rationaleForRiskRating: { type: String },
|
|
7
|
-
retryCount: { type: String },
|
|
8
|
-
riskRating: { type: String },
|
|
9
|
-
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
10
|
-
});
|
|
11
|
-
const ApplicationRiskNarrativeModel = mongoose.model('ApplicationRiskNarrative', applicantionRiskNarrativeSchema);
|
|
12
|
-
export default ApplicationRiskNarrativeModel;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
const valuationSchema = new mongoose.Schema({
|
|
3
|
-
amount: { type: String },
|
|
4
|
-
epcRating: { type: String, default: "" },
|
|
5
|
-
epcScore: { type: String },
|
|
6
|
-
estimatedRentalValue: { type: String },
|
|
7
|
-
instructionId: { type: String, default: "" },
|
|
8
|
-
instructionStatus: { type: String, default: "" },
|
|
9
|
-
instructionStatusComment: { type: String, default: "" },
|
|
10
|
-
isManual: { type: String, default: false },
|
|
11
|
-
squareMetres: { type: String },
|
|
12
|
-
valuerNotes: { type: String, default: "" },
|
|
13
|
-
version: { type: String, default: "" }
|
|
14
|
-
});
|
|
15
|
-
export default valuationSchema;
|