@dynamatix/gb-schemas 0.0.2
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/.github/workflows/npm-publish.yml +76 -0
- package/applicants/applicant-commitment.model.js +13 -0
- package/applicants/applicant-credit-data.model.js +13 -0
- package/applicants/applicant-credit-profile.model.js +22 -0
- package/applicants/applicant-direct-debit.model.js +19 -0
- package/applicants/applicant-employment.model.js +53 -0
- package/applicants/applicant-expenditure.model.js +12 -0
- package/applicants/applicant-income-source.model.js +11 -0
- package/applicants/applicant-income.model.js +53 -0
- package/applicants/applicant-other-income.model.js +25 -0
- package/applicants/applicant-risk-narrative.model.js +15 -0
- package/applicants/applicant.model.js +110 -0
- package/applications/application-audit.model.js +47 -0
- package/applications/application-checklist-Item.model.js +47 -0
- package/applications/application-company-model.js +29 -0
- package/applications/application-credit-profile.model.js +14 -0
- package/applications/application-illustration-model.js +8 -0
- package/applications/application-legal.model.js +8 -0
- package/applications/application-mortgage.model.js +31 -0
- package/applications/application-note.model.js +76 -0
- package/applications/application-offer.model.js +7 -0
- package/applications/application-onboarding.model.js +10 -0
- package/applications/application-product.model.js +11 -0
- package/applications/application-rational.model.js +20 -0
- package/applications/application-valuation.model.js +17 -0
- package/applications/application.model.js +69 -0
- package/applications/broker.model.js +25 -0
- package/applications/document.model.js +37 -0
- package/applications/productfeatures.model.js +100 -0
- package/applications/solicitor.model.js +35 -0
- package/package.json +23 -0
- package/properties/property.model.js +99 -0
- package/shared/lookup-group.model.js +17 -0
- package/shared/lookup.model.js +22 -0
- package/shared/system-parameter.model.js +34 -0
- package/users/role-group.model.js +16 -0
- package/users/role.model.js +14 -0
- package/users/user.model.js +32 -0
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
contents: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
version-bump:
|
|
16
|
+
name: Bump Version
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
outputs:
|
|
19
|
+
version: ${{ steps.get-version.outputs.version }}
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
# Checkout the repository
|
|
23
|
+
- name: Checkout code
|
|
24
|
+
uses: actions/checkout@v3
|
|
25
|
+
|
|
26
|
+
# Read and bump the version in package.json file
|
|
27
|
+
- name: Determine version
|
|
28
|
+
id: get-version
|
|
29
|
+
run: |
|
|
30
|
+
current_version=$(node -p "require('./package.json').version")
|
|
31
|
+
# Skip version bump for "docs" or "test" commits
|
|
32
|
+
if git log -1 --pretty=%B | grep -q -e "(docs):" -e "(test):"; then
|
|
33
|
+
echo "Skipping version bump for 'docs' or 'test' commit."
|
|
34
|
+
new_version=$current_version
|
|
35
|
+
else
|
|
36
|
+
major=$(echo "$current_version" | cut -d. -f1)
|
|
37
|
+
minor=$(echo "$current_version" | cut -d. -f2)
|
|
38
|
+
patch=$(echo "$current_version" | cut -d. -f3)
|
|
39
|
+
if git log -1 --pretty=%B | grep -q "(BREAKING CHANGE):"; then
|
|
40
|
+
new_version="$((major + 1)).0.0"
|
|
41
|
+
elif git log -1 --pretty=%B | grep -q "(feature):"; then
|
|
42
|
+
new_version="$major.$((minor + 1)).0"
|
|
43
|
+
elif git log -1 --pretty=%B | grep -q -e "(fix):" -e "(refactor):"; then
|
|
44
|
+
new_version="$major.$minor.$((patch + 1))"
|
|
45
|
+
else
|
|
46
|
+
echo "Error: Commit message does not match required patterns (docs:, test, feature:, fix:, refactor:)."
|
|
47
|
+
exit 1
|
|
48
|
+
fi
|
|
49
|
+
# Update package.json with the new version
|
|
50
|
+
jq --arg v "$new_version" '.version = $v' ./package.json > temp.json && mv temp.json ./package.json
|
|
51
|
+
# Commit the updated package.json
|
|
52
|
+
git config user.name "GitHub Actions"
|
|
53
|
+
git config user.email "actions@github.com"
|
|
54
|
+
git add ./package.json
|
|
55
|
+
git commit -m "Bump version to $new_version"
|
|
56
|
+
git push
|
|
57
|
+
fi
|
|
58
|
+
# Output the new or current version
|
|
59
|
+
echo "version=$new_version" >> $GITHUB_ENV
|
|
60
|
+
echo "::set-output name=version::$new_version"
|
|
61
|
+
|
|
62
|
+
build-and-publish:
|
|
63
|
+
runs-on: ubuntu-latest
|
|
64
|
+
needs: version-bump
|
|
65
|
+
steps:
|
|
66
|
+
- uses: actions/checkout@v4
|
|
67
|
+
- uses: actions/setup-node@v4
|
|
68
|
+
with:
|
|
69
|
+
node-version: 20
|
|
70
|
+
registry-url: https://registry.npmjs.org/
|
|
71
|
+
- run: npm i --f
|
|
72
|
+
- run: |
|
|
73
|
+
npm publish
|
|
74
|
+
env:
|
|
75
|
+
NODE_AUTH_TOKEN: ${{secrets.NPM_ACCESS_TOKEN}}
|
|
76
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
|
|
2
|
+
import mongoose from "mongoose";
|
|
3
|
+
|
|
4
|
+
const applicantCommitmentSchema = new mongoose.Schema({
|
|
5
|
+
commitmentId: String,
|
|
6
|
+
doHaveSharedResponsibility: Boolean,
|
|
7
|
+
lenderName: String,
|
|
8
|
+
monthlyPayment: String,
|
|
9
|
+
commitmentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export default applicantCommitmentSchema;
|
|
13
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const applicantCreditDataSchema = new mongoose.Schema({
|
|
4
|
+
bankruptcy: { type: String },
|
|
5
|
+
countyCourtJudgment: { type: String },
|
|
6
|
+
creditDefaults: { type: String },
|
|
7
|
+
securedArrears: { type: String },
|
|
8
|
+
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
9
|
+
unsecuredArrears: { type: String },
|
|
10
|
+
valid: { type: Boolean}
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default applicantCreditDataSchema;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const creditProfileSchema = new mongoose.Schema({
|
|
4
|
+
anyVoluntaryEnforcedPossessionNo: {
|
|
5
|
+
type: String,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
bankruptcyNo: {
|
|
9
|
+
type: String,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
ccjInLastThreeYearNo: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
defaultsInLastYearNo: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default creditProfileSchema;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
const applicantDirectDebitSchema = new mongoose.Schema({
|
|
4
|
+
accountNumber: { type: String },
|
|
5
|
+
addressLine1: { type: String },
|
|
6
|
+
addressLine2: { type: String },
|
|
7
|
+
Applicants: { type: String },
|
|
8
|
+
branch: { type: String },
|
|
9
|
+
city: { type: String },
|
|
10
|
+
contactPostcode: { type: String },
|
|
11
|
+
institution: { type: String },
|
|
12
|
+
isConfirmDeclaration: { type: Boolean, default: false },
|
|
13
|
+
nameOfAccountHolder: { type: String },
|
|
14
|
+
selectedPaymentDay: { type: Number },
|
|
15
|
+
sortCode: { type: String }
|
|
16
|
+
}, { timestamps: true });
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
export default applicantDirectDebitSchema;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const applicantEmploymentSchema = new mongoose.Schema({
|
|
4
|
+
acceptableIncome: { type: String },
|
|
5
|
+
addressCity: { type: String },
|
|
6
|
+
addressCountryLID: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
7
|
+
addressLine1: { type: String },
|
|
8
|
+
addressLine2: { type: String },
|
|
9
|
+
addressLine3: { type: String },
|
|
10
|
+
addressPostCode: { type: String },
|
|
11
|
+
|
|
12
|
+
averageBonusPreviousTwoYears: { type: String },
|
|
13
|
+
basicGrossIncome: { type: String },
|
|
14
|
+
basicPay: { type: String },
|
|
15
|
+
carAllowance: { type: String },
|
|
16
|
+
childBenefit: { type: String },
|
|
17
|
+
childBenefitOrSchoolAllowance: { type: String },
|
|
18
|
+
|
|
19
|
+
classLID: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
20
|
+
contractRemaining: { type: String },
|
|
21
|
+
dateJoined: { type: Date },
|
|
22
|
+
disabilityLiving: { type: String },
|
|
23
|
+
employerName: { type: String },
|
|
24
|
+
employerTelephone: { type: String },
|
|
25
|
+
housingAllowance: { type: String },
|
|
26
|
+
industryLID: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
27
|
+
isUnderTerminationNotice: { type: Boolean, default: null },
|
|
28
|
+
jobTitle: { type: String },
|
|
29
|
+
maintenance: { type: String },
|
|
30
|
+
maternityIncome: { type: String },
|
|
31
|
+
natureOfBusiness: { type: String },
|
|
32
|
+
pensionIncome: { type: String },
|
|
33
|
+
previousAddressCity: { type: String },
|
|
34
|
+
previousAddressCountry: { type: String },
|
|
35
|
+
previousAddressLine1: { type: String },
|
|
36
|
+
previousAddressLine2: { type: String },
|
|
37
|
+
previousAddressLine3: { type: String },
|
|
38
|
+
previousAddressPostCode: { type: String },
|
|
39
|
+
previousBasicGrossIncome: { type: String },
|
|
40
|
+
previousDateJoined: { type: Date },
|
|
41
|
+
previousDateLeft: { type: Date },
|
|
42
|
+
previousEmployerName: { type: String },
|
|
43
|
+
previousEmployerTelephone: { type: String },
|
|
44
|
+
previousJobTitle: { type: String },
|
|
45
|
+
previousNatureOfBusiness: { type: String },
|
|
46
|
+
referenceContact: { type: String },
|
|
47
|
+
referenceContactEmail: { type: String },
|
|
48
|
+
secondJob: { type: String },
|
|
49
|
+
travelAllowance: { type: String },
|
|
50
|
+
underTerminationNoticeNote: { type: String }
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export default applicantEmploymentSchema;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const applicantExpenditureSchema = new mongoose.Schema({
|
|
4
|
+
childCareForDependents: { type: Number },
|
|
5
|
+
insurance: { type: Number },
|
|
6
|
+
other: { type: Number },
|
|
7
|
+
totalMonthlyExpenditure: { type: Number },
|
|
8
|
+
transport: { type: Number },
|
|
9
|
+
utilities: { type: Number }
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export default applicantExpenditureSchema;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const applicantIncomeSourceSchema = new mongoose.Schema({
|
|
4
|
+
employmentStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
5
|
+
incomeFromEmployment: { type: Boolean },
|
|
6
|
+
incomeFromPension: { type: Boolean },
|
|
7
|
+
incomeFromProperty: { type: Boolean },
|
|
8
|
+
incomeFromSavings: { type: Boolean }
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default applicantIncomeSourceSchema;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const incomeSchema = new mongoose.Schema({
|
|
4
|
+
accountantsAddressLine1: { type: String, default: '' },
|
|
5
|
+
accountantsAddressLine2: { type: String, default: '' },
|
|
6
|
+
accountantsAddressLine3: { type: String, default: '' },
|
|
7
|
+
accountantsCity: { type: String, default: '' },
|
|
8
|
+
accountantsCountry: { type: String, default: 'GBR' },
|
|
9
|
+
accountantsEmail: { type: String, default: '' },
|
|
10
|
+
accountantsPostCode: { type: String, default: '' },
|
|
11
|
+
accountantsPractice: { type: String, default: '' },
|
|
12
|
+
accountantsTelephoneNumber: { type: String, default: '' },
|
|
13
|
+
businessAddressLine1: { type: String, default: '' },
|
|
14
|
+
businessAddressLine2: { type: String, default: '' },
|
|
15
|
+
businessAddressLine3: { type: String, default: '' },
|
|
16
|
+
businessCity: { type: String, default: '' },
|
|
17
|
+
businessCountry: { type: String, default: 'GBR' },
|
|
18
|
+
businessPostCode: { type: String, default: '' },
|
|
19
|
+
businessTelephoneNumber: { type: String, default: '' },
|
|
20
|
+
businessType: { type: String, default: '4' },
|
|
21
|
+
charteredCertifiedOrOther: { type: String, default: '' },
|
|
22
|
+
contactName: { type: String, default: '' },
|
|
23
|
+
currentYearEnd: { type: Date, default: null },
|
|
24
|
+
dateEstablished: { type: Date, default: null },
|
|
25
|
+
doYouHaveAccountant: { type: Boolean, default: false },
|
|
26
|
+
isBusinessAddressDifferent: { type: Boolean, default: false },
|
|
27
|
+
nameOfBusiness: { type: String, default: '' },
|
|
28
|
+
natureOfBusiness: { type: String, default: '' },
|
|
29
|
+
netAssets1: { type: Number, default: 0.0 },
|
|
30
|
+
netAssets2: { type: Number, default: 0.0 },
|
|
31
|
+
netAssets3: { type: Number, default: 0.0 },
|
|
32
|
+
pageValidFlag: { type: Boolean, default: true },
|
|
33
|
+
percentageOfShareholding: { type: Number, default: 100 },
|
|
34
|
+
registeredAddressLine1: { type: String, default: '' },
|
|
35
|
+
registeredAddressLine2: { type: String, default: '' },
|
|
36
|
+
registeredAddressLine3: { type: String, default: '' },
|
|
37
|
+
registeredCity: { type: String, default: '' },
|
|
38
|
+
registeredCountry: { type: String, default: 'GBR' },
|
|
39
|
+
registeredPostCode: { type: String, default: '' },
|
|
40
|
+
registeredTelephone: { type: String, default: '' },
|
|
41
|
+
selfEmployedDate: { type: Date, default: null },
|
|
42
|
+
turnover1: { type: Number, default: 0.0 },
|
|
43
|
+
turnover2: { type: Number, default: 0.0 },
|
|
44
|
+
turnover3: { type: Number, default: 0.0 },
|
|
45
|
+
year1: { type: Number, default: 0.0 },
|
|
46
|
+
year2: { type: Number, default: 0.0 },
|
|
47
|
+
year3: { type: Number, default: 0.0 },
|
|
48
|
+
yearEnd1: { type: String, default: '' },
|
|
49
|
+
yearEnd2: { type: String, default: '' },
|
|
50
|
+
yearEnd3: { type: String, default: '' }
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export default incomeSchema;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const applicantOtherIncomeSchema = new mongoose.Schema({
|
|
4
|
+
amount1: { type: Number },
|
|
5
|
+
amount2: { type: Number },
|
|
6
|
+
amount3: { type: Number },
|
|
7
|
+
amount4: { type: Number },
|
|
8
|
+
guaranteed1: { type: Boolean },
|
|
9
|
+
guaranteed2: { type: Boolean },
|
|
10
|
+
guaranteed3: { type: Boolean },
|
|
11
|
+
guaranteed4: { type: Boolean },
|
|
12
|
+
maintenance: { type: String },
|
|
13
|
+
otherBenefits: { type: String },
|
|
14
|
+
payFrequency1: { type: String },
|
|
15
|
+
payFrequency2: { type: String },
|
|
16
|
+
payFrequency3: { type: String },
|
|
17
|
+
payFrequency4: { type: String },
|
|
18
|
+
sourceDetails1: { type: String },
|
|
19
|
+
sourceDetails2: { type: String },
|
|
20
|
+
sourceDetails3: { type: String },
|
|
21
|
+
sourceDetails4: { type: String },
|
|
22
|
+
taxCredits: { type: String }
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export default applicantOtherIncomeSchema;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
const applicantRiskNarrativeSchema = new mongoose.Schema({
|
|
4
|
+
call2StatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
5
|
+
clientReference: { type: String },
|
|
6
|
+
docVerificationStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
7
|
+
isPoaTaskGenerated: { type: Boolean },
|
|
8
|
+
link: { type: String },
|
|
9
|
+
riskLevel: { type: String },
|
|
10
|
+
riskRating: { type: String },
|
|
11
|
+
statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
12
|
+
verificationLinkSentOn: { type: String }
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default applicantRiskNarrativeSchema;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import applicantCreditDataSchema from "./applicant-credit-data.model.js";
|
|
3
|
+
import applicantRiskNarrativeSchema from "./applicant-risk-narrative.model.js";
|
|
4
|
+
import applicantOtherIncomeSchema from "./applicant-other-income.model.js";
|
|
5
|
+
import applicantIncomeSourceSchema from "./applicant-income-source.model.js";
|
|
6
|
+
import applicantExpenditureSchema from "./applicant-expenditure.model.js";
|
|
7
|
+
import applicantEmploymentSchema from "./applicant-employment.model.js";
|
|
8
|
+
import applicantCommitmentSchema from "./applicant-commitment.model.js";
|
|
9
|
+
import applicantDirectDebitSchema from "./applicant-direct-debit.model.js";
|
|
10
|
+
import creditProfileSchema from "./applicant-credit-profile.model.js";
|
|
11
|
+
import incomeSchema from "./applicant-income.model.js";
|
|
12
|
+
|
|
13
|
+
const applicantSchema = new mongoose.Schema({
|
|
14
|
+
addressCity: { type: String, default: null },
|
|
15
|
+
addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
16
|
+
addressLine1: { type: String, default: null },
|
|
17
|
+
addressLine2: { type: String, default: null },
|
|
18
|
+
addressLine3: { type: String, default: null },
|
|
19
|
+
addressMovedDate: { type: Date, default: null },
|
|
20
|
+
addressPostCode: { type: String, default: null },
|
|
21
|
+
correspondenceAddressCity: { type: String, default: null },
|
|
22
|
+
correspondenceAddressCountry: { type: String, default: null },
|
|
23
|
+
correspondenceAddressLine1: { type: String, default: null },
|
|
24
|
+
correspondenceAddressLine2: { type: String, default: null },
|
|
25
|
+
correspondenceAddressLine3: { type: String, default: null },
|
|
26
|
+
correspondenceAddressPostCode: { type: String, default: null },
|
|
27
|
+
countryOfResidenceLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
28
|
+
dateOfBirth: { type: Date, default: null },
|
|
29
|
+
dependant10Age: { type: Number, default: 0 },
|
|
30
|
+
dependant1Age: { type: Number, default: 0 },
|
|
31
|
+
dependant2Age: { type: Number, default: 0 },
|
|
32
|
+
dependant3Age: { type: Number, default: 0 },
|
|
33
|
+
dependant4Age: { type: Number, default: 0 },
|
|
34
|
+
dependant5Age: { type: Number, default: 0 },
|
|
35
|
+
dependant6Age: { type: Number, default: 0 },
|
|
36
|
+
dependant7Age: { type: Number, default: 0 },
|
|
37
|
+
dependant8Age: { type: Number, default: 0 },
|
|
38
|
+
dependant9Age: { type: Number, default: 0 },
|
|
39
|
+
email: { type: String, default: null },
|
|
40
|
+
employmentStatusDetails: { type: String, default: null },
|
|
41
|
+
firstName: { type: String, default: null },
|
|
42
|
+
isFirstTimelandlord: { type: Boolean, default: false },
|
|
43
|
+
foreignNationalsId: { type: String, default: null },
|
|
44
|
+
gdprEmail: { type: Boolean, default: false },
|
|
45
|
+
gdprPost: { type: Boolean, default: false },
|
|
46
|
+
gdprTelephone: { type: Boolean, default: false },
|
|
47
|
+
gdprTextMessage: { type: Boolean, default: false },
|
|
48
|
+
gender: { type: String, default: null },
|
|
49
|
+
hasBrokerGivenConsentForVulnerabilities: { type: String, default: null },
|
|
50
|
+
hasLinkedJurisdiction: { type: Boolean, default: false },
|
|
51
|
+
isCorrespondence: { type: Boolean, default: true },
|
|
52
|
+
isCurrentContract: { type: Boolean, default: false },
|
|
53
|
+
isCustomerVulnerable: { type: Boolean, default: false },
|
|
54
|
+
isExpat: { type: Boolean, default: false },
|
|
55
|
+
isFirstApplicant: { type: Boolean, default: false },
|
|
56
|
+
isUkPassport: { type: Boolean, default: false },
|
|
57
|
+
isUkResident: { type: Boolean, default: true },
|
|
58
|
+
lastName: { type: String, default: null },
|
|
59
|
+
linkedJurisdictionCountry: { type: String, default: null },
|
|
60
|
+
linkedJurisdictionDetails: { type: String, default: null },
|
|
61
|
+
maidenName: { type: String, default: null },
|
|
62
|
+
maritalStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
63
|
+
mobileNumber: { type: String, default: null },
|
|
64
|
+
nationalityLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
65
|
+
netIncome: { type: String },
|
|
66
|
+
niNumber: { type: String, default: null },
|
|
67
|
+
numberOfDependants: { type: Number, default: 0 },
|
|
68
|
+
isOneYearPrior: { type: Boolean, default: false },
|
|
69
|
+
phoneNumber: { type: String, default: null },
|
|
70
|
+
previous1AddressCity: { type: String, default: null },
|
|
71
|
+
previous1AddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
72
|
+
previous1AddressLine1: { type: String, default: null },
|
|
73
|
+
previous1AddressLine2: { type: String, default: null },
|
|
74
|
+
previous1AddressLine3: { type: String, default: null },
|
|
75
|
+
previous1AddressMovedDate: { type: Date, default: null },
|
|
76
|
+
previous1AddressPostCode: { type: String, default: null },
|
|
77
|
+
previous1AddressPropertyOwnedBy: { type: String, default: null },
|
|
78
|
+
previous2AddressCity: { type: String, default: null },
|
|
79
|
+
previous2AddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
80
|
+
previous2AddressLine1: { type: String, default: null },
|
|
81
|
+
previous2AddressLine2: { type: String, default: null },
|
|
82
|
+
previous2AddressLine3: { type: String, default: null },
|
|
83
|
+
previous2AddressMovedDate: { type: Date, default: null },
|
|
84
|
+
previous2AddressPostCode: { type: String, default: null },
|
|
85
|
+
previous2AddressPropertyOwnedBy: { type: String, default: null },
|
|
86
|
+
relationshipToOthersLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
87
|
+
residentialStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
88
|
+
retirementAge: { type: Number, default: 0 },
|
|
89
|
+
taxJurisdiction: { type: String, default: null },
|
|
90
|
+
taxPayerLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
91
|
+
timeResidedAtCountryOfResidence: { type: String, default: null },
|
|
92
|
+
title: { type: String, default: null },
|
|
93
|
+
isTwoYearPrior: { type: Boolean, default: false },
|
|
94
|
+
understandEnglish: { type: Boolean, default: true },
|
|
95
|
+
vulnerabilityNotes: { type: String, default: null },
|
|
96
|
+
VulnerabilityTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
97
|
+
creditData: applicantCreditDataSchema,
|
|
98
|
+
riskNarrative: applicantRiskNarrativeSchema,
|
|
99
|
+
otherIncome: applicantOtherIncomeSchema,
|
|
100
|
+
incomeSource: applicantIncomeSourceSchema,
|
|
101
|
+
expenditure: applicantExpenditureSchema,
|
|
102
|
+
employment: applicantEmploymentSchema,
|
|
103
|
+
commitments:[applicantCommitmentSchema],
|
|
104
|
+
directDebit: applicantDirectDebitSchema,
|
|
105
|
+
creditProfile: creditProfileSchema,
|
|
106
|
+
income: incomeSchema
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
const ApplicantModel = mongoose.model("Applicant", applicantSchema);
|
|
110
|
+
export default ApplicantModel;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const applicationAuditSchema = new mongoose.Schema({
|
|
4
|
+
auditId: {
|
|
5
|
+
type: Number,
|
|
6
|
+
required: true
|
|
7
|
+
},
|
|
8
|
+
accountId: {
|
|
9
|
+
type: Number,
|
|
10
|
+
required: true
|
|
11
|
+
},
|
|
12
|
+
auditCorrelationId: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true
|
|
15
|
+
},
|
|
16
|
+
auditDate: {
|
|
17
|
+
type: Date,
|
|
18
|
+
required: true
|
|
19
|
+
},
|
|
20
|
+
changeType: {
|
|
21
|
+
type: Number,
|
|
22
|
+
required: true
|
|
23
|
+
},
|
|
24
|
+
formEntityId: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: false
|
|
27
|
+
},
|
|
28
|
+
formEntityDescription: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: false
|
|
31
|
+
},
|
|
32
|
+
name: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true
|
|
35
|
+
},
|
|
36
|
+
oldValue: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
newValue: {
|
|
41
|
+
type: String,
|
|
42
|
+
required: true
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const ApplicationAuditModel = mongoose.model('ApplicationAudit', applicationAuditSchema);
|
|
47
|
+
export default ApplicationAuditModel;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const checkListItemSchema = new mongoose.Schema({
|
|
4
|
+
additionalOfferConditions: { type: String, default: "" },
|
|
5
|
+
appFormSignedNotes: { type: String, default: "" },
|
|
6
|
+
applicationCompletionDate: { type: Date },
|
|
7
|
+
buildingInsuranceInsurerName: { type: String, default: "" },
|
|
8
|
+
buildingInsurancePolicyNumber: { type: String, default: "" },
|
|
9
|
+
buildingInsuranceReceived: { type: String, default: "" },
|
|
10
|
+
buildingInsuranceRenewalDate: { type: Date },
|
|
11
|
+
dateOfValuationReceived: { type: Date },
|
|
12
|
+
feePaidDocumentsDownloaded: { type: String, default: "" },
|
|
13
|
+
feePaidNotes: { type: String, default: "" },
|
|
14
|
+
fundsNotes: { type: String, default: "" },
|
|
15
|
+
fundsReleasedDate: { type: Date },
|
|
16
|
+
hasAllDocsReviewedAndAccepted: { type: String, default: "" },
|
|
17
|
+
idnPorReceived: { type: String, default: "" },
|
|
18
|
+
legalCompletionDate: { type: Date },
|
|
19
|
+
legalDocsReceived: { type: String, default: "" },
|
|
20
|
+
legalNotes: { type: String, default: "" },
|
|
21
|
+
ninetyDaysValuationAmount: { type: String, default: "" },
|
|
22
|
+
offerConditionsItems: { type: String, default: "" },
|
|
23
|
+
offerConditionsMet: { type: String, default: "" },
|
|
24
|
+
offerNotes: { type: String, default: "" },
|
|
25
|
+
offerOfferPrepared: { type: String, default: "" },
|
|
26
|
+
offerOfferReviewed: { type: String, default: "" },
|
|
27
|
+
offerSignedNotes: { type: String, default: "" },
|
|
28
|
+
offerSolicitorInstructedDate: { type: Date },
|
|
29
|
+
packagingNotes: { type: String, default: "" },
|
|
30
|
+
preOfferNotes: { type: String, default: "" },
|
|
31
|
+
reinstatementAmount: { type: String, default: "" },
|
|
32
|
+
rotReceived: { type: String, default: "" },
|
|
33
|
+
rotReceivedDate: { type: Date },
|
|
34
|
+
salesContractReceived: { type: String, default: "" },
|
|
35
|
+
underwritingNotes: { type: String, default: "" },
|
|
36
|
+
underwritingValuationNotes: { type: String, default: "" },
|
|
37
|
+
valuationAccepted: { type: Date },
|
|
38
|
+
valuationFurtherConditions: { type: String, default: "" },
|
|
39
|
+
valuationNotes: { type: String, default: "" },
|
|
40
|
+
valuationReceived: { type: Date },
|
|
41
|
+
valuationRequestedDate: { type: Date },
|
|
42
|
+
valuationScheduledDate: { type: Date },
|
|
43
|
+
valuationSurveyorDetails: { type: String, default: "" }
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
const CheckListModel = mongoose.model("CheckList", checkListItemSchema);
|
|
47
|
+
export default CheckListModel;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const companySchema = new mongoose.Schema({
|
|
4
|
+
addressCity: { type: String, default: "" },
|
|
5
|
+
addressCountry: { type: String, default: "" },
|
|
6
|
+
addressLine1: { type: String, default: "" },
|
|
7
|
+
addressLine2: { type: String, default: "" },
|
|
8
|
+
addressLine3: { type: String, default: "" },
|
|
9
|
+
addressPostCode: { type: String, default: "" },
|
|
10
|
+
businessType: { type: String, default: "" },
|
|
11
|
+
doYouKnowRegisteredNumber: { type: Boolean, default: false }, // e.g., true or false
|
|
12
|
+
natureOfBusiness: { type: String, default: "" },
|
|
13
|
+
netProfitYear1: { type: Number }, // e.g., 50000
|
|
14
|
+
netProfitYear2: { type: Number }, // e.g., 75000
|
|
15
|
+
netProfitYear3: { type: Number }, // e.g., 100000
|
|
16
|
+
registeredName: { type: String, default: "" },
|
|
17
|
+
registeredNumber: { type: String, default: "" },
|
|
18
|
+
taxJurisdiction: { type: String, default: "" },
|
|
19
|
+
tradingSince: { type: Date }, // e.g., "2020-01-01"
|
|
20
|
+
turnoverYear1: { type: Number }, // e.g., 100000
|
|
21
|
+
turnoverYear2: { type: Number }, // e.g., 150000
|
|
22
|
+
turnoverYear3: { type: Number }, // e.g., 200000
|
|
23
|
+
yearEnd: { type: Date }, // e.g., "2023-12-31"
|
|
24
|
+
yearEnd1: { type: Number }, // e.g., 2021
|
|
25
|
+
yearEnd2: { type: Number }, // e.g., 2022
|
|
26
|
+
yearEnd3: { type: Number } // e.g., 2023
|
|
27
|
+
});
|
|
28
|
+
const CompanyModel = mongoose.model("Company", companySchema);
|
|
29
|
+
export default CompanyModel;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const creditProfileSchema = new mongoose.Schema({
|
|
4
|
+
companyAnyVoluntaryEnforcedPossessionNo: { type: Boolean, default: false },
|
|
5
|
+
companyAnyVoluntaryEnforcedPossessionYes: { type: String, default: "" },
|
|
6
|
+
companyBankruptcyNo: { type: Boolean, default: false },
|
|
7
|
+
companyBankruptcyYes: { type: String, default: "" },
|
|
8
|
+
companyCCJInLastThreeYearNo: { type: Boolean, default: false },
|
|
9
|
+
companyCCJInLastThreeYearYes: { type: String, default: "" },
|
|
10
|
+
companyDefaultsInLastYearNo: { type: Boolean, default: false },
|
|
11
|
+
companyDefaultsInLastYearYes: { type: String, default: "" }
|
|
12
|
+
});
|
|
13
|
+
const CreditProfileModel = mongoose.model("CreditProfile", creditProfileSchema);
|
|
14
|
+
export default CreditProfileModel;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const illustrationSchema = new mongoose.Schema({
|
|
4
|
+
date: { type: Date } // e.g., the date of illustration
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
const IllustrationModel = mongoose.model("Illustration", illustrationSchema);
|
|
8
|
+
export default IllustrationModel;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const legalSchema = new mongoose.Schema({
|
|
4
|
+
assignedSolicitor: { type: String, default: "" },
|
|
5
|
+
solicitorsReference: { type: String, default: "" }
|
|
6
|
+
});
|
|
7
|
+
const LegalModel = mongoose.model("Legal", legalSchema);
|
|
8
|
+
export default LegalModel;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
|
|
3
|
+
const mortgageSchema = new mongoose.Schema({
|
|
4
|
+
depositComeFrom: { type: String, required: true },
|
|
5
|
+
estimatedValue: { type: String, default: "" },
|
|
6
|
+
exitStrategy: { type: String, required: true },
|
|
7
|
+
fundRaisedFor: { type: String, default: "" },
|
|
8
|
+
giftDetails: { type: String, default: "" },
|
|
9
|
+
ifOtherDetails: { type: String, default: "" },
|
|
10
|
+
isDistressedSale: { type: Boolean, default: false },
|
|
11
|
+
isGovernmentInitiative: { type: Boolean, default: false },
|
|
12
|
+
isPurchasedAsSale: { type: Boolean, default: false },
|
|
13
|
+
isPurchasedBelowMarketValue: { type: Boolean, default: false },
|
|
14
|
+
isReadyToSell: { type: Boolean, default: true },
|
|
15
|
+
isTheIntentionToLet: { type: Boolean, default: true },
|
|
16
|
+
leaseTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
17
|
+
loanRequired: { type: Number, required: true },
|
|
18
|
+
monthlyRentalIncome: { type: Number, required: true },
|
|
19
|
+
propertyValuationDetails: { type: String, default: "" },
|
|
20
|
+
proposedTenants: { type: String },
|
|
21
|
+
purchasePrice: { type: Number, required: true },
|
|
22
|
+
repaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
23
|
+
repaymentVehicle: { type: String, default: "" },
|
|
24
|
+
saleMade: { type: String, default: "" },
|
|
25
|
+
sourceOfFundDetails: { type: String, default: "" },
|
|
26
|
+
sourceOfFundsLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
|
|
27
|
+
telephoneNumber: { type: String, required: true },
|
|
28
|
+
vendorsName: { type: String, default: "" }
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default mortgageSchema;
|