@dynamatix/gb-schemas 1.2.78 → 1.2.79

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.
@@ -26,65 +26,88 @@
26
26
  /// <reference types="mongoose/types/inferrawdoctype" />
27
27
  import mongoose from "mongoose";
28
28
  import { Pound } from "../value-objects/pound";
29
- declare const applicantExpenditureSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
29
+ declare const ApplicantExpenditureModel: mongoose.Model<{
30
+ createdAt: NativeDate;
31
+ updatedAt: NativeDate;
32
+ } & {
33
+ applicantId: mongoose.Types.ObjectId;
34
+ isFixed: boolean;
35
+ expenditureTypeLid: mongoose.Types.ObjectId;
36
+ declared?: Pound | null | undefined;
37
+ ons?: Pound | null | undefined;
38
+ actual?: Pound | null | undefined;
39
+ rationale?: string | null | undefined;
40
+ }, {}, {}, {}, mongoose.Document<unknown, {}, {
41
+ createdAt: NativeDate;
42
+ updatedAt: NativeDate;
43
+ } & {
44
+ applicantId: mongoose.Types.ObjectId;
45
+ isFixed: boolean;
46
+ expenditureTypeLid: mongoose.Types.ObjectId;
47
+ declared?: Pound | null | undefined;
48
+ ons?: Pound | null | undefined;
49
+ actual?: Pound | null | undefined;
50
+ rationale?: string | null | undefined;
51
+ }> & {
52
+ createdAt: NativeDate;
53
+ updatedAt: NativeDate;
54
+ } & {
55
+ applicantId: mongoose.Types.ObjectId;
56
+ isFixed: boolean;
57
+ expenditureTypeLid: mongoose.Types.ObjectId;
58
+ declared?: Pound | null | undefined;
59
+ ons?: Pound | null | undefined;
60
+ actual?: Pound | null | undefined;
61
+ rationale?: string | null | undefined;
62
+ } & {
63
+ _id: mongoose.Types.ObjectId;
64
+ } & {
65
+ __v: number;
66
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
67
+ timestamps: true;
30
68
  toJSON: {
31
- getters: true;
69
+ virtuals: true;
32
70
  };
33
71
  toObject: {
34
- getters: true;
72
+ virtuals: true;
35
73
  };
36
74
  }, {
37
- pageValidFlag: boolean;
38
- utilities: Pound;
39
- transport: Pound;
40
- subsistence: Pound;
41
- communication: Pound;
42
- health: Pound;
43
- groundRentOrServiceCharge: Pound;
44
- insurance: Pound;
45
- childCareForDependents: Pound;
46
- councilTax: Pound;
47
- clothingAndFootwear: Pound;
48
- vehicleInsurance: Pound;
49
- mortgagePaymentVehicle: Pound;
50
- other: Pound;
51
- totalMontlyExpenditure?: string | null | undefined;
75
+ createdAt: NativeDate;
76
+ updatedAt: NativeDate;
77
+ } & {
78
+ applicantId: mongoose.Types.ObjectId;
79
+ isFixed: boolean;
80
+ expenditureTypeLid: mongoose.Types.ObjectId;
81
+ declared?: Pound | null | undefined;
82
+ ons?: Pound | null | undefined;
83
+ actual?: Pound | null | undefined;
84
+ rationale?: string | null | undefined;
52
85
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
53
- pageValidFlag: boolean;
54
- utilities: Pound;
55
- transport: Pound;
56
- subsistence: Pound;
57
- communication: Pound;
58
- health: Pound;
59
- groundRentOrServiceCharge: Pound;
60
- insurance: Pound;
61
- childCareForDependents: Pound;
62
- councilTax: Pound;
63
- clothingAndFootwear: Pound;
64
- vehicleInsurance: Pound;
65
- mortgagePaymentVehicle: Pound;
66
- other: Pound;
67
- totalMontlyExpenditure?: string | null | undefined;
86
+ createdAt: NativeDate;
87
+ updatedAt: NativeDate;
88
+ } & {
89
+ applicantId: mongoose.Types.ObjectId;
90
+ isFixed: boolean;
91
+ expenditureTypeLid: mongoose.Types.ObjectId;
92
+ declared?: Pound | null | undefined;
93
+ ons?: Pound | null | undefined;
94
+ actual?: Pound | null | undefined;
95
+ rationale?: string | null | undefined;
68
96
  }>> & mongoose.FlatRecord<{
69
- pageValidFlag: boolean;
70
- utilities: Pound;
71
- transport: Pound;
72
- subsistence: Pound;
73
- communication: Pound;
74
- health: Pound;
75
- groundRentOrServiceCharge: Pound;
76
- insurance: Pound;
77
- childCareForDependents: Pound;
78
- councilTax: Pound;
79
- clothingAndFootwear: Pound;
80
- vehicleInsurance: Pound;
81
- mortgagePaymentVehicle: Pound;
82
- other: Pound;
83
- totalMontlyExpenditure?: string | null | undefined;
97
+ createdAt: NativeDate;
98
+ updatedAt: NativeDate;
99
+ } & {
100
+ applicantId: mongoose.Types.ObjectId;
101
+ isFixed: boolean;
102
+ expenditureTypeLid: mongoose.Types.ObjectId;
103
+ declared?: Pound | null | undefined;
104
+ ons?: Pound | null | undefined;
105
+ actual?: Pound | null | undefined;
106
+ rationale?: string | null | undefined;
84
107
  }> & {
85
108
  _id: mongoose.Types.ObjectId;
86
109
  } & {
87
110
  __v: number;
88
- }>;
89
- export default applicantExpenditureSchema;
111
+ }>>;
112
+ export default ApplicantExpenditureModel;
90
113
  //# sourceMappingURL=applicant-expenditure.model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"applicant-expenditure.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-expenditure.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB9B,CAAC;AAEH,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"applicant-expenditure.model.d.ts","sourceRoot":"","sources":["../../applicants/applicant-expenditure.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAoE/C,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAuE,CAAC;AACvG,eAAe,yBAAyB,CAAC"}
