@dynamatix/gb-schemas 2.0.52 → 2.0.53

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.
Files changed (27) hide show
  1. package/dist/applicants/applicant-commitment-creditCard.model.d.ts +0 -6
  2. package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -1
  3. package/dist/applicants/applicant-commitment-creditCard.model.js +0 -1
  4. package/dist/applicants/applicant-commitment-mortgage.model.d.ts +0 -24
  5. package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -1
  6. package/dist/applicants/applicant-commitment-mortgage.model.js +0 -5
  7. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts +392 -0
  8. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts.map +1 -0
  9. package/dist/applicants/applicant-commitment-secureLoan.model.js +37 -0
  10. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts +392 -0
  11. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts.map +1 -0
  12. package/dist/applicants/applicant-commitment-unsecuredLoan.model.js +37 -0
  13. package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -1
  14. package/dist/applicants/applicant-expenditure.model.js +1 -1
  15. package/dist/applicants/applicant-self-employed-income.model.d.ts +482 -0
  16. package/dist/applicants/applicant-self-employed-income.model.d.ts.map +1 -0
  17. package/dist/applicants/applicant-self-employed-income.model.js +16 -0
  18. package/dist/applicants/applicant-sole-trader-income.model.d.ts +182 -0
  19. package/dist/applicants/applicant-sole-trader-income.model.d.ts.map +1 -0
  20. package/dist/applicants/applicant-sole-trader-income.model.js +12 -0
  21. package/dist/applicants/applicant.model.d.ts +10 -1
  22. package/dist/applicants/applicant.model.d.ts.map +1 -1
  23. package/dist/applicants/applicant.model.js +10 -1
  24. package/dist/applicants/index.d.ts +17 -13
  25. package/dist/applicants/index.d.ts.map +1 -1
  26. package/dist/applicants/index.js +17 -13
  27. package/package.json +1 -1
@@ -149,7 +149,6 @@ declare const CreditCardCommitmentModel: mongoose.Model<{
149
149
  defaultOptions?: unknown;
150
150
  } | null | undefined;
151
151
  jointNames?: unknown;
