@dynamatix/gb-schemas 2.0.24 → 2.0.26

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.
Files changed (212) hide show
  1. package/dist/applicants/applicant-additional-income.model.d.ts +47 -927
  2. package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -1
  3. package/dist/applicants/applicant-additional-income.model.js +3 -23
  4. package/dist/applicants/applicant-commitment-creditCard.model.d.ts +32 -0
  5. package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -1
  6. package/dist/applicants/applicant-commitment-creditCard.model.js +1 -0
  7. package/dist/applicants/applicant-commitment-loan.model.d.ts +32 -0
  8. package/dist/applicants/applicant-commitment-loan.model.d.ts.map +1 -1
  9. package/dist/applicants/applicant-commitment-loan.model.js +1 -0
  10. package/dist/applicants/applicant-commitment-mortgage.model.d.ts +32 -0
  11. package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -1
  12. package/dist/applicants/applicant-commitment-mortgage.model.js +1 -0
  13. package/dist/applicants/applicant-commitment-residence.model.d.ts +26 -0
  14. package/dist/applicants/applicant-commitment-residence.model.d.ts.map +1 -1
  15. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts +26 -0
  16. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts.map +1 -1
  17. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts +26 -0
  18. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts.map +1 -1
  19. package/dist/applicants/applicant-credit-data.model.d.ts +27 -0
  20. package/dist/applicants/applicant-credit-data.model.d.ts.map +1 -1
  21. package/dist/applicants/applicant-credit-profile.model.d.ts +27 -0
  22. package/dist/applicants/applicant-credit-profile.model.d.ts.map +1 -1
  23. package/dist/applicants/applicant-direct-debit.model.d.ts +27 -0
  24. package/dist/applicants/applicant-direct-debit.model.d.ts.map +1 -1
  25. package/dist/applicants/applicant-employment-income.model.d.ts +26 -0
  26. package/dist/applicants/applicant-employment-income.model.d.ts.map +1 -1
  27. package/dist/applicants/applicant-employment.model.d.ts +26 -0
  28. package/dist/applicants/applicant-employment.model.d.ts.map +1 -1
  29. package/dist/applicants/applicant-expenditure.model.d.ts +26 -0
  30. package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -1
  31. package/dist/applicants/applicant-income-source.model.d.ts +27 -0
  32. package/dist/applicants/applicant-income-source.model.d.ts.map +1 -1
  33. package/dist/applicants/applicant-income.model.d.ts +26 -12
  34. package/dist/applicants/applicant-income.model.d.ts.map +1 -1
  35. package/dist/applicants/applicant-pension-income.model.d.ts +314 -0
  36. package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -1
  37. package/dist/applicants/applicant-pension-income.model.js +13 -0
  38. package/dist/applicants/applicant-property-income.model.d.ts +26 -0
  39. package/dist/applicants/applicant-property-income.model.d.ts.map +1 -1
  40. package/dist/applicants/applicant-risk-narrative.model.d.ts +27 -0
  41. package/dist/applicants/applicant-risk-narrative.model.d.ts.map +1 -1
  42. package/dist/applicants/applicant-uk-tax-credits.model.d.ts +314 -0
  43. package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -1
  44. package/dist/applicants/applicant-uk-tax-credits.model.js +2 -0
  45. package/dist/applicants/applicant.model.d.ts +27 -0
  46. package/dist/applicants/applicant.model.d.ts.map +1 -1
  47. package/dist/applications/application-audit.model.d.ts +27 -0
  48. package/dist/applications/application-audit.model.d.ts.map +1 -1
  49. package/dist/applications/application-checklist-Item.model.d.ts +27 -0
  50. package/dist/applications/application-checklist-Item.model.d.ts.map +1 -1
  51. package/dist/applications/application-company-model.d.ts +26 -0
  52. package/dist/applications/application-company-model.d.ts.map +1 -1
  53. package/dist/applications/application-credit-profile.model.d.ts +27 -0
  54. package/dist/applications/application-credit-profile.model.d.ts.map +1 -1
  55. package/dist/applications/application-direct-debit.model.d.ts +26 -0
  56. package/dist/applications/application-direct-debit.model.d.ts.map +1 -1
  57. package/dist/applications/application-document.model.d.ts +27 -0
  58. package/dist/applications/application-document.model.d.ts.map +1 -1
  59. package/dist/applications/application-fieldconfig.model.d.ts +27 -0
  60. package/dist/applications/application-fieldconfig.model.d.ts.map +1 -1
  61. package/dist/applications/application-illustration-model.d.ts +27 -0
  62. package/dist/applications/application-illustration-model.d.ts.map +1 -1
  63. package/dist/applications/application-legal.model.d.ts +27 -0
  64. package/dist/applications/application-legal.model.d.ts.map +1 -1
  65. package/dist/applications/application-mortgage.model.d.ts +26 -0
  66. package/dist/applications/application-mortgage.model.d.ts.map +1 -1
  67. package/dist/applications/application-note.model.d.ts +27 -0
  68. package/dist/applications/application-note.model.d.ts.map +1 -1
  69. package/dist/applications/application-offer.model.d.ts +27 -0
  70. package/dist/applications/application-offer.model.d.ts.map +1 -1
  71. package/dist/applications/application-onboarding.model.d.ts +27 -0
  72. package/dist/applications/application-onboarding.model.d.ts.map +1 -1
  73. package/dist/applications/application-product.model.d.ts +27 -0
  74. package/dist/applications/application-product.model.d.ts.map +1 -1
  75. package/dist/applications/application-productfeatures.model.d.ts +27 -0
  76. package/dist/applications/application-productfeatures.model.d.ts.map +1 -1
  77. package/dist/applications/application-rationale.model.d.ts +27 -0
  78. package/dist/applications/application-rationale.model.d.ts.map +1 -1
  79. package/dist/applications/application-risk-narrative.model.d.ts +27 -0
  80. package/dist/applications/application-risk-narrative.model.d.ts.map +1 -1
  81. package/dist/applications/application-valuation.model.d.ts +27 -0
  82. package/dist/applications/application-valuation.model.d.ts.map +1 -1
  83. package/dist/applications/application.model.d.ts +27 -0
  84. package/dist/applications/application.model.d.ts.map +1 -1
  85. package/dist/applications/broker.model.d.ts +27 -0
  86. package/dist/applications/broker.model.d.ts.map +1 -1
  87. package/dist/applications/document.model.d.ts +27 -0
  88. package/dist/applications/document.model.d.ts.map +1 -1
  89. package/dist/applications/solicitor.model.d.ts +26 -0
  90. package/dist/applications/solicitor.model.d.ts.map +1 -1
  91. package/dist/index.d.ts +0 -1
  92. package/dist/index.d.ts.map +1 -1
  93. package/dist/product-catalogues/product-catalogue.model.d.ts +27 -0
  94. package/dist/product-catalogues/product-catalogue.model.d.ts.map +1 -1
  95. package/dist/product-catalogues/product-definitions.model.d.ts +27 -0
  96. package/dist/product-catalogues/product-definitions.model.d.ts.map +1 -1
  97. package/dist/product-catalogues/product-variant.model.d.ts +27 -0
  98. package/dist/product-catalogues/product-variant.model.d.ts.map +1 -1
  99. package/dist/properties/property.model.d.ts +26 -0
  100. package/dist/properties/property.model.d.ts.map +1 -1
  101. package/dist/properties/security.model.d.ts +27 -0
  102. package/dist/properties/security.model.d.ts.map +1 -1
  103. package/dist/shared/alert.model.d.ts +27 -0
  104. package/dist/shared/alert.model.d.ts.map +1 -1
  105. package/dist/shared/apprivo-sync-journey.model.d.ts +27 -0
  106. package/dist/shared/apprivo-sync-journey.model.d.ts.map +1 -1
  107. package/dist/shared/checklist.model.d.ts +27 -0
  108. package/dist/shared/checklist.model.d.ts.map +1 -1
  109. package/dist/shared/document-type-model.d.ts +27 -0
  110. package/dist/shared/document-type-model.d.ts.map +1 -1
  111. package/dist/shared/job-run.model.d.ts +27 -0
  112. package/dist/shared/job-run.model.d.ts.map +1 -1
  113. package/dist/shared/job-setting.model.d.ts +27 -0
  114. package/dist/shared/job-setting.model.d.ts.map +1 -1
  115. package/dist/shared/lookup-group.model.d.ts +27 -0
  116. package/dist/shared/lookup-group.model.d.ts.map +1 -1
  117. package/dist/shared/lookup.model.d.ts +27 -0
  118. package/dist/shared/lookup.model.d.ts.map +1 -1
  119. package/dist/shared/schema-doc.model.d.ts +27 -0
  120. package/dist/shared/schema-doc.model.d.ts.map +1 -1
  121. package/dist/shared/system-parameter.model.d.ts +27 -0
  122. package/dist/shared/system-parameter.model.d.ts.map +1 -1
  123. package/dist/shared/task-document.model.d.ts +27 -0
  124. package/dist/shared/task-document.model.d.ts.map +1 -1
  125. package/dist/shared/task.model.d.ts +27 -0
  126. package/dist/shared/task.model.d.ts.map +1 -1
  127. package/dist/underwriter/underwriter.model.d.ts +27 -0
  128. package/dist/underwriter/underwriter.model.d.ts.map +1 -1
  129. package/dist/users/auth-log.model.d.ts +27 -0
  130. package/dist/users/auth-log.model.d.ts.map +1 -1
  131. package/dist/users/permission.model.d.ts +27 -0
  132. package/dist/users/permission.model.d.ts.map +1 -1
  133. package/dist/users/role-group.model.d.ts +27 -0
  134. package/dist/users/role-group.model.d.ts.map +1 -1
  135. package/dist/users/role.model.d.ts +27 -0
  136. package/dist/users/role.model.d.ts.map +1 -1
  137. package/dist/users/tasks.model.d.ts +27 -0
  138. package/dist/users/tasks.model.d.ts.map +1 -1
  139. package/dist/users/user.model.d.ts +27 -0
  140. package/dist/users/user.model.d.ts.map +1 -1
  141. package/dist/value-objects/pound.d.ts +26 -0
  142. package/dist/value-objects/pound.d.ts.map +1 -1
  143. package/dist/value-objects/sort-code.d.ts +26 -0
  144. package/dist/value-objects/sort-code.d.ts.map +1 -1
  145. package/entities/applications/application-direct-debit.entity.ts +1 -1
  146. package/package.json +1 -1
  147. package/prisma/applicants/applicant.prisma +123 -124
  148. package/prisma/applications/application-direct-debit.prisma +3 -3
  149. package/prisma/applications/application.prisma +2 -0
  150. package/prisma/migrations/20250508092417_update_application_schema/migration.sql +3 -0
  151. package/prisma/migrations/20250508094735_update_direct_debit_schema/migration.sql +2 -0
  152. package/prisma/schema.prisma +126 -125
  153. package/dist/applicants/applicant-credit-data.model.js +0 -11
  154. package/dist/applicants/applicant-credit-profile.model.js +0 -20
  155. package/dist/applicants/applicant-direct-debit.model.js +0 -17
  156. package/dist/applicants/applicant-employment.model.js +0 -50
  157. package/dist/applicants/applicant-expenditure.model.js +0 -54
  158. package/dist/applicants/applicant-income-source.model.js +0 -9
  159. package/dist/applicants/applicant-income.model.js +0 -81
  160. package/dist/applicants/applicant-risk-narrative.model.js +0 -13
  161. package/dist/applicants/applicant.model.js +0 -223
  162. package/dist/applicants/index.js +0 -13
  163. package/dist/applications/application-audit.model.js +0 -42
  164. package/dist/applications/application-checklist-Item.model.js +0 -45
  165. package/dist/applications/application-company-model.js +0 -120
  166. package/dist/applications/application-credit-profile.model.js +0 -12
  167. package/dist/applications/application-direct-debit.model.js +0 -92
  168. package/dist/applications/application-document.model.js +0 -35
  169. package/dist/applications/application-fieldconfig.model.js +0 -7
  170. package/dist/applications/application-illustration-model.js +0 -6
  171. package/dist/applications/application-legal.model.js +0 -7
  172. package/dist/applications/application-mortgage.model.js +0 -271
  173. package/dist/applications/application-note.model.js +0 -78
  174. package/dist/applications/application-offer.model.js +0 -6
  175. package/dist/applications/application-onboarding.model.js +0 -9
  176. package/dist/applications/application-product.model.js +0 -67
  177. package/dist/applications/application-rationale.model.js +0 -38
  178. package/dist/applications/application-risk-narrative.model.js +0 -12
  179. package/dist/applications/application-valuation.model.js +0 -15
  180. package/dist/applications/application.model.js +0 -153
  181. package/dist/applications/broker.model.js +0 -21
  182. package/dist/applications/document.model.js +0 -35
  183. package/dist/applications/index.js +0 -20
  184. package/dist/applications/solicitor.model.js +0 -114
  185. package/dist/index.js +0 -9
  186. package/dist/product-catalogues/index.js +0 -3
  187. package/dist/product-catalogues/product-catalogue.model.js +0 -18
  188. package/dist/product-catalogues/product-definitions.model.js +0 -26
  189. package/dist/product-catalogues/product-variant.model.js +0 -12
  190. package/dist/properties/index.js +0 -2
  191. package/dist/properties/property.model.js +0 -144
  192. package/dist/shared/alert.model.js +0 -24
  193. package/dist/shared/apprivo-sync-journey.model.js +0 -17
  194. package/dist/shared/checklist.model.js +0 -30
  195. package/dist/shared/document-type-model.js +0 -10
  196. package/dist/shared/index.js +0 -12
  197. package/dist/shared/job-run.model.js +0 -14
  198. package/dist/shared/job-setting.model.js +0 -11
  199. package/dist/shared/lookup-group.model.js +0 -16
  200. package/dist/shared/lookup.model.js +0 -20
  201. package/dist/shared/system-parameter.model.js +0 -32
  202. package/dist/shared/task-document.model.js +0 -23
  203. package/dist/shared/task.model.js +0 -15
  204. package/dist/underwriter/index.js +0 -1
  205. package/dist/underwriter/underwriter.model.js +0 -17
  206. package/dist/users/auth-log.model.js +0 -21
  207. package/dist/users/index.js +0 -6
  208. package/dist/users/permission.model.js +0 -10
  209. package/dist/users/role-group.model.js +0 -14
  210. package/dist/users/role.model.js +0 -13
  211. package/dist/users/tasks.model.js +0 -15
  212. package/dist/users/user.model.js +0 -30
