@dynamatix/gb-schemas 1.2.76 → 1.2.78

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.
@@ -483,9 +483,11 @@ declare const CreditCardCommitmentModel: mongoose.Model<{
483
483
  }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
484
484
  toJSON: {
485
485
  getters: true;
486
+ virtuals: true;
486
487
  };
487
488
  toObject: {
488
489
  getters: true;
490
+ virtuals: true;
489
491
  };
490
492
  }, {
491
493
  isSelected: boolean;
@@ -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;AAyB/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"}
@@ -19,8 +19,16 @@ const creditCardCommitmentSchema = new mongoose.Schema({
19
19
  },
20
20
  isSelected: { type: Boolean, default: true }, // mark as selected for summary calculation
21
21
  }, {
22
- toJSON: { getters: true },
23
- toObject: { getters: true }
22
+ toJSON: { getters: true, virtuals: true },
23
+ toObject: { getters: true, virtuals: true }
24
+ });
25
+ // virtual field: ApplicationId (applicantId -> applicationId)
26
+ creditCardCommitmentSchema.virtual('ApplicationId', {
27
+ ref: 'Applicant',
28
+ localField: 'applicantId',
29
+ foreignField: '_id',
30
+ justOne: true,
31
+ options: { select: 'applicationId' }
24
32
  });
25
33
  const CreditCardCommitmentModel = mongoose.model("CreditCardCommitment", creditCardCommitmentSchema);
26
34
  export default CreditCardCommitmentModel;
@@ -357,9 +357,11 @@ declare const LoanCommitmentModel: mongoose.Model<{
357
357
  }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
358
358
  toJSON: {
359
359
  getters: true;
360
+ virtuals: true;
360
361
  };
361
362
  toObject: {
362
363
  getters: true;
364
+ virtuals: true;
363
365
  };
364
366
  }, {
365
367
  isSelected: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"applicant-commitment-loan.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-loan.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AA6B/C,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyD,CAAC;AACnF,eAAe,mBAAmB,CAAC"}
1
+ {"version":3,"file":"applicant-commitment-loan.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-commitment-loan.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAsC/C,QAAA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyD,CAAC;AACnF,eAAe,mBAAmB,CAAC"}
@@ -23,8 +23,16 @@ const loanCommitmentSchema = new mongoose.Schema({
23
23
  },
24
24
  isSelected: { type: Boolean, default: true }, // mark as selected for summary calculation
25
25
  }, {
26
- toJSON: { getters: true },
27
- toObject: { getters: true }
26
+ toJSON: { getters: true, virtuals: true },
27
+ toObject: { getters: true, virtuals: true }
28
+ });
29
+ // virtual field: ApplicationId (applicantId -> applicationId)
30
+ loanCommitmentSchema.virtual('ApplicationId', {
31
+ ref: 'Applicant',
32
+ localField: 'applicantId',
33
+ foreignField: '_id',
34
+ justOne: true,
35
+ options: { select: 'applicationId' }
28
36
  });
29
37
  const LoanCommitmentModel = mongoose.model("LoanCommitment", loanCommitmentSchema);
30
38
  export default LoanCommitmentModel;