152
- creditCardRationale?: unknown;
153
152
  }, {}, {}, {}, mongoose.Document<unknown, {}, {
154
153
  isSelected?: unknown;
155
154
  source?: unknown;
@@ -299,7 +298,6 @@ declare const CreditCardCommitmentModel: mongoose.Model<{
299
298
  defaultOptions?: unknown;
300
299
  } | null | undefined;
301
300
  jointNames?: unknown;
302
- creditCardRationale?: unknown;
303
301
  }> & {
304
302
  isSelected?: unknown;
305
303
  source?: unknown;
@@ -449,7 +447,6 @@ declare const CreditCardCommitmentModel: mongoose.Model<{
449
447
  defaultOptions?: unknown;
450
448
  } | null | undefined;
451
449
  jointNames?: unknown;
452
- creditCardRationale?: unknown;
453
450
  } & {
454
451
  _id: mongoose.Types.ObjectId;
455
452
  } & {
@@ -473,7 +470,6 @@ declare const CreditCardCommitmentModel: mongoose.Model<{
473
470
  creditLimit: Pound;
474
471
  creditCardRepaymentTypeLid: mongoose.Types.ObjectId;
475
472
  monthlyPayment: Pound;
476
- creditCardRationale: string;
477
473
  jointNames?: boolean | null | undefined;
478
474
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
479
475
  isSelected: boolean;
@@ -485,7 +481,6 @@ declare const CreditCardCommitmentModel: mongoose.Model<{
485
481
  creditLimit: Pound;
486
482
  creditCardRepaymentTypeLid: mongoose.Types.ObjectId;
487
483
  monthlyPayment: Pound;
488
- creditCardRationale: string;
489
484
  jointNames?: boolean | null | undefined;
490
485
  }>> & mongoose.FlatRecord<{
491
486
  isSelected: boolean;
@@ -497,7 +492,6 @@ declare const CreditCardCommitmentModel: mongoose.Model<{
497
492
  creditLimit: Pound;
498
493
  creditCardRepaymentTypeLid: mongoose.Types.ObjectId;
499
494
  monthlyPayment: Pound;
500
- creditCardRationale: string;
501
495
  jointNames?: boolean | null | undefined;
502
496
  }> & {
503
497
  _id: mongoose.Types.ObjectId;
@@ -1 +1 @@
1
- {"version":3,"file":"applicant-commitment-creditCard.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-creditCard.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAmC/C,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAqE,CAAC;AACrG,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"applicant-commitment-creditCard.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-creditCard.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAkC/C,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAqE,CAAC;AACrG,eAAe,yBAAyB,CAAC"}
@@ -18,7 +18,6 @@ const creditCardCommitmentSchema = new mongoose.Schema({
18
18
  default: "Broker"
19
19
  },
20
20
  isSelected: { type: Boolean, default: true }, // mark as selected for summary calculation
21
- creditCardRationale: { type: String, default: "" }, // Rationale for credit card
22
21
  }, {
23
22
  toJSON: { getters: true, virtuals: true },
24
23
  toObject: { getters: true, virtuals: true }
@@ -10,11 +10,8 @@ declare const MortgageCommitmentModel: mongoose.Model<{
10
10
  commitmentId?: unknown;
11
11
  lenderName?: unknown;
12
12
  monthlyPayment?: unknown;
13
- securityDetails?: unknown;
14
- purpose?: unknown;
15
13
  doHaveSharedResponsibility?: unknown;
16
14
  sharedMortgage?: unknown;
17
- remainingTerm?: unknown;
18
15
  startDate?: unknown;
19
16
  propertyValue?: {
20
17
  validators: mongoose.Types.DocumentArray<{
@@ -117,7 +114,6 @@ declare const MortgageCommitmentModel: mongoose.Model<{
117
114
  accountUptoDateFailDetails?: unknown;
118
115
  accountInArrears?: unknown;
119
116
  accountInArrearsDetails?: unknown;
120
- mortgageHPPRationale?: unknown;
121
117
  financeTypeHppLid?: mongoose.Types.ObjectId | null | undefined;
122
118
  hppRepaymentTypeLid?: unknown;
123
119
  mortgageRate?: unknown;
@@ -134,11 +130,8 @@ declare const MortgageCommitmentModel: mongoose.Model<{
134
130
  commitmentId?: unknown;
135
131
  lenderName?: unknown;
136
132
  monthlyPayment?: unknown;
137
- securityDetails?: unknown;
138
- purpose?: unknown;
139
133
  doHaveSharedResponsibility?: unknown;
140
134
  sharedMortgage?: unknown;
141
- remainingTerm?: unknown;
142
135
  startDate?: unknown;
143
136
  propertyValue?: {
144
137
  validators: mongoose.Types.DocumentArray<{
@@ -241,7 +234,6 @@ declare const MortgageCommitmentModel: mongoose.Model<{
241
234
  accountUptoDateFailDetails?: unknown;
242
235
  accountInArrears?: unknown;
243
236
  accountInArrearsDetails?: unknown;
244
- mortgageHPPRationale?: unknown;
245
237
  financeTypeHppLid?: mongoose.Types.ObjectId | null | undefined;
246
238
  hppRepaymentTypeLid?: unknown;
247
239
  mortgageRate?: unknown;
@@ -258,11 +250,8 @@ declare const MortgageCommitmentModel: mongoose.Model<{
258
250
  commitmentId?: unknown;
259
251
  lenderName?: unknown;
260
252
  monthlyPayment?: unknown;
261
- securityDetails?: unknown;
262
- purpose?: unknown;
263
253
  doHaveSharedResponsibility?: unknown;
264
254
  sharedMortgage?: unknown;
265
- remainingTerm?: unknown;
266
255
  startDate?: unknown;
267
256
  propertyValue?: {
268
257
  validators: mongoose.Types.DocumentArray<{
@@ -365,7 +354,6 @@ declare const MortgageCommitmentModel: mongoose.Model<{
365
354
  accountUptoDateFailDetails?: unknown;
366
355
  accountInArrears?: unknown;
367
356
  accountInArrearsDetails?: unknown;
368
- mortgageHPPRationale?: unknown;
369
357
  financeTypeHppLid?: mongoose.Types.ObjectId | null | undefined;
370
358
  hppRepaymentTypeLid?: unknown;
371
359
  mortgageRate?: unknown;
@@ -392,10 +380,7 @@ declare const MortgageCommitmentModel: mongoose.Model<{
392
380
  repaymentTypeLid: mongoose.Types.ObjectId;
393
381
  fixedTerm: string;
394
382
  commitmentId: string;
395
- securityDetails: string;
396
- purpose: string;
397
383
  sharedMortgage: string;
398
- remainingTerm: string;
399
384
  startDate: string;
400
385
  propertyValue: Pound;
401
386
  mortgageTypeLid: mongoose.Types.ObjectId;
@@ -403,7 +388,6 @@ declare const MortgageCommitmentModel: mongoose.Model<{
403
388
  furtherAdvanceDetails: string;
404
389
  accountUptoDateFailDetails: string;
405
390
  accountInArrearsDetails: string;
406
- mortgageHPPRationale: string;
407
391
  financeTypeHppLid: mongoose.Types.ObjectId;
408
392
  outstandingBalance?: Pound | null | undefined;
409
393
  lenderName?: string | null | undefined;
@@ -424,10 +408,7 @@ declare const MortgageCommitmentModel: mongoose.Model<{
424
408
  repaymentTypeLid: mongoose.Types.ObjectId;
425
409
  fixedTerm: string;
426
410
  commitmentId: string;
427
- securityDetails: string;
428
- purpose: string;
429
411
  sharedMortgage: string;
430
- remainingTerm: string;
431
412
  startDate: string;
432
413
  propertyValue: Pound;
433
414
  mortgageTypeLid: mongoose.Types.ObjectId;
@@ -435,7 +416,6 @@ declare const MortgageCommitmentModel: mongoose.Model<{
435
416
  furtherAdvanceDetails: string;
436
417
  accountUptoDateFailDetails: string;
437
418
  accountInArrearsDetails: string;
438
- mortgageHPPRationale: string;
439
419
  financeTypeHppLid: mongoose.Types.ObjectId;
440
420
  outstandingBalance?: Pound | null | undefined;
441
421
  lenderName?: string | null | undefined;
@@ -456,10 +436,7 @@ declare const MortgageCommitmentModel: mongoose.Model<{
456
436
  repaymentTypeLid: mongoose.Types.ObjectId;
457
437
  fixedTerm: string;
458
438
  commitmentId: string;
459
- securityDetails: string;
460
- purpose: string;
461
439
  sharedMortgage: string;
462
- remainingTerm: string;
463
440
  startDate: string;
464
441
  propertyValue: Pound;
465
442
  mortgageTypeLid: mongoose.Types.ObjectId;
@@ -467,7 +444,6 @@ declare const MortgageCommitmentModel: mongoose.Model<{
467
444
  furtherAdvanceDetails: string;
468
445
  accountUptoDateFailDetails: string;
469
446
  accountInArrearsDetails: string;
470
- mortgageHPPRationale: string;
471
447
  financeTypeHppLid: mongoose.Types.ObjectId;
472
448
  outstandingBalance?: Pound | null | undefined;
473
449
  lenderName?: string | null | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"applicant-commitment-mortgage.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-mortgage.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AA8E/C,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiE,CAAC;AAC/F,eAAe,uBAAuB,CAAC"}
1
+ {"version":3,"file":"applicant-commitment-mortgage.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-mortgage.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAyE/C,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiE,CAAC;AAC/F,eAAe,uBAAuB,CAAC"}
@@ -35,17 +35,12 @@ const mortgageCommitmentSchema = new mongoose.Schema({
35
35
  default: "Broker"
36
36
  },
37
37
  isSelected: { type: Boolean, default: true }, // mark as selected for summary calculation
38
- mortgageHPPRationale: { type: String, default: "" }, // Rationale for mortgageHPP
39
38
  financeTypeHppLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
40
39
  hppRepaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
41
40
  mortgageRate: { type: Number },
42
41
  financeHomeTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
43
42
  remainingTermMonth: { type: Number },
44
43
  chargeTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
45
- // Unique fields from secured loan model
46
- securityDetails: { type: String, default: null },
47
- purpose: { type: String, default: null },
48
- remainingTerm: { type: String, default: null },
49
44
  }, {
50
45
  toJSON: { getters: true, virtuals: true },
51
46
  toObject: { getters: true, virtuals: true }
@@ -0,0 +1,392 @@
1
+ import mongoose from "mongoose";
2
+ import { Pound } from "../value-objects/pound";
3
+ declare const SecuredLoanCommitmentModel: mongoose.Model<{
4
+ isSelected?: unknown;
5
+ source?: unknown;
6
+ applicantId?: mongoose.Types.ObjectId | null | undefined;
7
+ outstandingBalance?: {
8
+ validators: mongoose.Types.DocumentArray<{
9
+ type?: unknown;
10
+ message?: unknown;
11
+ validator?: unknown;
12
+ reason?: unknown;
13
+ }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
14
+ type?: unknown;
15
+ message?: unknown;
16
+ validator?: unknown;
17
+ reason?: unknown;
18
+ }> & {
19
+ type?: unknown;
20
+ message?: unknown;
21
+ validator?: unknown;
22
+ reason?: unknown;
23
+ }>;
24
+ get?: {} | null | undefined;
25
+ schema?: {
26
+ [x: string]: unknown;
27
+ } | null | undefined;
28
+ set?: {} | null | undefined;
29
+ validate?: {} | null | undefined;
30
+ default?: {} | null | undefined;
31
+ text?: {} | null | undefined;
32
+ unique?: {} | null | undefined;
33
+ index?: {} | null | undefined;
34
+ sparse?: {} | null | undefined;
35
+ required?: {} | null | undefined;
36
+ ref?: {} | null | undefined;
37
+ cast?: {} | null | undefined;
38
+ select?: {} | null | undefined;
39
+ immutable?: {} | null | undefined;
40
+ transform?: {} | null | undefined;
41
+ options?: {
42
+ [x: string]: unknown;
43
+ } | null | undefined;
44
+ OptionsConstructor?: {
45
+ [x: string]: unknown;
46
+ } | null | undefined;
47
+ getEmbeddedSchemaType?: {} | null | undefined;
48
+ instance?: unknown;
49
+ isRequired?: unknown;
50
+ path?: unknown;
51
+ validateAll?: {} | null | undefined;
52
+ defaultOptions?: unknown;
53
+ } | null | undefined;
54
+ commitmentId?: unknown;
55
+ lenderName?: unknown;
56
+ monthlyPayment?: {
57
+ validators: mongoose.Types.DocumentArray<{
58
+ type?: unknown;
59
+ message?: unknown;
60
+ validator?: unknown;
61
+ reason?: unknown;
62
+ }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
63
+ type?: unknown;
64
+ message?: unknown;
65
+ validator?: unknown;
66
+ reason?: unknown;
67
+ }> & {
68
+ type?: unknown;
69
+ message?: unknown;
70
+ validator?: unknown;
71
+ reason?: unknown;
72
+ }>;
73
+ get?: {} | null | undefined;
74
+ schema?: {
75
+ [x: string]: unknown;
76
+ } | null | undefined;
77
+ set?: {} | null | undefined;
78
+ validate?: {} | null | undefined;
79
+ default?: {} | null | undefined;
80
+ text?: {} | null | undefined;
81
+ unique?: {} | null | undefined;
82
+ index?: {} | null | undefined;
83
+ sparse?: {} | null | undefined;
84
+ required?: {} | null | undefined;
85
+ ref?: {} | null | undefined;
86
+ cast?: {} | null | undefined;
87
+ select?: {} | null | undefined;
88
+ immutable?: {} | null | undefined;
89
+ transform?: {} | null | undefined;
90
+ options?: {
91
+ [x: string]: unknown;
92
+ } | null | undefined;
93
+ OptionsConstructor?: {
94
+ [x: string]: unknown;
95
+ } | null | undefined;
96
+ getEmbeddedSchemaType?: {} | null | undefined;
97
+ instance?: unknown;
98
+ isRequired?: unknown;
99
+ path?: unknown;
100
+ validateAll?: {} | null | undefined;
101
+ defaultOptions?: unknown;
102
+ } | null | undefined;
103
+ loanTypeLid?: mongoose.Types.ObjectId | null | undefined;
104
+ securityDetails?: unknown;
105
+ purpose?: unknown;
106
+ doHaveSharedResponsibility?: unknown;
107
+ sharedMortgage?: unknown;
108
+ remainingTerm?: unknown;
109
+ startDate?: unknown;
110
+ commitmentTypeLid?: mongoose.Types.ObjectId | null | undefined;
111
+ }, {}, {}, {}, mongoose.Document<unknown, {}, {
112
+ isSelected?: unknown;
113
+ source?: unknown;
114
+ applicantId?: mongoose.Types.ObjectId | null | undefined;
115
+ outstandingBalance?: {
116
+ validators: mongoose.Types.DocumentArray<{
117
+ type?: unknown;
118
+ message?: unknown;
119
+ validator?: unknown;
120
+ reason?: unknown;
121
+ }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
122
+ type?: unknown;
123
+ message?: unknown;
124
+ validator?: unknown;
125
+ reason?: unknown;
126
+ }> & {
127
+ type?: unknown;
128
+ message?: unknown;
129
+ validator?: unknown;
130
+ reason?: unknown;
131
+ }>;
132
+ get?: {} | null | undefined;
133
+ schema?: {
134
+ [x: string]: unknown;
135
+ } | null | undefined;
136
+ set?: {} | null | undefined;
137
+ validate?: {} | null | undefined;
138
+ default?: {} | null | undefined;
139
+ text?: {} | null | undefined;
140
+ unique?: {} | null | undefined;
141
+ index?: {} | null | undefined;
142
+ sparse?: {} | null | undefined;
143
+ required?: {} | null | undefined;
144
+ ref?: {} | null | undefined;
145
+ cast?: {} | null | undefined;
146
+ select?: {} | null | undefined;
147
+ immutable?: {} | null | undefined;
148
+ transform?: {} | null | undefined;
149
+ options?: {
150
+ [x: string]: unknown;
151
+ } | null | undefined;
152
+ OptionsConstructor?: {
153
+ [x: string]: unknown;
154
+ } | null | undefined;
155
+ getEmbeddedSchemaType?: {} | null | undefined;
156
+ instance?: unknown;
157
+ isRequired?: unknown;
158
+ path?: unknown;
159
+ validateAll?: {} | null | undefined;
160
+ defaultOptions?: unknown;
161
+ } | null | undefined;
162
+ commitmentId?: unknown;
163
+ lenderName?: unknown;
164
+ monthlyPayment?: {
165
+ validators: mongoose.Types.DocumentArray<{
166
+ type?: unknown;
167
+ message?: unknown;
168
+ validator?: unknown;
169
+ reason?: unknown;
170
+ }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
171
+ type?: unknown;
172
+ message?: unknown;
173
+ validator?: unknown;
174
+ reason?: unknown;
175
+ }> & {
176
+ type?: unknown;
177
+ message?: unknown;
178
+ validator?: unknown;
179
+ reason?: unknown;
180
+ }>;
181
+ get?: {} | null | undefined;
182
+ schema?: {
183
+ [x: string]: unknown;
184
+ } | null | undefined;
185
+ set?: {} | null | undefined;
186
+ validate?: {} | null | undefined;
187
+ default?: {} | null | undefined;
188
+ text?: {} | null | undefined;
189
+ unique?: {} | null | undefined;
190
+ index?: {} | null | undefined;
191
+ sparse?: {} | null | undefined;
192
+ required?: {} | null | undefined;
193
+ ref?: {} | null | undefined;
194
+ cast?: {} | null | undefined;
195
+ select?: {} | null | undefined;
196
+ immutable?: {} | null | undefined;
197
+ transform?: {} | null | undefined;
198
+ options?: {
199
+ [x: string]: unknown;
200
+ } | null | undefined;
201
+ OptionsConstructor?: {
202
+ [x: string]: unknown;
203
+ } | null | undefined;
204
+ getEmbeddedSchemaType?: {} | null | undefined;
205
+ instance?: unknown;
206
+ isRequired?: unknown;
207
+ path?: unknown;
208
+ validateAll?: {} | null | undefined;
209
+ defaultOptions?: unknown;
210
+ } | null | undefined;
211
+ loanTypeLid?: mongoose.Types.ObjectId | null | undefined;
212
+ securityDetails?: unknown;
213
+ purpose?: unknown;
214
+ doHaveSharedResponsibility?: unknown;
215
+ sharedMortgage?: unknown;
216
+ remainingTerm?: unknown;
217
+ startDate?: unknown;
218
+ commitmentTypeLid?: mongoose.Types.ObjectId | null | undefined;
219
+ }> & {
220
+ isSelected?: unknown;
221
+ source?: unknown;
222
+ applicantId?: mongoose.Types.ObjectId | null | undefined;
223
+ outstandingBalance?: {
224
+ validators: mongoose.Types.DocumentArray<{
225
+ type?: unknown;
226
+ message?: unknown;
227
+ validator?: unknown;
228
+ reason?: unknown;
229
+ }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
230
+ type?: unknown;
231
+ message?: unknown;
232
+ validator?: unknown;
233
+ reason?: unknown;
234
+ }> & {
235
+ type?: unknown;
236
+ message?: unknown;
237
+ validator?: unknown;
238
+ reason?: unknown;
239
+ }>;
240
+ get?: {} | null | undefined;
241
+ schema?: {
242
+ [x: string]: unknown;
243
+ } | null | undefined;
244
+ set?: {} | null | undefined;
245
+ validate?: {} | null | undefined;
246
+ default?: {} | null | undefined;
247
+ text?: {} | null | undefined;
248
+ unique?: {} | null | undefined;
249
+ index?: {} | null | undefined;
250
+ sparse?: {} | null | undefined;
251
+ required?: {} | null | undefined;
252
+ ref?: {} | null | undefined;
253
+ cast?: {} | null | undefined;
254
+ select?: {} | null | undefined;
255
+ immutable?: {} | null | undefined;
256
+ transform?: {} | null | undefined;
257
+ options?: {
258
+ [x: string]: unknown;
259
+ } | null | undefined;
260
+ OptionsConstructor?: {
261
+ [x: string]: unknown;
262
+ } | null | undefined;
263
+ getEmbeddedSchemaType?: {} | null | undefined;
264
+ instance?: unknown;
265
+ isRequired?: unknown;
266
+ path?: unknown;
267
+ validateAll?: {} | null | undefined;
268
+ defaultOptions?: unknown;
269
+ } | null | undefined;
270
+ commitmentId?: unknown;
271
+ lenderName?: unknown;
272
+ monthlyPayment?: {
273
+ validators: mongoose.Types.DocumentArray<{
274
+ type?: unknown;
275
+ message?: unknown;
276
+ validator?: unknown;
277
+ reason?: unknown;
278
+ }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
279
+ type?: unknown;
280
+ message?: unknown;
281
+ validator?: unknown;
282
+ reason?: unknown;
283
+ }> & {
284
+ type?: unknown;
285
+ message?: unknown;
286
+ validator?: unknown;
287
+ reason?: unknown;
288
+ }>;
289
+ get?: {} | null | undefined;
290
+ schema?: {
291
+ [x: string]: unknown;
292
+ } | null | undefined;
293
+ set?: {} | null | undefined;
294
+ validate?: {} | null | undefined;
295
+ default?: {} | null | undefined;
296
+ text?: {} | null | undefined;
297
+ unique?: {} | null | undefined;
298
+ index?: {} | null | undefined;
299
+ sparse?: {} | null | undefined;
300
+ required?: {} | null | undefined;
301
+ ref?: {} | null | undefined;
302
+ cast?: {} | null | undefined;
303
+ select?: {} | null | undefined;
304
+ immutable?: {} | null | undefined;
305
+ transform?: {} | null | undefined;
306
+ options?: {
307
+ [x: string]: unknown;
308
+ } | null | undefined;
309
+ OptionsConstructor?: {
310
+ [x: string]: unknown;
311
+ } | null | undefined;
312
+ getEmbeddedSchemaType?: {} | null | undefined;
313
+ instance?: unknown;
314
+ isRequired?: unknown;
315
+ path?: unknown;
316
+ validateAll?: {} | null | undefined;
317
+ defaultOptions?: unknown;
318
+ } | null | undefined;
319
+ loanTypeLid?: mongoose.Types.ObjectId | null | undefined;
320
+ securityDetails?: unknown;
321
+ purpose?: unknown;
322
+ doHaveSharedResponsibility?: unknown;
323
+ sharedMortgage?: unknown;
324
+ remainingTerm?: unknown;
325
+ startDate?: unknown;
326
+ commitmentTypeLid?: mongoose.Types.ObjectId | null | undefined;
327
+ } & {
328
+ _id: mongoose.Types.ObjectId;
329
+ } & {
330
+ __v: number;
331
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
332
+ toJSON: {
333
+ getters: true;
334
+ };
335
+ toObject: {
336
+ getters: true;
337
+ };
338
+ }, {
339
+ isSelected: boolean;
340
+ source: "Broker" | "Credit Report" | "Underwriter";
341
+ applicantId: mongoose.Types.ObjectId;
342
+ outstandingBalance: Pound;
343
+ commitmentId: string;
344
+ lenderName: string;
345
+ monthlyPayment: Pound;
346
+ loanTypeLid: mongoose.Types.ObjectId;
347
+ securityDetails: string;
348
+ purpose: string;
349
+ sharedMortgage: string;
350
+ remainingTerm: number;
351
+ startDate: string;
352
+ commitmentTypeLid: mongoose.Types.ObjectId;
353
+ doHaveSharedResponsibility?: boolean | null | undefined;
354
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
355
+ isSelected: boolean;
356
+ source: "Broker" | "Credit Report" | "Underwriter";
357
+ applicantId: mongoose.Types.ObjectId;
358
+ outstandingBalance: Pound;
359
+ commitmentId: string;
360
+ lenderName: string;
361
+ monthlyPayment: Pound;
362
+ loanTypeLid: mongoose.Types.ObjectId;
363
+ securityDetails: string;
364
+ purpose: string;
365
+ sharedMortgage: string;
366
+ remainingTerm: number;
367
+ startDate: string;
368
+ commitmentTypeLid: mongoose.Types.ObjectId;
369
+ doHaveSharedResponsibility?: boolean | null | undefined;
370
+ }>> & mongoose.FlatRecord<{
371
+ isSelected: boolean;
372
+ source: "Broker" | "Credit Report" | "Underwriter";
373
+ applicantId: mongoose.Types.ObjectId;
374
+ outstandingBalance: Pound;
375
+ commitmentId: string;
376
+ lenderName: string;
377
+ monthlyPayment: Pound;
378
+ loanTypeLid: mongoose.Types.ObjectId;
379
+ securityDetails: string;
380
+ purpose: string;
381
+ sharedMortgage: string;
382
+ remainingTerm: number;
383
+ startDate: string;
384
+ commitmentTypeLid: mongoose.Types.ObjectId;
385
+ doHaveSharedResponsibility?: boolean | null | undefined;
386
+ }> & {
387
+ _id: mongoose.Types.ObjectId;
388
+ } & {
389
+ __v: number;
390
+ }>>;
391
+ export default SecuredLoanCommitmentModel;
392
+ //# sourceMappingURL=applicant-commitment-secureLoan.model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"applicant-commitment-secureLoan.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-secureLoan.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAuC/C,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuE,CAAC;AACxG,eAAe,0BAA0B,CAAC"}
@@ -0,0 +1,37 @@
1
+ import mongoose from "mongoose";
2
+ import { Pound } from "../value-objects/pound";
3
+ const securedLoanCommitmentSchema = new mongoose.Schema({
4
+ applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
5
+ lenderName: { type: String, required: true }, // Provider Name / Provider category
6
+ commitmentId: { type: String, default: null },
7
+ securityDetails: { type: String, default: null },
8
+ purpose: { type: String, default: null },
9
+ doHaveSharedResponsibility: {
10
+ type: Boolean,
11
+ },
12
+ sharedMortgage: { type: String, default: null },
13
+ remainingTerm: { type: Number, default: null }, // Remaining term
14
+ startDate: { type: String, default: null },
15
+ outstandingBalance: { type: Pound, required: true }, // Balance
16
+ monthlyPayment: { type: Pound, required: true }, // Monthly payment
17
+ source: {
18
+ type: String,
19
+ enum: ["Broker", "Credit Report", "Underwriter"],
20
+ default: "Broker"
21
+ },
22
+ isSelected: { type: Boolean, default: true }, // mark as selected for summary calculation
23
+ // Unique fields from loan model
24
+ commitmentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
25
+ loanTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
26
+ }, {
27
+ toJSON: { getters: true },
28
+ toObject: { getters: true }
29
+ });
30
+ // virtual property 'lendingType'
31
+ securedLoanCommitmentSchema.virtual('lendingType').get(function () {
32
+ return this.applicantId?.applicationId?.lendingTypeLid instanceof mongoose.Types.ObjectId
33
+ ? null
34
+ : this.applicantId?.applicationId?.lendingTypeLid?.name || null;
35
+ });
36
+ const SecuredLoanCommitmentModel = mongoose.model("SecuredLoanCommitment", securedLoanCommitmentSchema);
37
+ export default SecuredLoanCommitmentModel;