@dynamatix/gb-schemas 1.2.77 → 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;
@@ -396,9 +396,11 @@ declare const MortgageCommitmentModel: mongoose.Model<{
396
396
  }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
397
397
  toJSON: {
398
398
  getters: true;
399
+ virtuals: true;
399
400
  };
400
401
  toObject: {
401
402
  getters: true;
403
+ virtuals: true;
402
404
  };
403
405
  }, {
404
406
  isSelected: boolean;
@@ -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;AA+D/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"}
@@ -42,8 +42,16 @@ const mortgageCommitmentSchema = new mongoose.Schema({
42
42
  remainingTermMonth: { type: Number },
43
43
  chargeTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" }
44
44
  }, {
45
- toJSON: { getters: true },
46
- 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' }
47
55
  });
48
56
  // virtual property 'lendingType'
49
57
  mortgageCommitmentSchema.virtual('lendingType').get(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.2.77",
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;