@@ -29,106 +29,14 @@ import { Pound } from "../value-objects/pound";
29
29
  declare const MortgageCommitmentModel: mongoose.Model<{
30
30
  isSelected?: unknown;
31
31
  source?: unknown;
32
- applicantId?: mongoose.Types.ObjectId | null | undefined;
32
+ applicantId?: unknown;
33
33
  repaymentTypeLid?: mongoose.Types.ObjectId | null | undefined;
34
- outstandingBalance?: {
35
- validators: mongoose.Types.DocumentArray<{
36
- type?: unknown;
37
- message?: unknown;
38
- validator?: unknown;
39
- reason?: unknown;
40
- }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
41
- type?: unknown;
42
- message?: unknown;
43
- validator?: unknown;
44
- reason?: unknown;
45
- }> & {
46
- type?: unknown;
47
- message?: unknown;
48
- validator?: unknown;
49
- reason?: unknown;
50
- }>;
51
- get?: {} | null | undefined;
52
- schema?: {
53
- [x: string]: unknown;
54
- } | null | undefined;
55
- set?: {} | null | undefined;
56
- validate?: {} | null | undefined;
57
- default?: {} | null | undefined;
58
- text?: {} | null | undefined;
59
- unique?: {} | null | undefined;
60
- index?: {} | null | undefined;
61
- sparse?: {} | null | undefined;
62
- required?: {} | null | undefined;
63
- ref?: {} | null | undefined;
64
- cast?: {} | null | undefined;
65
- select?: {} | null | undefined;
66
- immutable?: {} | null | undefined;
67
- transform?: {} | null | undefined;
68
- options?: {
69
- [x: string]: unknown;
70
- } | null | undefined;
71
- OptionsConstructor?: {
72
- [x: string]: unknown;
73
- } | null | undefined;
74
- getEmbeddedSchemaType?: {} | null | undefined;
75
- instance?: unknown;
76
- isRequired?: unknown;
77
- path?: unknown;
78
- validateAll?: {} | null | undefined;
79
- defaultOptions?: unknown;
80
- } | null | undefined;
34
+ outstandingBalance?: unknown;
81
35
  fixedTerm?: unknown;
82
36
  commitmentId?: unknown;
83
37
  commitmentTypeLid?: mongoose.Types.ObjectId | null | undefined;
84
38
  lenderName?: unknown;
85
- monthlyPayment?: {
86
- validators: mongoose.Types.DocumentArray<{
87
- type?: unknown;
88
- message?: unknown;
89
- validator?: unknown;
90
- reason?: unknown;
91
- }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
92
- type?: unknown;
93
- message?: unknown;
94
- validator?: unknown;
95
- reason?: unknown;
96
- }> & {
97
- type?: unknown;
98
- message?: unknown;
99
- validator?: unknown;
100
- reason?: unknown;
101
- }>;
102
- get?: {} | null | undefined;
103
- schema?: {
104
- [x: string]: unknown;
105
- } | null | undefined;
106
- set?: {} | null | undefined;
107
- validate?: {} | null | undefined;
108
- default?: {} | null | undefined;
109
- text?: {} | null | undefined;
110
- unique?: {} | null | undefined;
111
- index?: {} | null | undefined;
112
- sparse?: {} | null | undefined;
113
- required?: {} | null | undefined;
114
- ref?: {} | null | undefined;
115
- cast?: {} | null | undefined;
116
- select?: {} | null | undefined;
117
- immutable?: {} | null | undefined;
118
- transform?: {} | null | undefined;
119
- options?: {
120
- [x: string]: unknown;
121
- } | null | undefined;
122
- OptionsConstructor?: {
123
- [x: string]: unknown;
124
- } | null | undefined;
125
- getEmbeddedSchemaType?: {} | null | undefined;
126
- instance?: unknown;
127
- isRequired?: unknown;
128
- path?: unknown;
129
- validateAll?: {} | null | undefined;
130
- defaultOptions?: unknown;
131
- } | null | undefined;
39
+ monthlyPayment?: unknown;
132
40
  doHaveSharedResponsibility?: unknown;
133
41
  sharedMortgage?: unknown;
134
42
  startDate?: unknown;
