@dynamatix/gb-schemas 1.3.274 → 1.3.279
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-employment.model.js +44 -44
- package/dist/applicants/applicant-expenditure.model.js +66 -66
- package/dist/applicants/applicant.model.js +233 -233
- package/dist/applicants/index.js +19 -19
- package/dist/applications/application-company-model.js +122 -122
- package/dist/applications/application-direct-debit.model.js +93 -93
- package/dist/applications/application-mortgage.model.js +263 -263
- package/dist/applications/application-note.model.js +78 -78
- package/dist/applications/application-product.model.d.ts +12 -12
- package/dist/applications/application-product.model.js +74 -74
- package/dist/applications/application-productfeatures.model.d.ts +6 -6
- package/dist/applications/application-productfeatures.model.js +1 -1
- package/dist/applications/application-rationale.model.js +18 -18
- package/dist/applications/application.model.js +206 -206
- package/dist/applications/index.js +20 -20
- package/dist/applications/solicitor.model.js +115 -115
- package/dist/properties/property.model.js +150 -150
- package/dist/shared/index.js +11 -11
- package/package.json +1 -1
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
import { Pound, formatPound } from "../value-objects/pound";
|
|
3
|
-
const applicantEmploymentSchema = new mongoose.Schema({
|
|
4
|
-
applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
|
|
5
|
-
acceptableIncomeLids: [{ type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }],
|
|
6
|
-
addressCity: { type: String, default: null },
|
|
7
|
-
addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
8
|
-
addressLine1: { type: String, required: true },
|
|
9
|
-
addressLine2: { type: String, default: null },
|
|
10
|
-
addressLine3: { type: String, default: null },
|
|
11
|
-
addressPostCode: { type: String, required: true },
|
|
12
|
-
contractRemaining: { type: String },
|
|
13
|
-
dateJoined: { type: String, required: true },
|
|
14
|
-
disabilityLiving: { type: Pound, default: 0.00, get: formatPound },
|
|
15
|
-
employerName: { type: String, required: true },
|
|
16
|
-
employerTelephone: { type: String, default: null },
|
|
17
|
-
housingAllowance: { type: Pound, default: 0.00, get: formatPound },
|
|
18
|
-
industryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
19
|
-
isUnderTerminationNotice: { type: Boolean, default: false },
|
|
20
|
-
jobTitleLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
21
|
-
natureOfBusiness: { type: String, required: true },
|
|
22
|
-
pensionIncome: { type: Pound, default: 0.00, get: formatPound },
|
|
23
|
-
previousAddressCity: { type: String, default: null },
|
|
24
|
-
previousAddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
25
|
-
previousAddressLine1: { type: String, required: true },
|
|
26
|
-
previousAddressLine2: { type: String, default: null },
|
|
27
|
-
previousAddressLine3: { type: String, default: null },
|
|
28
|
-
previousAddressPostCode: { type: String, required: true },
|
|
29
|
-
previousBasicGrossIncome: { type: Pound, default: 0.00, required: true, get: formatPound },
|
|
30
|
-
previousDateJoined: { type: String, required: true },
|
|
31
|
-
previousDateLeft: { type: String, required: true },
|
|
32
|
-
previousEmployerName: { type: String, required: true },
|
|
33
|
-
previousEmployerTelephone: { type: String, default: null },
|
|
34
|
-
previousJobTitle: { type: String, required: true },
|
|
35
|
-
previousNatureOfBusiness: { type: String, required: true },
|
|
36
|
-
referenceContact: { type: String, default: null },
|
|
37
|
-
referenceContactEmail: { type: String, required: true },
|
|
38
|
-
underTerminationNoticeNote: { type: String, default: null }
|
|
39
|
-
}, {
|
|
40
|
-
toJSON: { getters: true },
|
|
41
|
-
toObject: { getters: true }
|
|
42
|
-
});
|
|
43
|
-
const ApplicantEmployment = mongoose.model("Applicant_Employment_Information", applicantEmploymentSchema);
|
|
44
|
-
export default ApplicantEmployment;
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { Pound, formatPound } from "../value-objects/pound";
|
|
3
|
+
const applicantEmploymentSchema = new mongoose.Schema({
|
|
4
|
+
applicantId: { type: mongoose.Schema.Types.ObjectId, ref: "Applicant", required: true },
|
|
5
|
+
acceptableIncomeLids: [{ type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }],
|
|
6
|
+
addressCity: { type: String, default: null },
|
|
7
|
+
addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
8
|
+
addressLine1: { type: String, required: true },
|
|
9
|
+
addressLine2: { type: String, default: null },
|
|
10
|
+
addressLine3: { type: String, default: null },
|
|
11
|
+
addressPostCode: { type: String, required: true },
|
|
12
|
+
contractRemaining: { type: String },
|
|
13
|
+
dateJoined: { type: String, required: true },
|
|
14
|
+
disabilityLiving: { type: Pound, default: 0.00, get: formatPound },
|
|
15
|
+
employerName: { type: String, required: true },
|
|
16
|
+
employerTelephone: { type: String, default: null },
|
|
17
|
+
housingAllowance: { type: Pound, default: 0.00, get: formatPound },
|
|
18
|
+
industryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
19
|
+
isUnderTerminationNotice: { type: Boolean, default: false },
|
|
20
|
+
jobTitleLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
21
|
+
natureOfBusiness: { type: String, required: true },
|
|
22
|
+
pensionIncome: { type: Pound, default: 0.00, get: formatPound },
|
|
23
|
+
previousAddressCity: { type: String, default: null },
|
|
24
|
+
previousAddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
|
|
25
|
+
previousAddressLine1: { type: String, required: true },
|
|
26
|
+
previousAddressLine2: { type: String, default: null },
|
|
27
|
+
previousAddressLine3: { type: String, default: null },
|
|
28
|
+
previousAddressPostCode: { type: String, required: true },
|
|
29
|
+
previousBasicGrossIncome: { type: Pound, default: 0.00, required: true, get: formatPound },
|
|
30
|
+
previousDateJoined: { type: String, required: true },
|
|
31
|
+
previousDateLeft: { type: String, required: true },
|
|
32
|
+
previousEmployerName: { type: String, required: true },
|
|
33
|
+
previousEmployerTelephone: { type: String, default: null },
|
|
34
|
+
previousJobTitle: { type: String, required: true },
|
|
35
|
+
previousNatureOfBusiness: { type: String, required: true },
|
|
36
|
+
referenceContact: { type: String, default: null },
|
|
37
|
+
referenceContactEmail: { type: String, required: true },
|
|
38
|
+
underTerminationNoticeNote: { type: String, default: null }
|
|
39
|
+
}, {
|
|
40
|
+
toJSON: { getters: true },
|
|
41
|
+
toObject: { getters: true }
|
|
42
|
+
});
|
|
43
|
+
const ApplicantEmployment = mongoose.model("Applicant_Employment_Information", applicantEmploymentSchema);
|
|
44
|
+
export default ApplicantEmployment;
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import mongoose from "mongoose";
|
|
2
|
-
import { Pound, formatPound } from "../value-objects/pound";
|
|
3
|
-
import { applyAuditMiddleware } from "@dynamatix/cat-shared/middlewares";
|
|
4
|
-
const applicantExpenditureSchema = new mongoose.Schema({
|
|
5
|
-
applicantId: {
|
|
6
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
7
|
-
ref: "Applicant",
|
|
8
|
-
required: true,
|
|
9
|
-
description: "Reference to the applicant this expenditure record belongs to.",
|
|
10
|
-
},
|
|
11
|
-
isFixed: {
|
|
12
|
-
type: Boolean,
|
|
13
|
-
default: false,
|
|
14
|
-
description: "True if all mandatory fields have been completed, otherwise false.",
|
|
15
|
-
},
|
|
16
|
-
expenditureTypeLid: {
|
|
17
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
18
|
-
ref: "Lookup",
|
|
19
|
-
default: null,
|
|
20
|
-
description: "Essential expenditure lookup",
|
|
21
|
-
},
|
|
22
|
-
sectionName: {
|
|
23
|
-
type: String,
|
|
24
|
-
enum: [
|
|
25
|
-
"essentialExpenditure",
|
|
26
|
-
"basicCostOfLivingExpenditure"
|
|
27
|
-
],
|
|
28
|
-
description: "Section of the application this expenditure belongs to.",
|
|
29
|
-
},
|
|
30
|
-
declared: {
|
|
31
|
-
type: Pound,
|
|
32
|
-
description: "Declared monthly expenditure amount provided by the applicant.",
|
|
33
|
-
get: formatPound
|
|
34
|
-
},
|
|
35
|
-
expected: {
|
|
36
|
-
type: String,
|
|
37
|
-
description: "Office for National Statistics (ONS) benchmark monthly expenditure.",
|
|
38
|
-
},
|
|
39
|
-
actual: {
|
|
40
|
-
type: Pound,
|
|
41
|
-
description: "Actual monthly expenditure verified based on applicant's evidence.",
|
|
42
|
-
get: formatPound
|
|
43
|
-
},
|
|
44
|
-
rationale: {
|
|
45
|
-
type: String,
|
|
46
|
-
description: "Rationalized monthly expenditure used for affordability assessment.",
|
|
47
|
-
}
|
|
48
|
-
}, {
|
|
49
|
-
timestamps: true,
|
|
50
|
-
toJSON: { virtuals: true },
|
|
51
|
-
toObject: { virtuals: true },
|
|
52
|
-
});
|
|
53
|
-
// Virtual property for essentialExpenditure
|
|
54
|
-
const virtualEssentialExpenditure = applicantExpenditureSchema.virtual("ExpenditureType", {
|
|
55
|
-
ref: "Lookup",
|
|
56
|
-
localField: "expenditureTypeLid",
|
|
57
|
-
foreignField: "_id",
|
|
58
|
-
justOne: true,
|
|
59
|
-
options: {
|
|
60
|
-
select: "label",
|
|
61
|
-
},
|
|
62
|
-
});
|
|
63
|
-
virtualEssentialExpenditure.description = "Populated lookup value for essential expenditure.";
|
|
64
|
-
applyAuditMiddleware(applicantExpenditureSchema, "Applicant_Expenditure");
|
|
65
|
-
const ApplicantExpenditureModel = mongoose.model("Applicant_Expenditure", applicantExpenditureSchema);
|
|
66
|
-
export default ApplicantExpenditureModel;
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { Pound, formatPound } from "../value-objects/pound";
|
|
3
|
+
import { applyAuditMiddleware } from "@dynamatix/cat-shared/middlewares";
|
|
4
|
+
const applicantExpenditureSchema = new mongoose.Schema({
|
|
5
|
+
applicantId: {
|
|
6
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
7
|
+
ref: "Applicant",
|
|
8
|
+
required: true,
|
|
9
|
+
description: "Reference to the applicant this expenditure record belongs to.",
|
|
10
|
+
},
|
|
11
|
+
isFixed: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
default: false,
|
|
14
|
+
description: "True if all mandatory fields have been completed, otherwise false.",
|
|
15
|
+
},
|
|
16
|
+
expenditureTypeLid: {
|
|
17
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
18
|
+
ref: "Lookup",
|
|
19
|
+
default: null,
|
|
20
|
+
description: "Essential expenditure lookup",
|
|
21
|
+
},
|
|
22
|
+
sectionName: {
|
|
23
|
+
type: String,
|
|
24
|
+
enum: [
|
|
25
|
+
"essentialExpenditure",
|
|
26
|
+
"basicCostOfLivingExpenditure"
|
|
27
|
+
],
|
|
28
|
+
description: "Section of the application this expenditure belongs to.",
|
|
29
|
+
},
|
|
30
|
+
declared: {
|
|
31
|
+
type: Pound,
|
|
32
|
+
description: "Declared monthly expenditure amount provided by the applicant.",
|
|
33
|
+
get: formatPound
|
|
34
|
+
},
|
|
35
|
+
expected: {
|
|
36
|
+
type: String,
|
|
37
|
+
description: "Office for National Statistics (ONS) benchmark monthly expenditure.",
|
|
38
|
+
},
|
|
39
|
+
actual: {
|
|
40
|
+
type: Pound,
|
|
41
|
+
description: "Actual monthly expenditure verified based on applicant's evidence.",
|
|
42
|
+
get: formatPound
|
|
43
|
+
},
|
|
44
|
+
rationale: {
|
|
45
|
+
type: String,
|
|
46
|
+
description: "Rationalized monthly expenditure used for affordability assessment.",
|
|
47
|
+
}
|
|
48
|
+
}, {
|
|
49
|
+
timestamps: true,
|
|
50
|
+
toJSON: { virtuals: true },
|
|
51
|
+
toObject: { virtuals: true },
|
|
52
|
+
});
|
|
53
|
+
// Virtual property for essentialExpenditure
|
|
54
|
+
const virtualEssentialExpenditure = applicantExpenditureSchema.virtual("ExpenditureType", {
|
|
55
|
+
ref: "Lookup",
|
|
56
|
+
localField: "expenditureTypeLid",
|
|
57
|
+
foreignField: "_id",
|
|
58
|
+
justOne: true,
|
|
59
|
+
options: {
|
|
60
|
+
select: "label",
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
virtualEssentialExpenditure.description = "Populated lookup value for essential expenditure.";
|
|
64
|
+
applyAuditMiddleware(applicantExpenditureSchema, "Applicant_Expenditure");
|
|
65
|
+
const ApplicantExpenditureModel = mongoose.model("Applicant_Expenditure", applicantExpenditureSchema);
|
|
66
|
+
export default ApplicantExpenditureModel;
|