@@ -1,23 +1,54 @@
1
1
  import mongoose from "mongoose";
2
2
  import { Pound } from "../value-objects/pound";
3
3
  const applicantExpenditureSchema = new mongoose.Schema({
4
- pageValidFlag: { type: Boolean, default: false },
5
- utilities: { type: Pound, required: true },
6
- transport: { type: Pound, required: true },
7
- subsistence: { type: Pound, required: true },
8
- communication: { type: Pound, required: true },
9
- health: { type: Pound, required: true },
10
- groundRentOrServiceCharge: { type: Pound, required: true },
11
- insurance: { type: Pound, required: true },
12
- childCareForDependents: { type: Pound, required: true },
13
- councilTax: { type: Pound, required: true },
14
- clothingAndFootwear: { type: Pound, required: true },
15
- vehicleInsurance: { type: Pound, required: true },
16
- mortgagePaymentVehicle: { type: Pound, required: true },
17
- other: { type: Pound, required: true },
18
- totalMontlyExpenditure: { type: String, }
4
+ applicantId: {
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: "Applicant",
7
+ required: true,
8
+ description: "Reference to the applicant this expenditure record belongs to.",
9
+ },
10
+ isFixed: {
11
+ type: Boolean,
12
+ default: false,
13
+ description: "True if all mandatory fields have been completed, otherwise false.",
14
+ },
15
+ expenditureTypeLid: {
16
+ type: mongoose.Schema.Types.ObjectId,
17
+ ref: "Lookup",
18
+ default: null,
19
+ description: "Essential expenditure lookup",
20
+ },
21
+ declared: {
22
+ type: Pound,
23
+ description: "Declared monthly expenditure amount provided by the applicant.",
24
+ },
25
+ ons: {
26
+ type: Pound,
27
+ description: "Office for National Statistics (ONS) benchmark monthly expenditure.",
28
+ },
29
+ actual: {
30
+ type: Pound,
31
+ description: "Actual monthly expenditure verified based on applicant's evidence.",
32
+ },
33
+ rationale: {
34
+ type: String,
35
+ description: "Rationalized monthly expenditure used for affordability assessment.",
36
+ },
19
37
  }, {
20
- toJSON: { getters: true },
21
- toObject: { getters: true }
38
+ timestamps: true,
39
+ toJSON: { virtuals: true },
40
+ toObject: { virtuals: true },
22
41
  });
23
- export default applicantExpenditureSchema;
42
+ // Virtual property for essentialExpenditure
43
+ const virtualEssentialExpenditure = applicantExpenditureSchema.virtual("ExpenditureType", {
44
+ ref: "Lookup",
45
+ localField: "expenditureTypeLid",
46
+ foreignField: "_id",
47
+ justOne: true,
48
+ options: {
49
+ select: "label",
50
+ },
51
+ });
52
+ virtualEssentialExpenditure.description = "Populated lookup value for essential expenditure.";
53
+ const ApplicantExpenditureModel = mongoose.model("Applicant_Expenditure", applicantExpenditureSchema);
54
+ export default ApplicantExpenditureModel;
@@ -5,4 +5,5 @@ export { default as MortgageCommitmentModel } from './applicant-commitment-mortg
5
5
  export { default as ResidenceCommitmentModel } from './applicant-commitment-residence.model';
6
6
  export { default as SecuredLoanCommitmentModel } from './applicant-commitment-secureLoan.model';
7
7
  export { default as UnsecuredLoanCommitmentModel } from './applicant-commitment-unsecuredLoan.model';
8
+ export { default as ApplicantExpenditureModel } from './applicant-expenditure.model';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../applicants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,4CAA4C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../applicants/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAE9D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AAC/F,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAC3F,OAAO,EAAE,OAAO,IAAI,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAC7F,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAChG,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AACrG,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,+BAA+B,CAAC"}
@@ -5,3 +5,4 @@ export { default as MortgageCommitmentModel } from './applicant-commitment-mortg
5
5
  export { default as ResidenceCommitmentModel } from './applicant-commitment-residence.model';
6
6
  export { default as SecuredLoanCommitmentModel } from './applicant-commitment-secureLoan.model';
7
7
  export { default as UnsecuredLoanCommitmentModel } from './applicant-commitment-unsecuredLoan.model';
8
+ export { default as ApplicantExpenditureModel } from './applicant-expenditure.model';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/gb-schemas",
3
- "version": "1.2.78",
3
+ "version": "1.2.79",
4
4
  "description": "All the schemas for gatehouse bank back-end",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",