@@ -233,109 +141,23 @@ declare const MortgageCommitmentModel: mongoose.Model<{
233
141
  accountUptoDateFailDetails?: unknown;
234
142
  accountInArrears?: unknown;
235
143
  accountInArrearsDetails?: unknown;
144
+ financeTypeHppLid?: mongoose.Types.ObjectId | null | undefined;
145
+ hppRepaymentTypeLid?: unknown;
146
+ mortgageRate?: unknown;
147
+ financeHomeTypeLid?: unknown;
148
+ remainingTermMonth?: unknown;
149
+ chargeTypeLid?: unknown;
236
150
  }, {}, {}, {}, mongoose.Document<unknown, {}, {
237
151
  isSelected?: unknown;
238
152
  source?: unknown;
239
- applicantId?: mongoose.Types.ObjectId | null | undefined;
153
+ applicantId?: unknown;
240
154
  repaymentTypeLid?: mongoose.Types.ObjectId | null | undefined;
241
- outstandingBalance?: {
242
- validators: mongoose.Types.DocumentArray<{
243
- type?: unknown;
244
- message?: unknown;
245
- validator?: unknown;
246
- reason?: unknown;
247
- }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
248
- type?: unknown;
249
- message?: unknown;
250
- validator?: unknown;
251
- reason?: unknown;
252
- }> & {
253
- type?: unknown;
254
- message?: unknown;
255
- validator?: unknown;
256
- reason?: unknown;
257
- }>;
258
- get?: {} | null | undefined;
259
- schema?: {
260
- [x: string]: unknown;
261
- } | null | undefined;
262
- set?: {} | null | undefined;
263
- validate?: {} | null | undefined;
264
- default?: {} | null | undefined;
265
- text?: {} | null | undefined;
266
- unique?: {} | null | undefined;
267
- index?: {} | null | undefined;
268
- sparse?: {} | null | undefined;
269
- required?: {} | null | undefined;
270
- ref?: {} | null | undefined;
271
- cast?: {} | null | undefined;
272
- select?: {} | null | undefined;
273
- immutable?: {} | null | undefined;
274
- transform?: {} | null | undefined;
275
- options?: {
276
- [x: string]: unknown;
277
- } | null | undefined;
278
- OptionsConstructor?: {
279
- [x: string]: unknown;
280
- } | null | undefined;
281
- getEmbeddedSchemaType?: {} | null | undefined;
282
- instance?: unknown;
283
- isRequired?: unknown;
284
- path?: unknown;
285
- validateAll?: {} | null | undefined;
286
- defaultOptions?: unknown;
287
- } | null | undefined;
155
+ outstandingBalance?: unknown;
288
156
  fixedTerm?: unknown;
289
157
  commitmentId?: unknown;
290
158
  commitmentTypeLid?: mongoose.Types.ObjectId | null | undefined;
291
159
  lenderName?: unknown;
292
- monthlyPayment?: {
293
- validators: mongoose.Types.DocumentArray<{
294
- type?: unknown;
295
- message?: unknown;
296
- validator?: unknown;
297
- reason?: unknown;
298
- }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
299
- type?: unknown;
300
- message?: unknown;
301
- validator?: unknown;
302
- reason?: unknown;
303
- }> & {
304
- type?: unknown;
305
- message?: unknown;
306
- validator?: unknown;
307
- reason?: unknown;
308
- }>;
309
- get?: {} | null | undefined;
310
- schema?: {
311
- [x: string]: unknown;
312
- } | null | undefined;
313
- set?: {} | null | undefined;
314
- validate?: {} | null | undefined;
315
- default?: {} | null | undefined;
316
- text?: {} | null | undefined;
317
- unique?: {} | null | undefined;
318
- index?: {} | null | undefined;
319
- sparse?: {} | null | undefined;
320
- required?: {} | null | undefined;
321
- ref?: {} | null | undefined;
322
- cast?: {} | null | undefined;
323
- select?: {} | null | undefined;
324
- immutable?: {} | null | undefined;
325
- transform?: {} | null | undefined;
326
- options?: {
327
- [x: string]: unknown;
328
- } | null | undefined;
329
- OptionsConstructor?: {
330
- [x: string]: unknown;
331
- } | null | undefined;
332
- getEmbeddedSchemaType?: {} | null | undefined;
333
- instance?: unknown;
334
- isRequired?: unknown;
335
- path?: unknown;
336
- validateAll?: {} | null | undefined;
337
- defaultOptions?: unknown;
338
- } | null | undefined;
160
+ monthlyPayment?: unknown;
339
161
  doHaveSharedResponsibility?: unknown;