@@ -1,20 +0,0 @@
1
- import mongoose from "mongoose";
2
- const creditProfileSchema = new mongoose.Schema({
3
- anyVoluntaryEnforcedPossessionNo: {
4
- type: String,
5
- required: true
6
- },
7
- bankruptcyNo: {
8
- type: String,
9
- required: true
10
- },
11
- ccjInLastThreeYearNo: {
12
- type: String,
13
- required: true
14
- },
15
- defaultsInLastYearNo: {
16
- type: String,
17
- required: true
18
- }
19
- });
20
- export default creditProfileSchema;
@@ -1,17 +0,0 @@
1
- import mongoose from 'mongoose';
2
- const applicantDirectDebitSchema = new mongoose.Schema({
3
- applicationId: { type: mongoose.Schema.Types.ObjectId, ref: 'Application' },
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: String, default: false },
13
- nameOfAccountHolder: { type: String },
14
- selectedPaymentDay: { type: String },
15
- sortCode: { type: String }
16
- }, { timestamps: true });
17
- export default applicantDirectDebitSchema;
@@ -1,50 +0,0 @@
1
- import mongoose from "mongoose";
2
- import { Pound } from "../value-objects/pound";
3
- const applicantEmploymentSchema = new mongoose.Schema({
4
- pageValidFlag: { type: Boolean, default: false },
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
- averageBonusPreviousTwoYears: { type: Pound, default: 0.00 },
13
- basicGrossIncome: { type: Pound, default: 0.00 },
14
- contractRemaining: { type: String },
15
- dateJoined: { type: String, required: true },
16
- disabilityLiving: { type: Pound, default: 0.00 },
17
- employerName: { type: String, required: true },
18
- employerTelephone: { type: String, default: null },
19
- housingAllowance: { type: Pound, default: 0.00 },
20
- industryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
21
- isUnderTerminationNotice: {
22
- type: Boolean,
23
- default: false,
24
- },
25
- jobTitleLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
26
- maintenance: { type: Pound, default: 0.00 },
27
- maternityIncome: { type: Pound, default: 0.00 },
28
- natureOfBusiness: { type: String, required: true },
29
- pensionIncome: { type: Pound, default: 0.00 },
30
- previousAddressCity: { type: String, default: null },
31
- previousAddressCountry: { type: String, required: true },
32
- previousAddressLine1: { type: String, required: true },
33
- previousAddressLine2: { type: String, default: null },
34
- previousAddressLine3: { type: String, default: null },
35
- previousAddressPostCode: { type: String, required: true },
36
- previousBasicGrossIncome: { type: Pound, default: 0.00, required: true },
37
- previousDateJoined: { type: String, required: true },
38
- previousDateLeft: { type: String, required: true },
39
- previousEmployerName: { type: String, required: true },
40
- previousEmployerTelephone: { type: String, default: null },
41
- previousJobTitle: { type: String, required: true },
42
- previousNatureOfBusiness: { type: String, required: true },
43
- referenceContact: { type: String, default: null },
44
- referenceContactEmail: { type: String, required: true },
45
- underTerminationNoticeNote: { type: String, default: null }
46
- }, {
47
- toJSON: { getters: true },
48
- toObject: { getters: true }
49
- });
50
- export default applicantEmploymentSchema;
@@ -1,54 +0,0 @@
1
- import mongoose from "mongoose";
2
- import { Pound } from "../value-objects/pound";
3
- const applicantExpenditureSchema = new mongoose.Schema({
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
- },
37
- }, {
38
- timestamps: true,
39
- toJSON: { virtuals: true },
40
- toObject: { virtuals: true },
41
- });
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;
@@ -1,9 +0,0 @@
1
- import mongoose from "mongoose";
2
- const applicantIncomeSourceSchema = new mongoose.Schema({
3
- employmentStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
4
- incomeFromEmployment: { type: String },
5
- incomeFromPension: { type: String },
6
- incomeFromProperty: { type: String },
7
- incomeFromSavings: { type: String }
8
- });
9
- export default applicantIncomeSourceSchema;
@@ -1,81 +0,0 @@
1
- import mongoose from "mongoose";
2
- import { Pound } from "../value-objects/pound";
3
- const incomeSchema = new mongoose.Schema({
4
- accountantsAddressLine1: { type: String, required: true },
5
- accountantsAddressLine2: { type: String, required: true },
6
- accountantsAddressLine3: { type: String, required: true },
7
- accountantsCity: { type: String, default: '' },
8
- accountantsCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
9
- accountantsEmail: { type: String, required: true },
10
- accountantsPostCode: { type: String, required: true },
11
- accountantsPractice: { type: String, required: true },
12
- accountantsTelephoneNumber: { type: String, required: true },
13
- businessAddressLine1: { type: String, required: true },
14
- businessAddressLine2: { type: String, required: true },
15
- businessAddressLine3: { type: String, required: true },
16
- businessCity: { type: String, default: '' },
17
- businessCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
18
- businessPostCode: { type: String, required: true },
19
- businessTelephoneNumber: { type: String, required: true },
20
- businessTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
21
- charteredCertifiedOrOtherLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
22
- contactName: { type: String, required: true },
23
- currentYearEnd: { type: String, required: true },
24
- dateEstablished: { type: String, required: true },
25
- doYouHaveAccountant: {
26
- type: Boolean,
27
- required: true,
28
- },
29
- isBusinessAddressDifferent: {
30
- type: Boolean,
31
- required: true,
32
- },
33
- nameOfBusiness: { type: String, required: true },
34
- natureOfBusiness: { type: String, required: true },
35
- netAssets1: { type: Pound, default: 0.00 },
36
- netAssets2: { type: Pound, default: 0.00 },
37
- netAssets3: { type: Pound, default: 0.00 },
38
- pageValidFlag: { type: String, default: true },
39
- percentageOfShareholding: { type: Number, required: true, min: 0, max: 100 },
40
- registeredAddressLine1: { type: String, required: true },
41
- registeredAddressLine2: { type: String, required: true },
42
- registeredAddressLine3: { type: String, required: true },
43
- registeredCity: { type: String, default: '' },
44
- registeredCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
45
- registeredPostCode: { type: String, required: true },
46
- registeredTelephone: { type: String, required: true },
47
- selfEmployedDate: { type: String, required: true },
48
- turnover1: { type: Pound, default: 0.00 },
49
- turnover2: { type: Pound, default: 0.00 },
50
- turnover3: { type: Pound, default: 0.00 },
51
- year1: { type: Pound, default: 0.00 },
52
- year2: { type: Pound, default: 0.00 },
53
- year3: { type: Pound, default: 0.00 },
54
- yearEnd1: { type: Number, default: '' },
55
- yearEnd2: { type: Number, default: '' },
56
- yearEnd3: { type: Number, default: '' },
57
- totalEmploymentGrossIncome: { type: Pound, default: 0.00 },
58
- totalEmploymentNetIncome: { type: Pound, default: 0.00 },
59
- isEmploymentIncomeConfirmed: { type: Boolean, default: false },
60
- employmentIncomeRationale: { type: String, default: null },
61
- totalPensionGrossIncome: { type: Pound, default: 0.00 },
62
- totalPensionNetIncome: { type: Pound, default: 0.00 },
63
- isPensionIncomeConfirmed: { type: Boolean, default: false },
64
- pensionIncomeRationale: { type: String, default: null },
65
- totalAdditionalGrossIncome: { type: Pound, default: 0.00 },
66
- totalAdditionalNetIncome: { type: Pound, default: 0.00 },
67
- isAdditionalIncomeConfirmed: { type: Boolean, default: false },
68
- additionalIncomeRationale: { type: String, default: null },
69
- totalUKTaxCreditsGrossIncome: { type: Pound, default: 0.00 },
70
- totalUKTaxCreditsNetIncome: { type: Pound, default: 0.00 },
71
- isUKTaxCreditsIncomeConfirmed: { type: Boolean, default: false },
72
- ukTaxCreditsIncomeRationale: { type: String, default: null },
73
- totalPropertyGrossIncome: { type: Pound, default: 0.00 },
74
- totalPropertyNetIncome: { type: Pound, default: 0.00 },
75
- isPropertyIncomeConfirmed: { type: Boolean, default: false },
76
- propertyIncomeRationale: { type: String, default: null },
77
- }, {
78
- toJSON: { getters: true },
79
- toObject: { getters: true }
80
- });
81
- export default incomeSchema;
@@ -1,13 +0,0 @@
1
- import mongoose from 'mongoose';
2
- const applicantRiskNarrativeSchema = new mongoose.Schema({
3
- call2StatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
4
- clientReference: { type: String },
5
- docVerificationStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
6
- isPoaTaskGenerated: { type: String },
7
- link: { type: String },
8
- riskLevel: { type: String },
9
- riskRating: { type: String },
10
- statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
11
- verificationLinkSentOn: { type: String }
12
- });
13
- export default applicantRiskNarrativeSchema;
@@ -1,223 +0,0 @@
1
- import mongoose from "mongoose";
2
- import applicantCreditDataSchema from "./applicant-credit-data.model";
3
- import applicantRiskNarrativeSchema from "./applicant-risk-narrative.model";
4
- import applicantIncomeSourceSchema from "./applicant-income-source.model";
5
- import applicantEmploymentSchema from "./applicant-employment.model";
6
- import applicantDirectDebitSchema from "./applicant-direct-debit.model";
7
- import creditProfileSchema from "./applicant-credit-profile.model";
8
- import incomeSchema from "./applicant-income.model";
9
- const applicantSchema = new mongoose.Schema({
10
- applicantId: { type: String, required: true },
11
- applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true },
12
- addressCity: { type: String, default: null },
13
- addressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
14
- addressLine1: { type: String, default: null },
15
- addressLine2: { type: String, default: null },
16
- addressLine3: { type: String, default: null },
17
- addressMovedDate: { type: String, default: null },
18
- addressPostCode: { type: String, default: null },
19
- correspondenceAddressCity: { type: String, default: null },
20
- correspondenceAddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
21
- correspondenceAddressLine1: { type: String, default: null },
22
- correspondenceAddressLine2: { type: String, default: null },
23
- correspondenceAddressLine3: { type: String, default: null },
24
- correspondenceAddressPostCode: { type: String, default: null },
25
- countryOfResidenceLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
26
- dateOfBirth: { type: String, required: true },
27
- dependant10Age: { type: Number, default: 0 },
28
- dependant1Age: { type: Number, default: 0 },
29
- dependant2Age: { type: Number, default: 0 },
30
- dependant3Age: { type: Number, default: 0 },
31
- dependant4Age: { type: Number, default: 0 },
32
- dependant5Age: { type: Number, default: 0 },
33
- dependant6Age: { type: Number, default: 0 },
34
- dependant7Age: { type: Number, default: 0 },
35
- dependant8Age: { type: Number, default: 0 },
36
- dependant9Age: { type: Number, default: 0 },
37
- email: { type: String, required: true },
38
- employmentStatusDetails: { type: String, default: null },
39
- firstName: { type: String, required: true },
40
- isFirstTimelandlord: {
41
- type: Boolean,
42
- default: false,
43
- },
44
- foreignIdForNationals: { type: String, default: null },
45
- gdprEmail: {
46
- type: Boolean,
47
- default: false,
48
- },
49
- gdprPost: {
50
- type: Boolean,
51
- default: false,
52
- },
53
- gdprTelephone: {
54
- type: Boolean,
55
- default: false,
56
- },
57
- gdprTextMessage: {
58
- type: Boolean,
59
- default: false,
60
- },
61
- gender: { type: String, required: true },
62
- hasBrokerGivenConsentForVulnerabilities: {
63
- type: Boolean,
64
- required: true,
65
- },
66
- hasLinkedJurisdiction: {
67
- type: Boolean,
68
- default: false,
69
- },
70
- isCorrespondence: {
71
- type: Boolean,
72
- default: true,
73
- },
74
- isCreditCardCommitmentConfirmed: { type: Boolean, default: false, },
75
- isLoanCommitmentConfirmed: { type: Boolean, default: false, },
76
- isMortgageHPPCommitmentConfirmed: { type: Boolean, default: false, },
77
- isCurrentContract: { type: Boolean, default: false, },
78
- isCustomerVulnerable: {
79
- type: Boolean,
80
- default: false,
81
- },
82
- isExpat: {
83
- type: Boolean,
84
- default: false,
85
- },
86
- isFirstApplicant: {
87
- type: Boolean,
88
- default: false,
89
- },
90
- isUkPassport: {
91
- type: Boolean,
92
- default: false,
93
- },
94
- isUkResident: {
95
- type: Boolean,
96
- required: true,
97
- },
98
- classLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
99
- pageValidFlag: { type: Boolean, default: false },
100
- lastName: { type: String, required: true },
101
- linkedJurisdictionCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
102
- linkedJurisdictionDetails: { type: String, default: null },
103
- maidenName: { type: String, default: null },
104
- maritalStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
105
- mobileNumber: { type: String, default: null },
106
- nationalityLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
107
- netIncome: { type: Number, default: 0.00 },
108
- niNumber: { type: String, required: true },
109
- numberOfDependants: { type: Number, default: 0 },
110
- isOneYearPrior: {
111
- type: Boolean,
112
- default: false,
113
- },
114
- phoneNumber: { type: String, default: null },
115
- previous1AddressCity: { type: String, default: null },
116
- previous1AddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
117
- previous1AddressLine1: { type: String, default: null },
118
- previous1AddressLine2: { type: String, default: null },
119
- previous1AddressLine3: { type: String, default: null },
120
- previous1AddressMovedDate: { type: String, default: null },
121
- previous1AddressPostCode: { type: String, default: null },
122
- previous1AddressPropertyOwnedBy: { type: String, default: null },
123
- previous2AddressCity: { type: String, default: null },
124
- previous2AddressCountryLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
125
- previous2AddressLine1: { type: String, default: null },
126
- previous2AddressLine2: { type: String, default: null },
127
- previous2AddressLine3: { type: String, default: null },
128
- previous2AddressMovedDate: { type: String, default: null },
129
- previous2AddressPostCode: { type: String, default: null },
130
- previous2AddressPropertyOwnedBy: { type: String, default: null },
131
- relationshipToOthers: { type: String, required: true },
132
- residentialStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
133
- retirementAge: { type: String, required: true },
134
- taxJurisdictionLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
135
- taxPayerLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
136
- timeResidedAtCountryOfResidence: { type: Number, required: true },
137
- title: { type: String, required: true },
138
- isTwoYearPrior: {
139
- type: Boolean,
140
- default: false,
141
- },
142
- understandEnglish: {
143
- type: Boolean,
144
- required: true,
145
- },
146
- vulnerabilityNotes: { type: String, default: null },
147
- vulnerabilityTypeLids: [{ type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }],
148
- ukPassportProfession: {
149
- type: mongoose.Schema.Types.ObjectId,
150
- ref: "Lookup",
151
- required: function () {
152
- return this.isUkResident;
153
- }
154
- },
155
- creditData: applicantCreditDataSchema,
156
- riskNarrative: applicantRiskNarrativeSchema,
157
- incomeSource: applicantIncomeSourceSchema,
158
- employment: applicantEmploymentSchema,
159
- directDebit: applicantDirectDebitSchema,
160
- creditProfile: creditProfileSchema,
161
- income: incomeSchema
162
- }, {
163
- timestamps: true,
164
- toJSON: { virtuals: true, getters: true },
165
- toObject: { virtuals: true, getters: true }
166
- });
167
- applicantSchema.virtual('nationality').get(function () {
168
- return this.nationalityLid?.name ?? null;
169
- });
170
- applicantSchema.virtual('residence').get(function () {
171
- return this.countryOfResidenceLid?.name ?? null;
172
- });
173
- applicantSchema.virtual('industry').get(function () {
174
- return this.employment?.industryLid?.name ?? null;
175
- });
176
- applicantSchema.virtual('employmentClass').get(function () {
177
- return this.classLid?.name ?? null;
178
- });
179
- applicantSchema.virtual('addressCountry').get(function () {
180
- return this.addressCountryLid?.name ?? null;
181
- });
182
- applicantSchema.virtual('previous1AddressCountry').get(function () {
183
- return this.previous1AddressCountryLid?.name ?? null;
184
- });
185
- applicantSchema.virtual('previous2AddressCountry').get(function () {
186
- return this.previous2AddressCountryLid?.name ?? null;
187
- });
188
- applicantSchema.virtual('maritalStatus').get(function () {
189
- return this.maritalStatusLid?.name ?? null;
190
- });
191
- applicantSchema.virtual('residentialStatus').get(function () {
192
- return this.residentialStatusLid?.name ?? null;
193
- });
194
- applicantSchema.virtual('taxPayer').get(function () {
195
- return this.taxPayerLid?.name ?? null;
196
- });
197
- applicantSchema.virtual('vulnerabilityType').get(function () {
198
- return this.vulnerabilityTypeLids?.map((v) => v.name);
199
- });
200
- applicantSchema.virtual('fullName').get(function () {
201
- return `${this.firstName ?? ''} ${this.lastName ?? ''}`.trim();
202
- });
203
- // virtual property 'applicationType'
204
- applicantSchema.virtual('applicationType').get(function () {
205
- return this.applicationId?.applicationTypeLid instanceof mongoose.Types.ObjectId
206
- ? null
207
- : this.applicationId?.applicationTypeLid?.name || null;
208
- });
209
- // virtual property 'lendingType'
210
- applicantSchema.virtual('lendingType').get(function () {
211
- return this.applicationId?.lendingTypeLid instanceof mongoose.Types.ObjectId
212
- ? null
213
- : this.applicationId?.lendingTypeLid?.name || null;
214
- });
215
- // numberOfApplicants – how many applicants are on the associated Application
216
- applicantSchema.virtual('numberOfApplicants').get(function () {
217
- // `this.applicationId` must be populated (with its `applicants` field)
218
- const app = this.applicationId;
219
- // if it's populated and has an applicants array, return its length, otherwise 0
220
- return Array.isArray(app?.applicants) ? app.applicants.length : 0;
221
- });
222
- const ApplicantModel = mongoose.model("Applicant", applicantSchema);
223
- export default ApplicantModel;
@@ -1,13 +0,0 @@
1
- export { default as ApplicantModel } from './applicant.model';
2
- export { default as ApplicantEmploymentIncomeModel } from './applicant-employment-income.model';
3
- export { default as CreditCardCommitmentModel } from './applicant-commitment-creditCard.model';
4
- export { default as LoanCommitmentModel } from './applicant-commitment-loan.model';
5
- export { default as MortgageCommitmentModel } from './applicant-commitment-mortgage.model';
6
- export { default as ResidenceCommitmentModel } from './applicant-commitment-residence.model';
7
- export { default as SecuredLoanCommitmentModel } from './applicant-commitment-secureLoan.model';
8
- export { default as UnsecuredLoanCommitmentModel } from './applicant-commitment-unsecuredLoan.model';
9
- export { default as ApplicantExpenditureModel } from './applicant-expenditure.model';
10
- export { default as ApplicantPensionIncomeModel } from './applicant-pension-income.model';
11
- export { default as ApplicantAdditionalIncomeModel } from './applicant-additional-income.model';
12
- export { default as ApplicantUKTaxCreditsModel } from './applicant-uk-tax-credits.model';
13
- export { default as ApplicantPropertyIncomeModel } from './applicant-property-income.model';
@@ -1,42 +0,0 @@
1
- import mongoose from "mongoose";
2
- const applicationAuditSchema = new mongoose.Schema({
3
- auditId: {
4
- type: String,
5
- required: true
6
- },
7
- accountId: {
8
- type: String,
9
- required: true
10
- },
11
- auditCorrelationId: {
12
- type: String,
13
- required: true
14
- },
15
- auditDate: {
16
- type: Date,
17
- required: true
18
- },
19
- changeType: {
20
- type: String,
21
- required: true
22
- },
23
- applicationId: {
24
- type: mongoose.Schema.Types.ObjectId,
25
- ref: 'Application',
26
- required: true
27
- },
28
- name: {
29
- type: String,
30
- required: true
31
- },
32
- oldValue: {
33
- type: String,
34
- required: true
35
- },
36
- newValue: {
37
- type: String,
38
- required: true
39
- }
40
- }, { timestamps: true });
41
- const ApplicationAuditModel = mongoose.model('ApplicationAudit', applicationAuditSchema);
42
- export default ApplicationAuditModel;
@@ -1,45 +0,0 @@
1
- import mongoose from "mongoose";
2
- const checkListItemSchema = new mongoose.Schema({
3
- additionalOfferConditions: { type: String, default: "" },
4
- appFormSignedNotes: { type: String, default: "" },
5
- applicationCompletionDate: { type: String },
6
- buildingInsuranceInsurerName: { type: String, default: "" },
7
- buildingInsurancePolicyNumber: { type: String, default: "" },
8
- buildingInsuranceReceived: { type: String, default: "" },
9
- buildingInsuranceRenewalDate: { type: String },
10
- dateOfValuationReceived: { type: String },
11
- feePaidDocumentsDownloaded: { type: String, default: "" },
12
- feePaidNotes: { type: String, default: "" },
13
- fundsNotes: { type: String, default: "" },
14
- fundsReleasedDate: { type: String },
15
- hasAllDocsReviewedAndAccepted: { type: String, default: "" },
16
- idnPorReceived: { type: String, default: "" },
17
- legalCompletionDate: { type: String },
18
- legalDocsReceived: { type: String, default: "" },
19
- legalNotes: { type: String, default: "" },
20
- ninetyDaysValuationAmount: { type: String, default: "" },
21
- offerConditionsItems: { type: String, default: "" },
22
- offerConditionsMet: { type: String, default: "" },
23
- offerNotes: { type: String, default: "" },
24
- offerOfferPrepared: { type: String, default: "" },
25
- offerOfferReviewed: { type: String, default: "" },
26
- offerSignedNotes: { type: String, default: "" },
27
- offerSolicitorInstructedDate: { type: String },
28
- packagingNotes: { type: String, default: "" },
29
- preOfferNotes: { type: String, default: "" },
30
- reinstatementAmount: { type: String, default: "" },
31
- rotReceived: { type: String, default: "" },
32
- rotReceivedDate: { type: String },
33
- salesContractReceived: { type: String, default: "" },
34
- underwritingNotes: { type: String, default: "" },
35
- underwritingValuationNotes: { type: String, default: "" },
36
- valuationAccepted: { type: String },
37
- valuationFurtherConditions: { type: String, default: "" },
38
- valuationNotes: { type: String, default: "" },
39
- valuationReceived: { type: String },
40
- valuationRequestedDate: { type: String },
41
- valuationScheduledDate: { type: String },
42
- valuationSurveyorDetails: { type: String, default: "" }
43
- });
44
- const ApplicationCheckListModel = mongoose.model("ApplicationCheckList", checkListItemSchema);
45
- export default ApplicationCheckListModel;