340
162
  sharedMortgage?: unknown;
341
163
  startDate?: unknown;
@@ -440,109 +262,23 @@ declare const MortgageCommitmentModel: mongoose.Model<{
440
262
  accountUptoDateFailDetails?: unknown;
441
263
  accountInArrears?: unknown;
442
264
  accountInArrearsDetails?: unknown;
265
+ financeTypeHppLid?: mongoose.Types.ObjectId | null | undefined;
266
+ hppRepaymentTypeLid?: unknown;
267
+ mortgageRate?: unknown;
268
+ financeHomeTypeLid?: unknown;
269
+ remainingTermMonth?: unknown;
270
+ chargeTypeLid?: unknown;
443
271
  }> & {
444
272
  isSelected?: unknown;
445
273
  source?: unknown;
446
- applicantId?: mongoose.Types.ObjectId | null | undefined;
274
+ applicantId?: unknown;
447
275
  repaymentTypeLid?: mongoose.Types.ObjectId | null | undefined;
448
- outstandingBalance?: {
449
- validators: mongoose.Types.DocumentArray<{
450
- type?: unknown;
451
- message?: unknown;
452
- validator?: unknown;
453
- reason?: unknown;
454
- }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
455
- type?: unknown;
456
- message?: unknown;
457
- validator?: unknown;
458
- reason?: unknown;
459
- }> & {
460
- type?: unknown;
461
- message?: unknown;
462
- validator?: unknown;
463
- reason?: unknown;
464
- }>;
465
- get?: {} | null | undefined;
466
- schema?: {
467
- [x: string]: unknown;
468
- } | null | undefined;
469
- set?: {} | null | undefined;
470
- validate?: {} | null | undefined;
471
- default?: {} | null | undefined;
472
- text?: {} | null | undefined;
473
- unique?: {} | null | undefined;
474
- index?: {} | null | undefined;
475
- sparse?: {} | null | undefined;
476
- required?: {} | null | undefined;
477
- ref?: {} | null | undefined;
478
- cast?: {} | null | undefined;
479
- select?: {} | null | undefined;
480
- immutable?: {} | null | undefined;
481
- transform?: {} | null | undefined;
482
- options?: {
483
- [x: string]: unknown;
484
- } | null | undefined;
485
- OptionsConstructor?: {
486
- [x: string]: unknown;
487
- } | null | undefined;
488
- getEmbeddedSchemaType?: {} | null | undefined;
489
- instance?: unknown;
490
- isRequired?: unknown;
491
- path?: unknown;
492
- validateAll?: {} | null | undefined;
493
- defaultOptions?: unknown;
494
- } | null | undefined;
276
+ outstandingBalance?: unknown;
495
277
  fixedTerm?: unknown;
496
278
  commitmentId?: unknown;
497
279
  commitmentTypeLid?: mongoose.Types.ObjectId | null | undefined;
498
280
  lenderName?: unknown;
499
- monthlyPayment?: {
500
- validators: mongoose.Types.DocumentArray<{
501
- type?: unknown;
502
- message?: unknown;
503
- validator?: unknown;
504
- reason?: unknown;
505
- }, mongoose.Types.Subdocument<mongoose.Types.ObjectId, any, {
506
- type?: unknown;
507
- message?: unknown;
508
- validator?: unknown;
509
- reason?: unknown;
510
- }> & {
511
- type?: unknown;
512
- message?: unknown;
513
- validator?: unknown;
514
- reason?: unknown;
515
- }>;
516
- get?: {} | null | undefined;
517
- schema?: {
518
- [x: string]: unknown;
519
- } | null | undefined;
520
- set?: {} | null | undefined;
521
- validate?: {} | null | undefined;
522
- default?: {} | null | undefined;
523
- text?: {} | null | undefined;
524
- unique?: {} | null | undefined;
525
- index?: {} | null | undefined;
526
- sparse?: {} | null | undefined;
527
- required?: {} | null | undefined;
528
- ref?: {} | null | undefined;
529
- cast?: {} | null | undefined;
530
- select?: {} | null | undefined;
531
- immutable?: {} | null | undefined;
532
- transform?: {} | null | undefined;
533
- options?: {
534
- [x: string]: unknown;
535
- } | null | undefined;
536
- OptionsConstructor?: {
537
- [x: string]: unknown;
538
- } | null | undefined;
539
- getEmbeddedSchemaType?: {} | null | undefined;
540
- instance?: unknown;
541
- isRequired?: unknown;
542
- path?: unknown;
543
- validateAll?: {} | null | undefined;
544
- defaultOptions?: unknown;
545
- } | null | undefined;
281
+ monthlyPayment?: unknown;
546
282
  doHaveSharedResponsibility?: unknown;
547
283
  sharedMortgage?: unknown;
548
284
  startDate?: unknown;
@@ -647,6 +383,12 @@ declare const MortgageCommitmentModel: mongoose.Model<{
647
383
  accountUptoDateFailDetails?: unknown;
648
384
  accountInArrears?: unknown;
649
385
  accountInArrearsDetails?: unknown;
386
+ financeTypeHppLid?: mongoose.Types.ObjectId | null | undefined;
387
+ hppRepaymentTypeLid?: unknown;
388
+ mortgageRate?: unknown;
389
+ financeHomeTypeLid?: unknown;
390
+ remainingTermMonth?: unknown;
391
+ chargeTypeLid?: unknown;
650
392
  } & {
651
393
  _id: mongoose.Types.ObjectId;
652
394
  } & {
@@ -654,21 +396,19 @@ declare const MortgageCommitmentModel: mongoose.Model<{
654
396
  }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
655
397
  toJSON: {
656
398
  getters: true;
399
+ virtuals: true;
657
400
  };
658
401
  toObject: {
659
402
  getters: true;
403
+ virtuals: true;
660
404
  };
661
405
  }, {
662
406
  isSelected: boolean;
663
407
  source: "Broker" | "Credit Report";
664
- applicantId: mongoose.Types.ObjectId;
665
408
  repaymentTypeLid: mongoose.Types.ObjectId;
666
- outstandingBalance: Pound;
667
409
  fixedTerm: string;
668
410
  commitmentId: string;
669
411
  commitmentTypeLid: mongoose.Types.ObjectId;
670
- lenderName: string;
671
- monthlyPayment: Pound;
672
412
  sharedMortgage: string;
673
413
  startDate: string;
674
414
  propertyValue: Pound;
@@ -677,21 +417,27 @@ declare const MortgageCommitmentModel: mongoose.Model<{
677
417
  furtherAdvanceDetails: string;
678
418
  accountUptoDateFailDetails: string;
679
419
  accountInArrearsDetails: string;
420
+ financeTypeHppLid: mongoose.Types.ObjectId;
421
+ applicantId?: mongoose.Types.ObjectId | null | undefined;
422
+ outstandingBalance?: Pound | null | undefined;
423
+ lenderName?: string | null | undefined;
424
+ monthlyPayment?: Pound | null | undefined;
680
425
  doHaveSharedResponsibility?: boolean | null | undefined;
681
426
  furtherAdvances?: boolean | null | undefined;
682
427
  accountUptoDate?: boolean | null | undefined;
683
428
  accountInArrears?: boolean | null | undefined;
429
+ hppRepaymentTypeLid?: mongoose.Types.ObjectId | null | undefined;
430
+ mortgageRate?: number | null | undefined;
431
+ financeHomeTypeLid?: mongoose.Types.ObjectId | null | undefined;
432
+ remainingTermMonth?: number | null | undefined;
433
+ chargeTypeLid?: mongoose.Types.ObjectId | null | undefined;
684
434
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
685
435
  isSelected: boolean;
686
436
  source: "Broker" | "Credit Report";
687
- applicantId: mongoose.Types.ObjectId;
688
437
  repaymentTypeLid: mongoose.Types.ObjectId;
689
- outstandingBalance: Pound;
690
438
  fixedTerm: string;
691
439
  commitmentId: string;
692
440
  commitmentTypeLid: mongoose.Types.ObjectId;
693
- lenderName: string;
694
- monthlyPayment: Pound;
695
441
  sharedMortgage: string;
696
442
  startDate: string;
697
443
  propertyValue: Pound;
@@ -700,21 +446,27 @@ declare const MortgageCommitmentModel: mongoose.Model<{
700
446
  furtherAdvanceDetails: string;
701
447
  accountUptoDateFailDetails: string;
702
448
  accountInArrearsDetails: string;
449
+ financeTypeHppLid: mongoose.Types.ObjectId;
450
+ applicantId?: mongoose.Types.ObjectId | null | undefined;
451
+ outstandingBalance?: Pound | null | undefined;
452
+ lenderName?: string | null | undefined;
453
+ monthlyPayment?: Pound | null | undefined;
703
454
  doHaveSharedResponsibility?: boolean | null | undefined;
704
455
  furtherAdvances?: boolean | null | undefined;
705
456
  accountUptoDate?: boolean | null | undefined;
706
457
  accountInArrears?: boolean | null | undefined;
458
+ hppRepaymentTypeLid?: mongoose.Types.ObjectId | null | undefined;
459
+ mortgageRate?: number | null | undefined;
460
+ financeHomeTypeLid?: mongoose.Types.ObjectId | null | undefined;
461
+ remainingTermMonth?: number | null | undefined;
462
+ chargeTypeLid?: mongoose.Types.ObjectId | null | undefined;
707
463
  }>> & mongoose.FlatRecord<{
708
464
  isSelected: boolean;
709
465
  source: "Broker" | "Credit Report";
710
- applicantId: mongoose.Types.ObjectId;
711
466
  repaymentTypeLid: mongoose.Types.ObjectId;
712
- outstandingBalance: Pound;
713
467
  fixedTerm: string;
714
468
  commitmentId: string;
715
469
  commitmentTypeLid: mongoose.Types.ObjectId;
716
- lenderName: string;
717
- monthlyPayment: Pound;
718
470
  sharedMortgage: string;
719
471
  startDate: string;
720
472
  propertyValue: Pound;
@@ -723,10 +475,20 @@ declare const MortgageCommitmentModel: mongoose.Model<{
723
475
  furtherAdvanceDetails: string;
724
476
  accountUptoDateFailDetails: string;
725
477
  accountInArrearsDetails: string;
478
+ financeTypeHppLid: mongoose.Types.ObjectId;
479
+ applicantId?: mongoose.Types.ObjectId | null | undefined;
480
+ outstandingBalance?: Pound | null | undefined;
481
+ lenderName?: string | null | undefined;
482
+ monthlyPayment?: Pound | null | undefined;
726
483
  doHaveSharedResponsibility?: boolean | null | undefined;
727
484
  furtherAdvances?: boolean | null | undefined;
728
485
  accountUptoDate?: boolean | null | undefined;
729
486
  accountInArrears?: boolean | null | undefined;
487
+ hppRepaymentTypeLid?: mongoose.Types.ObjectId | null | undefined;
488
+ mortgageRate?: number | null | undefined;
489
+ financeHomeTypeLid?: mongoose.Types.ObjectId | null | undefined;
490
+ remainingTermMonth?: number | null | undefined;
491
+ chargeTypeLid?: mongoose.Types.ObjectId | null | undefined;
730
492
  }> & {
731
493
  _id: mongoose.Types.ObjectId;
732
494
  } & {
@@ -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;AAyD/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;AAwE/C,QAAA,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAiE,CAAC;AAC/F,eAAe,uBAAuB,CAAC"}
@@ -1,16 +1,16 @@
1
1
  import mongoose from "mongoose";
2
2
  import { Pound } from "../value-objects/pound";
3
3
  const mortgageCommitmentSchema = new mongoose.Schema({
4
- applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
5
- lenderName: { type: String, required: true }, // Provider Name / Provider category
4
+ applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant" },
5
+ lenderName: { type: String }, // Provider Name / Provider category
6
6
  propertyValue: { type: Pound, default: null },
7
7
  repaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
8
8
  mortgageTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
9
9
  fixedTerm: { type: String, default: null },
10
10
  originalLoanAmount: { type: Pound, default: null },
11
- outstandingBalance: { type: Pound, required: true }, // Balance
11
+ outstandingBalance: { type: Pound }, // Balance
12
12
  startDate: { type: String, default: null },
13
- monthlyPayment: { type: Pound, required: true }, // Monthly payment
13
+ monthlyPayment: { type: Pound }, // Monthly payment
14
14
  commitmentId: { type: String, default: null },
15
15
  commitmentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
16
16
  furtherAdvances: {
@@ -35,9 +35,23 @@ 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
+ financeTypeHppLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
39
+ hppRepaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
40
+ mortgageRate: { type: Number },
41
+ financeHomeTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
42
+ remainingTermMonth: { type: Number },
43
+ chargeTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" }
38
44
  }, {
39
- toJSON: { getters: true },
40
- toObject: { getters: true }
45
+ toJSON: { getters: true, virtuals: true },
46
+ toObject: { getters: true, virtuals: true }
47
+ });
48
+ // virtual field: ApplicationId (applicantId -> applicationId)
49
+ mortgageCommitmentSchema.virtual('ApplicationId', {
50
+ ref: 'Applicant',
51
+ localField: 'applicantId',
52
+ foreignField: '_id',
53
+ justOne: true,
54
+ options: { select: 'applicationId' }
41
55
  });
42
56
  // virtual property 'lendingType'
43
57
  mortgageCommitmentSchema.virtual('lendingType').get(function () {
@@ -233,8 +233,8 @@ declare const ResidenceCommitmentModel: mongoose.Model<{
233
233
  financeTypeHppLid?: mongoose.Types.ObjectId | null | undefined;
234
234
  hppRepaymentTypeLid?: mongoose.Types.ObjectId | null | undefined;
235
235
  mortgageRate?: unknown;
236
- remainingTermMonth?: unknown;
237
236
  financeHomeTypeLid?: mongoose.Types.ObjectId | null | undefined;
237
+ remainingTermMonth?: unknown;
238
238
  chargeTypeLid?: mongoose.Types.ObjectId | null | undefined;
239
239
  }, {}, {}, {}, mongoose.Document<unknown, {}, {
240
240
  applicantId?: mongoose.Types.ObjectId | null | undefined;
@@ -443,8 +443,8 @@ declare const ResidenceCommitmentModel: mongoose.Model<{
443
443
  financeTypeHppLid?: mongoose.Types.ObjectId | null | undefined;
444
444
  hppRepaymentTypeLid?: mongoose.Types.ObjectId | null | undefined;
445
445
  mortgageRate?: unknown;
446
- remainingTermMonth?: unknown;
447
446
  financeHomeTypeLid?: mongoose.Types.ObjectId | null | undefined;
447
+ remainingTermMonth?: unknown;
448
448
  chargeTypeLid?: mongoose.Types.ObjectId | null | undefined;
449
449
  }> & {
450
450
  applicantId?: mongoose.Types.ObjectId | null | undefined;
@@ -653,8 +653,8 @@ declare const ResidenceCommitmentModel: mongoose.Model<{
653
653
  financeTypeHppLid?: mongoose.Types.ObjectId | null | undefined;
654
654
  hppRepaymentTypeLid?: mongoose.Types.ObjectId | null | undefined;
655
655
  mortgageRate?: unknown;
656
- remainingTermMonth?: unknown;
657
656
  financeHomeTypeLid?: mongoose.Types.ObjectId | null | undefined;
657
+ remainingTermMonth?: unknown;
658
658
  chargeTypeLid?: mongoose.Types.ObjectId | null | undefined;
659
659
  } & {
660
660
  _id: mongoose.Types.ObjectId;
@@ -690,8 +690,8 @@ declare const ResidenceCommitmentModel: mongoose.Model<{
690
690
  financeTypeHppLid: mongoose.Types.ObjectId;
691
691
  hppRepaymentTypeLid: mongoose.Types.ObjectId;
692
692
  mortgageRate: number;
693
- remainingTermMonth: number;
694
693
  financeHomeTypeLid: mongoose.Types.ObjectId;
694
+ remainingTermMonth: number;
695
695
  chargeTypeLid: mongoose.Types.ObjectId;
696
696
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
697
697
  applicantId: mongoose.Types.ObjectId;
@@ -716,8 +716,8 @@ declare const ResidenceCommitmentModel: mongoose.Model<{
716
716
  financeTypeHppLid: mongoose.Types.ObjectId;
717
717
  hppRepaymentTypeLid: mongoose.Types.ObjectId;
718
718
  mortgageRate: number;
719
- remainingTermMonth: number;
720
719
  financeHomeTypeLid: mongoose.Types.ObjectId;
720
+ remainingTermMonth: number;
721
721
  chargeTypeLid: mongoose.Types.ObjectId;
722
722
  }>> & mongoose.FlatRecord<{
723
723
  applicantId: mongoose.Types.ObjectId;
@@ -742,8 +742,8 @@ declare const ResidenceCommitmentModel: mongoose.Model<{
742
742
  financeTypeHppLid: mongoose.Types.ObjectId;
743
743
  hppRepaymentTypeLid: mongoose.Types.ObjectId;
744
744
  mortgageRate: number;
745
- remainingTermMonth: number;
746
745
  financeHomeTypeLid: mongoose.Types.ObjectId;
746
+ remainingTermMonth: number;
747
747
  chargeTypeLid: mongoose.Types.ObjectId;
748
748
  }> & {
749
749
  _id: mongoose.Types.ObjectId;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.2.76",
3
+ "version": "1.2.78",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,19 +0,0 @@
1
- import mortgageCommitmentSchema from "./applicant-commitment-mortgage.model";
2
- import creditCardCommitmentSchema from "./applicant-commitment-creditCard.model";
3
- import loanCommitmentSchema from "./applicant-commitment-loan.model";
4
- import securedLoanCommitmentSchema from "./applicant-commitment-secureLoan.model";
5
- import unsecuredLoanCommitmentSchema from "./applicant-commitment-unsecuredLoan.model";
6
- import residenceCommitmentSchema from "./applicant-commitment-residence.model";
7
- import mongoose from "mongoose";
8
- const applicantCommitmentSchema = new mongoose.Schema({
9
- mortgageCommitments: [mortgageCommitmentSchema],
10
- creditCardCommitments: [creditCardCommitmentSchema],
11
- loanCommitments: [loanCommitmentSchema],
12
- securedLoanCommitments: [securedLoanCommitmentSchema],
13
- unsecuredLoanCommitments: [unsecuredLoanCommitmentSchema],
14
- residentialCommitments: [residenceCommitmentSchema]
15
- }, {
16
- toJSON: { getters: true },
17
- toObject: { getters: true }
18
- });
19
- export default applicantCommitmentSchema;