@dynamatix/gb-schemas 2.0.28 → 2.0.29

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 +926 -46
  2. package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -1
  3. package/dist/applicants/applicant-additional-income.model.js +23 -3
  4. package/dist/applicants/applicant-commitment-creditCard.model.d.ts +0 -32
  5. package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -1
  6. package/dist/applicants/applicant-commitment-creditCard.model.js +0 -1
  7. package/dist/applicants/applicant-commitment-loan.model.d.ts +0 -32
  8. package/dist/applicants/applicant-commitment-loan.model.d.ts.map +1 -1
  9. package/dist/applicants/applicant-commitment-loan.model.js +0 -1
  10. package/dist/applicants/applicant-commitment-mortgage.model.d.ts +0 -32
  11. package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -1
  12. package/dist/applicants/applicant-commitment-mortgage.model.js +0 -1
  13. package/dist/applicants/applicant-commitment-residence.model.d.ts +0 -26
  14. package/dist/applicants/applicant-commitment-residence.model.d.ts.map +1 -1
  15. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts +0 -26
  16. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts.map +1 -1
  17. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts +0 -26
  18. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts.map +1 -1
  19. package/dist/applicants/applicant-credit-data.model.d.ts +0 -27
  20. package/dist/applicants/applicant-credit-data.model.d.ts.map +1 -1
  21. package/dist/applicants/applicant-credit-data.model.js +11 -0
  22. package/dist/applicants/applicant-credit-profile.model.d.ts +0 -27
  23. package/dist/applicants/applicant-credit-profile.model.d.ts.map +1 -1
  24. package/dist/applicants/applicant-credit-profile.model.js +20 -0
  25. package/dist/applicants/applicant-direct-debit.model.d.ts +0 -27
  26. package/dist/applicants/applicant-direct-debit.model.d.ts.map +1 -1
  27. package/dist/applicants/applicant-direct-debit.model.js +17 -0
  28. package/dist/applicants/applicant-employment-income.model.d.ts +0 -26
  29. package/dist/applicants/applicant-employment-income.model.d.ts.map +1 -1
  30. package/dist/applicants/applicant-employment.model.d.ts +6 -1260
  31. package/dist/applicants/applicant-employment.model.d.ts.map +1 -1
  32. package/dist/applicants/applicant-employment.model.js +50 -0
  33. package/dist/applicants/applicant-expenditure.model.d.ts +0 -26
  34. package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -1
  35. package/dist/applicants/applicant-expenditure.model.js +54 -0
  36. package/dist/applicants/applicant-income-source.model.d.ts +0 -27
  37. package/dist/applicants/applicant-income-source.model.d.ts.map +1 -1
  38. package/dist/applicants/applicant-income-source.model.js +9 -0
  39. package/dist/applicants/applicant-income.model.d.ts +12 -26
  40. package/dist/applicants/applicant-income.model.d.ts.map +1 -1
  41. package/dist/applicants/applicant-income.model.js +81 -0
  42. package/dist/applicants/applicant-pension-income.model.d.ts +0 -314
  43. package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -1
  44. package/dist/applicants/applicant-pension-income.model.js +0 -13
  45. package/dist/applicants/applicant-property-income.model.d.ts +0 -26
  46. package/dist/applicants/applicant-property-income.model.d.ts.map +1 -1
  47. package/dist/applicants/applicant-risk-narrative.model.d.ts +0 -27
  48. package/dist/applicants/applicant-risk-narrative.model.d.ts.map +1 -1
  49. package/dist/applicants/applicant-risk-narrative.model.js +13 -0
  50. package/dist/applicants/applicant-uk-tax-credits.model.d.ts +0 -314
  51. package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -1
  52. package/dist/applicants/applicant-uk-tax-credits.model.js +0 -2
  53. package/dist/applicants/applicant.model.d.ts +1 -27
  54. package/dist/applicants/applicant.model.d.ts.map +1 -1
  55. package/dist/applicants/applicant.model.js +223 -0
  56. package/dist/applicants/index.d.ts +0 -2
  57. package/dist/applicants/index.d.ts.map +1 -1
  58. package/dist/applicants/index.js +13 -0
  59. package/dist/applications/application-audit.model.d.ts +0 -27
  60. package/dist/applications/application-audit.model.d.ts.map +1 -1
  61. package/dist/applications/application-audit.model.js +42 -0
  62. package/dist/applications/application-checklist-Item.model.d.ts +0 -27
  63. package/dist/applications/application-checklist-Item.model.d.ts.map +1 -1
  64. package/dist/applications/application-checklist-Item.model.js +45 -0
  65. package/dist/applications/application-company-model.d.ts +0 -26
  66. package/dist/applications/application-company-model.d.ts.map +1 -1
  67. package/dist/applications/application-company-model.js +120 -0
  68. package/dist/applications/application-credit-profile.model.d.ts +0 -27
  69. package/dist/applications/application-credit-profile.model.d.ts.map +1 -1
  70. package/dist/applications/application-credit-profile.model.js +12 -0
  71. package/dist/applications/application-direct-debit.model.d.ts +0 -26
  72. package/dist/applications/application-direct-debit.model.d.ts.map +1 -1
  73. package/dist/applications/application-direct-debit.model.js +92 -0
  74. package/dist/applications/application-document.model.d.ts +0 -27
  75. package/dist/applications/application-document.model.d.ts.map +1 -1
  76. package/dist/applications/application-document.model.js +35 -0
  77. package/dist/applications/application-fieldconfig.model.d.ts +0 -27
  78. package/dist/applications/application-fieldconfig.model.d.ts.map +1 -1
  79. package/dist/applications/application-fieldconfig.model.js +7 -0
  80. package/dist/applications/application-illustration-model.d.ts +0 -27
  81. package/dist/applications/application-illustration-model.d.ts.map +1 -1
  82. package/dist/applications/application-illustration-model.js +6 -0
  83. package/dist/applications/application-legal.model.d.ts +0 -27
  84. package/dist/applications/application-legal.model.d.ts.map +1 -1
  85. package/dist/applications/application-legal.model.js +7 -0
  86. package/dist/applications/application-mortgage.model.d.ts +0 -26
  87. package/dist/applications/application-mortgage.model.d.ts.map +1 -1
  88. package/dist/applications/application-mortgage.model.js +271 -0
  89. package/dist/applications/application-note.model.d.ts +0 -27
  90. package/dist/applications/application-note.model.d.ts.map +1 -1
  91. package/dist/applications/application-note.model.js +78 -0
  92. package/dist/applications/application-offer.model.d.ts +0 -27
  93. package/dist/applications/application-offer.model.d.ts.map +1 -1
  94. package/dist/applications/application-offer.model.js +6 -0
  95. package/dist/applications/application-onboarding.model.d.ts +0 -27
  96. package/dist/applications/application-onboarding.model.d.ts.map +1 -1
  97. package/dist/applications/application-onboarding.model.js +9 -0
  98. package/dist/applications/application-product.model.d.ts +0 -27
  99. package/dist/applications/application-product.model.d.ts.map +1 -1
  100. package/dist/applications/application-product.model.js +67 -0
  101. package/dist/applications/application-productfeatures.model.d.ts +0 -27
  102. package/dist/applications/application-productfeatures.model.d.ts.map +1 -1
  103. package/dist/applications/application-rationale.model.d.ts +0 -27
  104. package/dist/applications/application-rationale.model.d.ts.map +1 -1
  105. package/dist/applications/application-rationale.model.js +38 -0
  106. package/dist/applications/application-risk-narrative.model.d.ts +0 -27
  107. package/dist/applications/application-risk-narrative.model.d.ts.map +1 -1
  108. package/dist/applications/application-risk-narrative.model.js +12 -0
  109. package/dist/applications/application-valuation.model.d.ts +0 -27
  110. package/dist/applications/application-valuation.model.d.ts.map +1 -1
  111. package/dist/applications/application-valuation.model.js +15 -0
  112. package/dist/applications/application.model.d.ts +0 -27
  113. package/dist/applications/application.model.d.ts.map +1 -1
  114. package/dist/applications/application.model.js +153 -0
  115. package/dist/applications/broker.model.d.ts +0 -27
  116. package/dist/applications/broker.model.d.ts.map +1 -1
  117. package/dist/applications/broker.model.js +21 -0
  118. package/dist/applications/document.model.d.ts +0 -27
  119. package/dist/applications/document.model.d.ts.map +1 -1
  120. package/dist/applications/document.model.js +35 -0
  121. package/dist/applications/index.js +20 -0
  122. package/dist/applications/solicitor.model.d.ts +0 -26
  123. package/dist/applications/solicitor.model.d.ts.map +1 -1
  124. package/dist/applications/solicitor.model.js +114 -0
  125. package/dist/entities/applicants/applicant.entity.d.ts +3 -3
  126. package/dist/entities/applicants/applicant.entity.d.ts.map +1 -1
  127. package/dist/index.d.ts +1 -0
  128. package/dist/index.d.ts.map +1 -1
  129. package/dist/index.js +9 -0
  130. package/dist/product-catalogues/index.js +3 -0
  131. package/dist/product-catalogues/product-catalogue.model.d.ts +0 -27
  132. package/dist/product-catalogues/product-catalogue.model.d.ts.map +1 -1
  133. package/dist/product-catalogues/product-catalogue.model.js +18 -0
  134. package/dist/product-catalogues/product-definitions.model.d.ts +0 -27
  135. package/dist/product-catalogues/product-definitions.model.d.ts.map +1 -1
  136. package/dist/product-catalogues/product-definitions.model.js +26 -0
  137. package/dist/product-catalogues/product-variant.model.d.ts +0 -27
  138. package/dist/product-catalogues/product-variant.model.d.ts.map +1 -1
  139. package/dist/product-catalogues/product-variant.model.js +12 -0
  140. package/dist/properties/index.js +2 -0
  141. package/dist/properties/property.model.d.ts +0 -26
  142. package/dist/properties/property.model.d.ts.map +1 -1
  143. package/dist/properties/property.model.js +144 -0
  144. package/dist/properties/security.model.d.ts +0 -27
  145. package/dist/properties/security.model.d.ts.map +1 -1
  146. package/dist/shared/alert.model.d.ts +0 -27
  147. package/dist/shared/alert.model.d.ts.map +1 -1
  148. package/dist/shared/alert.model.js +24 -0
  149. package/dist/shared/apprivo-sync-journey.model.d.ts +0 -27
  150. package/dist/shared/apprivo-sync-journey.model.d.ts.map +1 -1
  151. package/dist/shared/apprivo-sync-journey.model.js +17 -0
  152. package/dist/shared/checklist.model.d.ts +0 -27
  153. package/dist/shared/checklist.model.d.ts.map +1 -1
  154. package/dist/shared/checklist.model.js +30 -0
  155. package/dist/shared/document-type-model.d.ts +0 -27
  156. package/dist/shared/document-type-model.d.ts.map +1 -1
  157. package/dist/shared/document-type-model.js +10 -0
  158. package/dist/shared/index.js +12 -0
  159. package/dist/shared/job-run.model.d.ts +0 -27
  160. package/dist/shared/job-run.model.d.ts.map +1 -1
  161. package/dist/shared/job-run.model.js +14 -0
  162. package/dist/shared/job-setting.model.d.ts +0 -27
  163. package/dist/shared/job-setting.model.d.ts.map +1 -1
  164. package/dist/shared/job-setting.model.js +11 -0
  165. package/dist/shared/lookup-group.model.d.ts +0 -27
  166. package/dist/shared/lookup-group.model.d.ts.map +1 -1
  167. package/dist/shared/lookup-group.model.js +16 -0
  168. package/dist/shared/lookup.model.d.ts +0 -27
  169. package/dist/shared/lookup.model.d.ts.map +1 -1
  170. package/dist/shared/lookup.model.js +20 -0
  171. package/dist/shared/schema-doc.model.d.ts +0 -27
  172. package/dist/shared/schema-doc.model.d.ts.map +1 -1
  173. package/dist/shared/system-parameter.model.d.ts +0 -27
  174. package/dist/shared/system-parameter.model.d.ts.map +1 -1
  175. package/dist/shared/system-parameter.model.js +32 -0
  176. package/dist/shared/task-document.model.d.ts +0 -27
  177. package/dist/shared/task-document.model.d.ts.map +1 -1
  178. package/dist/shared/task-document.model.js +23 -0
  179. package/dist/shared/task.model.d.ts +0 -27
  180. package/dist/shared/task.model.d.ts.map +1 -1
  181. package/dist/shared/task.model.js +15 -0
  182. package/dist/underwriter/index.js +1 -0
  183. package/dist/underwriter/underwriter.model.d.ts +0 -27
  184. package/dist/underwriter/underwriter.model.d.ts.map +1 -1
  185. package/dist/underwriter/underwriter.model.js +17 -0
  186. package/dist/users/auth-log.model.d.ts +0 -27
  187. package/dist/users/auth-log.model.d.ts.map +1 -1
  188. package/dist/users/auth-log.model.js +21 -0
  189. package/dist/users/index.js +6 -0
  190. package/dist/users/permission.model.d.ts +0 -27
  191. package/dist/users/permission.model.d.ts.map +1 -1
  192. package/dist/users/permission.model.js +10 -0
  193. package/dist/users/role-group.model.d.ts +0 -27
  194. package/dist/users/role-group.model.d.ts.map +1 -1
  195. package/dist/users/role-group.model.js +14 -0
  196. package/dist/users/role.model.d.ts +0 -27
  197. package/dist/users/role.model.d.ts.map +1 -1
  198. package/dist/users/role.model.js +13 -0
  199. package/dist/users/tasks.model.d.ts +0 -27
  200. package/dist/users/tasks.model.d.ts.map +1 -1
  201. package/dist/users/tasks.model.js +15 -0
  202. package/dist/users/user.model.d.ts +0 -27
  203. package/dist/users/user.model.d.ts.map +1 -1
  204. package/dist/users/user.model.js +30 -0
  205. package/dist/value-objects/pound.d.ts +0 -26
  206. package/dist/value-objects/pound.d.ts.map +1 -1
  207. package/dist/value-objects/sort-code.d.ts +0 -26
  208. package/dist/value-objects/sort-code.d.ts.map +1 -1
  209. package/package.json +1 -1
  210. package/dist/applicants/applicant-income-settings.model.d.ts +0 -81
  211. package/dist/applicants/applicant-income-settings.model.d.ts.map +0 -1
  212. package/dist/applicants/applicant-income-settings.model.js +0 -11
@@ -1,30 +1,3 @@
1
- /// <reference path="../value-objects/pound.d.ts" />
2
- /// <reference path="../value-objects/sort-code.d.ts" />
3
- /// <reference types="mongoose/types/aggregate" />
4
- /// <reference types="mongoose/types/callback" />
5
- /// <reference types="mongoose/types/collection" />
6
- /// <reference types="mongoose/types/connection" />
7
- /// <reference types="mongoose/types/cursor" />
8
- /// <reference types="mongoose/types/document" />
9
- /// <reference types="mongoose/types/error" />
10
- /// <reference types="mongoose/types/expressions" />
11
- /// <reference types="mongoose/types/helpers" />
12
- /// <reference types="mongoose/types/middlewares" />
13
- /// <reference types="mongoose/types/indexes" />
14
- /// <reference types="mongoose/types/models" />
15
- /// <reference types="mongoose/types/mongooseoptions" />
16
- /// <reference types="mongoose/types/pipelinestage" />
17
- /// <reference types="mongoose/types/populate" />
18
- /// <reference types="mongoose/types/query" />
19
- /// <reference types="mongoose/types/schemaoptions" />
20
- /// <reference types="mongoose/types/schematypes" />
21
- /// <reference types="mongoose/types/session" />
22
- /// <reference types="mongoose/types/types" />
23
- /// <reference types="mongoose/types/utility" />
24
- /// <reference types="mongoose/types/validation" />
25
- /// <reference types="mongoose/types/virtuals" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import mongoose from "mongoose";
29
2
  declare const ProductModel: mongoose.Model<{
30
3
  selectedProduct: string;
@@ -1 +1 @@
1
- {"version":3,"file":"application-product.model.d.ts","sourceRoot":"","sources":["../../applications/application-product.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAyEhC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA2C,CAAC;AAC9D,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"application-product.model.d.ts","sourceRoot":"","sources":["../../applications/application-product.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAyEhC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA2C,CAAC;AAC9D,eAAe,YAAY,CAAC"}
@@ -0,0 +1,67 @@
1
+ import mongoose from "mongoose";
2
+ import { Pound } from "../value-objects/pound";
3
+ const productSchema = new mongoose.Schema({
4
+ applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true,
5
+ description: "Unique identifier for the application"
6
+ },
7
+ selectedProduct: { type: String, default: "" },
8
+ lendingTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
9
+ pageValidFlag: { type: Boolean, get: (value) => (value ? "Yes" : "No") },
10
+ repaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
11
+ numberOfYearsToRepay: { type: Number, default: 0 },
12
+ repaymentVehicle: { type: String, required: true, default: '', maxLength: 100 },
13
+ fixedAmount: { type: Pound, default: 0.00, required: false },
14
+ isFinanceRecommendedToApplicantLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
15
+ procFeeRateLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
16
+ networkClubSubmission: { type: Boolean, required: true, get: (value) => (value ? "Yes" : "No") },
17
+ clubNetworkNameLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
18
+ introducerSubmission: { type: Boolean, required: true, get: (value) => (value ? "Yes" : "No") },
19
+ introducer: { type: String, default: '' },
20
+ bdm: { type: String, required: true, default: '' },
21
+ tempAppFee: { type: Pound, default: 0.00, required: true },
22
+ productFeePaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" }
23
+ });
24
+ // virtual property 'lendingType'
25
+ productSchema.virtual('lendingType').get(function () {
26
+ const lendingType = this.lendingTypeLid;
27
+ return lendingType && lendingType instanceof mongoose.Types.ObjectId
28
+ ? null
29
+ : lendingType?.name || null;
30
+ });
31
+ // virtual property 'repaymentType'
32
+ productSchema.virtual('repaymentType').get(function () {
33
+ const repaymentType = this.repaymentTypeLid;
34
+ return repaymentType && repaymentType instanceof mongoose.Types.ObjectId
35
+ ? null
36
+ : repaymentType?.name || null;
37
+ });
38
+ // virtual property 'isFinanceRecommendedToApplicant'
39
+ productSchema.virtual('isFinanceRecommendedToApplicant').get(function () {
40
+ const isFinanceRecommendedToApplicant = this.isFinanceRecommendedToApplicantLid;
41
+ return isFinanceRecommendedToApplicant && isFinanceRecommendedToApplicant instanceof mongoose.Types.ObjectId
42
+ ? null
43
+ : isFinanceRecommendedToApplicant?.name || null;
44
+ });
45
+ // virtual property 'procFeeRate'
46
+ productSchema.virtual('procFeeRate').get(function () {
47
+ const procFeeRate = this.procFeeRateLid;
48
+ return procFeeRate && procFeeRate instanceof mongoose.Types.ObjectId
49
+ ? null
50
+ : procFeeRate?.name || null;
51
+ });
52
+ // virtual property 'clubNetworkName'
53
+ productSchema.virtual('clubNetworkName').get(function () {
54
+ const clubNetworkName = this.clubNetworkNameLid;
55
+ return clubNetworkName && clubNetworkName instanceof mongoose.Types.ObjectId
56
+ ? null
57
+ : clubNetworkName?.name || null;
58
+ });
59
+ // virtual property 'productFeePaymentType'
60
+ productSchema.virtual('productFeePaymentType').get(function () {
61
+ const productFeePaymentType = this.productFeePaymentTypeLid;
62
+ return productFeePaymentType && productFeePaymentType instanceof mongoose.Types.ObjectId
63
+ ? null
64
+ : productFeePaymentType?.name || null;
65
+ });
66
+ const ProductModel = mongoose.model("Product", productSchema);
67
+ export default ProductModel;
@@ -1,30 +1,3 @@
1
- /// <reference path="../value-objects/pound.d.ts" />
2
- /// <reference path="../value-objects/sort-code.d.ts" />
3
- /// <reference types="mongoose/types/aggregate" />
4
- /// <reference types="mongoose/types/callback" />
5
- /// <reference types="mongoose/types/collection" />
6
- /// <reference types="mongoose/types/connection" />
7
- /// <reference types="mongoose/types/cursor" />
8
- /// <reference types="mongoose/types/document" />
9
- /// <reference types="mongoose/types/error" />
10
- /// <reference types="mongoose/types/expressions" />
11
- /// <reference types="mongoose/types/helpers" />
12
- /// <reference types="mongoose/types/middlewares" />
13
- /// <reference types="mongoose/types/indexes" />
14
- /// <reference types="mongoose/types/models" />
15
- /// <reference types="mongoose/types/mongooseoptions" />
16
- /// <reference types="mongoose/types/pipelinestage" />
17
- /// <reference types="mongoose/types/populate" />
18
- /// <reference types="mongoose/types/query" />
19
- /// <reference types="mongoose/types/schemaoptions" />
20
- /// <reference types="mongoose/types/schematypes" />
21
- /// <reference types="mongoose/types/session" />
22
- /// <reference types="mongoose/types/types" />
23
- /// <reference types="mongoose/types/utility" />
24
- /// <reference types="mongoose/types/validation" />
25
- /// <reference types="mongoose/types/virtuals" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import mongoose from "mongoose";
29
2
  declare const ApplicationProductFeaturesModel: mongoose.Model<{
30
3
  name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"application-productfeatures.model.d.ts","sourceRoot":"","sources":["../../applications/application-productfeatures.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAoGhC,QAAA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAsE,CAAC;AAC5G,eAAe,+BAA+B,CAAC"}
1
+ {"version":3,"file":"application-productfeatures.model.d.ts","sourceRoot":"","sources":["../../applications/application-productfeatures.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAoGhC,QAAA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAsE,CAAC;AAC5G,eAAe,+BAA+B,CAAC"}
@@ -1,30 +1,3 @@
1
- /// <reference path="../value-objects/pound.d.ts" />
2
- /// <reference path="../value-objects/sort-code.d.ts" />
3
- /// <reference types="mongoose/types/aggregate" />
4
- /// <reference types="mongoose/types/callback" />
5
- /// <reference types="mongoose/types/collection" />
6
- /// <reference types="mongoose/types/connection" />
7
- /// <reference types="mongoose/types/cursor" />
8
- /// <reference types="mongoose/types/document" />
9
- /// <reference types="mongoose/types/error" />
10
- /// <reference types="mongoose/types/expressions" />
11
- /// <reference types="mongoose/types/helpers" />
12
- /// <reference types="mongoose/types/middlewares" />
13
- /// <reference types="mongoose/types/indexes" />
14
- /// <reference types="mongoose/types/models" />
15
- /// <reference types="mongoose/types/mongooseoptions" />
16
- /// <reference types="mongoose/types/pipelinestage" />
17
- /// <reference types="mongoose/types/populate" />
18
- /// <reference types="mongoose/types/query" />
19
- /// <reference types="mongoose/types/schemaoptions" />
20
- /// <reference types="mongoose/types/schematypes" />
21
- /// <reference types="mongoose/types/session" />
22
- /// <reference types="mongoose/types/types" />
23
- /// <reference types="mongoose/types/utility" />
24
- /// <reference types="mongoose/types/validation" />
25
- /// <reference types="mongoose/types/virtuals" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import mongoose from "mongoose";
29
2
  declare const ApplicationRationaleModel: mongoose.Model<{
30
3
  applicationId: mongoose.Types.ObjectId;
@@ -1 +1 @@
1
- {"version":3,"file":"application-rationale.model.d.ts","sourceRoot":"","sources":["../../applications/application-rationale.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAuChC,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0D,CAAC;AAC1F,eAAe,yBAAyB,CAAC"}
1
+ {"version":3,"file":"application-rationale.model.d.ts","sourceRoot":"","sources":["../../applications/application-rationale.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAuChC,QAAA,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA0D,CAAC;AAC1F,eAAe,yBAAyB,CAAC"}
@@ -0,0 +1,38 @@
1
+ import mongoose from "mongoose";
2
+ const rationaleSchema = new mongoose.Schema({
3
+ applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true },
4
+ affordabilityDescription: { type: String, default: "" },
5
+ affordabilityAreaOfOfferCondition: { type: String, default: "" },
6
+ affordabilityAreaOfConcern: { type: String, default: "" },
7
+ affordabilityStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
8
+ applicantsDescription: { type: String, default: "" },
9
+ applicantsAreaOfOfferCondition: { type: String, default: "" },
10
+ applicantsAreaOfConcern: { type: String, default: "" },
11
+ applicantsStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
12
+ creditConductDescription: { type: String, default: "" },
13
+ creditConductAreaOfOfferCondition: { type: String, default: "" },
14
+ creditConductAreaOfConcern: { type: String, default: "" },
15
+ creditConductStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
16
+ fraudCheckDescription: { type: String, default: "" },
17
+ fraudCheckAreaOfOfferCondition: { type: String, default: "" },
18
+ fraudCheckAreaOfConcern: { type: String, default: "" },
19
+ fraudCheckStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
20
+ incomeSourceDescription: { type: String, default: "" },
21
+ incomeSourceAreaOfOfferCondition: { type: String, default: "" },
22
+ incomeSourceAreaOfConcern: { type: String, default: "" },
23
+ incomeSourceStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
24
+ loanDescription: { type: String, default: "" },
25
+ loanAreaOfOfferCondition: { type: String, default: "" },
26
+ loanAreaOfConcern: { type: String, default: "" },
27
+ loanStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
28
+ securityDescription: { type: String, default: "" },
29
+ securityAreaOfOfferCondition: { type: String, default: "" },
30
+ securityAreaOfConcern: { type: String, default: "" },
31
+ securityStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
32
+ propertyDescription: { type: String, default: "" },
33
+ propertyAreaOfOfferCondition: { type: String, default: "" },
34
+ propertyAreaOfConcern: { type: String, default: "" },
35
+ propertyStatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
36
+ });
37
+ const ApplicationRationaleModel = mongoose.model("ApplicationRationale", rationaleSchema);
38
+ export default ApplicationRationaleModel;
@@ -1,30 +1,3 @@
1
- /// <reference path="../value-objects/pound.d.ts" />
2
- /// <reference path="../value-objects/sort-code.d.ts" />
3
- /// <reference types="mongoose/types/aggregate" />
4
- /// <reference types="mongoose/types/callback" />
5
- /// <reference types="mongoose/types/collection" />
6
- /// <reference types="mongoose/types/connection" />
7
- /// <reference types="mongoose/types/cursor" />
8
- /// <reference types="mongoose/types/document" />
9
- /// <reference types="mongoose/types/error" />
10
- /// <reference types="mongoose/types/expressions" />
11
- /// <reference types="mongoose/types/helpers" />
12
- /// <reference types="mongoose/types/middlewares" />
13
- /// <reference types="mongoose/types/indexes" />
14
- /// <reference types="mongoose/types/models" />
15
- /// <reference types="mongoose/types/mongooseoptions" />
16
- /// <reference types="mongoose/types/pipelinestage" />
17
- /// <reference types="mongoose/types/populate" />
18
- /// <reference types="mongoose/types/query" />
19
- /// <reference types="mongoose/types/schemaoptions" />
20
- /// <reference types="mongoose/types/schematypes" />
21
- /// <reference types="mongoose/types/session" />
22
- /// <reference types="mongoose/types/types" />
23
- /// <reference types="mongoose/types/utility" />
24
- /// <reference types="mongoose/types/validation" />
25
- /// <reference types="mongoose/types/virtuals" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import mongoose from 'mongoose';
29
2
  declare const ApplicationRiskNarrativeModel: mongoose.Model<{
30
3
  call2StatusLid: mongoose.Types.ObjectId;
@@ -1 +1 @@
1
- {"version":3,"file":"application-risk-narrative.model.d.ts","sourceRoot":"","sources":["../../applications/application-risk-narrative.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAYhC,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA8E,CAAC;AAClH,eAAe,6BAA6B,CAAC"}
1
+ {"version":3,"file":"application-risk-narrative.model.d.ts","sourceRoot":"","sources":["../../applications/application-risk-narrative.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAYhC,QAAA,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA8E,CAAC;AAClH,eAAe,6BAA6B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import mongoose from 'mongoose';
2
+ const applicantionRiskNarrativeSchema = new mongoose.Schema({
3
+ call1RequestedOn: { type: String },
4
+ call2RequestedOn: { type: String },
5
+ call2StatusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
6
+ rationaleForRiskRating: { type: String },
7
+ retryCount: { type: String },
8
+ riskRating: { type: String },
9
+ statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", default: null },
10
+ });
11
+ const ApplicationRiskNarrativeModel = mongoose.model('ApplicationRiskNarrative', applicantionRiskNarrativeSchema);
12
+ export default ApplicationRiskNarrativeModel;
@@ -1,30 +1,3 @@
1
- /// <reference path="../value-objects/pound.d.ts" />
2
- /// <reference path="../value-objects/sort-code.d.ts" />
3
- /// <reference types="mongoose/types/aggregate" />
4
- /// <reference types="mongoose/types/callback" />
5
- /// <reference types="mongoose/types/collection" />
6
- /// <reference types="mongoose/types/connection" />
7
- /// <reference types="mongoose/types/cursor" />
8
- /// <reference types="mongoose/types/document" />
9
- /// <reference types="mongoose/types/error" />
10
- /// <reference types="mongoose/types/expressions" />
11
- /// <reference types="mongoose/types/helpers" />
12
- /// <reference types="mongoose/types/middlewares" />
13
- /// <reference types="mongoose/types/indexes" />
14
- /// <reference types="mongoose/types/models" />
15
- /// <reference types="mongoose/types/mongooseoptions" />
16
- /// <reference types="mongoose/types/pipelinestage" />
17
- /// <reference types="mongoose/types/populate" />
18
- /// <reference types="mongoose/types/query" />
19
- /// <reference types="mongoose/types/schemaoptions" />
20
- /// <reference types="mongoose/types/schematypes" />
21
- /// <reference types="mongoose/types/session" />
22
- /// <reference types="mongoose/types/types" />
23
- /// <reference types="mongoose/types/utility" />
24
- /// <reference types="mongoose/types/validation" />
25
- /// <reference types="mongoose/types/virtuals" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import mongoose from "mongoose";
29
2
  declare const valuationSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
30
3
  version: string;
@@ -1 +1 @@
1
- {"version":3,"file":"application-valuation.model.d.ts","sourceRoot":"","sources":["../../applications/application-valuation.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYnB,CAAC;AACH,eAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"application-valuation.model.d.ts","sourceRoot":"","sources":["../../applications/application-valuation.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAEhC,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYnB,CAAC;AACH,eAAe,eAAe,CAAC"}
@@ -0,0 +1,15 @@
1
+ import mongoose from "mongoose";
2
+ const valuationSchema = new mongoose.Schema({
3
+ amount: { type: String },
4
+ epcRating: { type: String, default: "" },
5
+ epcScore: { type: String },
6
+ estimatedRentalValue: { type: String },
7
+ instructionId: { type: String, default: "" },
8
+ instructionStatus: { type: String, default: "" },
9
+ instructionStatusComment: { type: String, default: "" },
10
+ isManual: { type: String, default: false },
11
+ squareMetres: { type: String },
12
+ valuerNotes: { type: String, default: "" },
13
+ version: { type: String, default: "" }
14
+ });
15
+ export default valuationSchema;
@@ -1,30 +1,3 @@
1
- /// <reference path="../value-objects/pound.d.ts" />
2
- /// <reference path="../value-objects/sort-code.d.ts" />
3
- /// <reference types="mongoose/types/aggregate" />
4
- /// <reference types="mongoose/types/callback" />
5
- /// <reference types="mongoose/types/collection" />
6
- /// <reference types="mongoose/types/connection" />
7
- /// <reference types="mongoose/types/cursor" />
8
- /// <reference types="mongoose/types/document" />
9
- /// <reference types="mongoose/types/error" />
10
- /// <reference types="mongoose/types/expressions" />
11
- /// <reference types="mongoose/types/helpers" />
12
- /// <reference types="mongoose/types/middlewares" />
13
- /// <reference types="mongoose/types/indexes" />
14
- /// <reference types="mongoose/types/models" />
15
- /// <reference types="mongoose/types/mongooseoptions" />
16
- /// <reference types="mongoose/types/pipelinestage" />
17
- /// <reference types="mongoose/types/populate" />
18
- /// <reference types="mongoose/types/query" />
19
- /// <reference types="mongoose/types/schemaoptions" />
20
- /// <reference types="mongoose/types/schematypes" />
21
- /// <reference types="mongoose/types/session" />
22
- /// <reference types="mongoose/types/types" />
23
- /// <reference types="mongoose/types/utility" />
24
- /// <reference types="mongoose/types/validation" />
25
- /// <reference types="mongoose/types/virtuals" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import mongoose from "mongoose";
29
2
  declare const ApplicationModel: mongoose.Model<{
30
3
  createdAt: NativeDate;
@@ -1 +1 @@
1
- {"version":3,"file":"application.model.d.ts","sourceRoot":"","sources":["../../applications/application.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA6KhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmD,CAAC;AAC1E,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"application.model.d.ts","sourceRoot":"","sources":["../../applications/application.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AA6KhC,QAAA,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAmD,CAAC;AAC1E,eAAe,gBAAgB,CAAC"}
@@ -0,0 +1,153 @@
1
+ import mongoose from "mongoose";
2
+ import creditProfileSchema from "./application-credit-profile.model";
3
+ const applicationSchema = new mongoose.Schema({
4
+ queueId: [{
5
+ type: mongoose.Schema.Types.ObjectId,
6
+ ref: "Queue",
7
+ required: true,
8
+ }],
9
+ assignedToUserId: { type: mongoose.Schema.Types.ObjectId, ref: "User" },
10
+ applicationId: { type: String, required: true },
11
+ isApplicationFeePaid: { type: String, required: true },
12
+ applicationNumber: { type: String, required: true },
13
+ applicationTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
14
+ bankSolicitor: { type: String, default: "" },
15
+ brokerId: { type: mongoose.Schema.Types.ObjectId, ref: "Broker", required: true },
16
+ caseManager: { type: String, default: "" },
17
+ caseManagerAccepted: { type: String, default: false },
18
+ completedReason: { type: String, default: "" },
19
+ isIntendToOccupy: { type: String, required: true },
20
+ introducer: { type: String, default: "" },
21
+ isIntroducerSubmission: { type: String, required: true },
22
+ isBrokerAssigned: { type: String, default: false },
23
+ isFinanceRecommendedToApplicant: { type: String, required: true },
24
+ isWorkflowTaskCreated: { type: String, required: true },
25
+ lastUpdated: { type: String },
26
+ lendingTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
27
+ networkClubName: { type: String, default: "" },
28
+ isNetworkClubSubmission: { type: String, required: true },
29
+ newReason: { type: String, default: "" },
30
+ purchaseTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
31
+ rejectedReason: { type: String, default: "" },
32
+ repaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
33
+ selectedProduct: { type: String, required: false },
34
+ sourceOfWealthLids: [{ type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true }],
35
+ sowBusiness: { type: String, default: "" },
36
+ sowInheritance: { type: String, default: "" },
37
+ sowOther: { type: String, default: "" },
38
+ sowProperty: { type: String, default: "" },
39
+ sowSalary: { type: String, default: "" },
40
+ statusLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup", required: true },
41
+ submitReason: { type: String, default: "" },
42
+ submittedDate: { type: String },
43
+ underwriter: { type: String, default: "" },
44
+ isValuationFeePaid: { type: String, required: true },
45
+ withdrawalReason: { type: String, default: "" },
46
+ withdrawalReasonCode: { type: String, default: "" },
47
+ productId: { type: mongoose.Schema.Types.ObjectId, ref: "Product", required: false },
48
+ product: { type: String },
49
+ securityId: { type: mongoose.Schema.Types.ObjectId, ref: "Security", required: true },
50
+ solicitorId: { type: mongoose.Schema.Types.ObjectId, ref: "Solicitor", required: true },
51
+ applicants: [
52
+ { type: mongoose.Schema.Types.ObjectId, ref: "Applicant" }
53
+ ],
54
+ isActive: { type: String, default: false },
55
+ isUkResident: { type: String, default: true },
56
+ riskRating: { type: String },
57
+ directDebitId: { type: mongoose.Schema.Types.ObjectId, ref: "Application_DirectDebit" },
58
+ creditProfile: creditProfileSchema,
59
+ mortgageId: { type: mongoose.Schema.Types.ObjectId, ref: "Mortgage" },
60
+ companyId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationCompany" },
61
+ rationaleId: { type: mongoose.Schema.Types.ObjectId, ref: "ApplicationRationale" },
62
+ newAuditRecordsCount: { type: String, default: 0 }, // Ensure it is a Number
63
+ currentApprivoAuditId: Number,
64
+ propertyIds: [{ type: mongoose.Schema.Types.ObjectId, ref: "Property" }]
65
+ }, {
66
+ timestamps: true,
67
+ toJSON: { virtuals: true },
68
+ toObject: { virtuals: true }
69
+ });
70
+ // Virtual property 'noOfApplicants'
71
+ applicationSchema.virtual('noOfApplicants').get(function () {
72
+ return this.applicants ? this.applicants.length : 0;
73
+ });
74
+ // Virtual property 'applicationTypeName'
75
+ applicationSchema.virtual('applicationTypeName').get(function () {
76
+ return this.applicationTypeLid instanceof mongoose.Types.ObjectId
77
+ ? null
78
+ : this.applicationTypeLid?.name ?? null;
79
+ });
80
+ // Virtual property 'lendingType'
81
+ applicationSchema.virtual('lendingType').get(function () {
82
+ return this.lendingTypeLid instanceof mongoose.Types.ObjectId
83
+ ? null
84
+ : this.lendingTypeLid?.name ?? null;
85
+ });
86
+ // Virtual property 'purchaseType'
87
+ applicationSchema.virtual('purchaseType').get(function () {
88
+ return this.purchaseTypeLid instanceof mongoose.Types.ObjectId
89
+ ? null
90
+ : this.purchaseTypeLid?.text ?? null;
91
+ });
92
+ // Virtual property 'status'
93
+ applicationSchema.virtual('status').get(function () {
94
+ return this.statusLid instanceof mongoose.Types.ObjectId ? null : this.statusLid?.name ?? null;
95
+ });
96
+ // Ensure the fields are populated when querying
97
+ applicationSchema.pre('find', function () {
98
+ this.populate('applicationTypeLid').populate('lendingTypeLid').populate('statusLid');
99
+ });
100
+ applicationSchema.pre('findOne', function () {
101
+ this.populate('applicationTypeLid').populate('lendingTypeLid').populate('statusLid');
102
+ });
103
+ // Virtual property 'LTV %'
104
+ applicationSchema.virtual('ltv').get(function () {
105
+ const purchasePrice = this.mortgageId?.purchasePrice;
106
+ const loanRequired = this.mortgageId?.loanRequired;
107
+ if (purchasePrice && loanRequired) {
108
+ const parseCurrency = (value) => {
109
+ if (typeof value === 'string') {
110
+ return parseFloat(value.replace(/[^0-9.-]+/g, ""));
111
+ }
112
+ return value;
113
+ };
114
+ const parsedPurchasePrice = parseCurrency(purchasePrice);
115
+ const parsedLoanRequired = parseCurrency(loanRequired);
116
+ const ltv = (parsedLoanRequired / parsedPurchasePrice) * 100;
117
+ return ltv.toFixed(2) + "%";
118
+ }
119
+ return null;
120
+ });
121
+ applicationSchema.virtual('submittedDateFormatted').get(function () {
122
+ if (!this.submittedDate)
123
+ return null;
124
+ const date = new Date(this.submittedDate);
125
+ const day = String(date.getDate()).padStart(2, '0');
126
+ const month = String(date.getMonth() + 1).padStart(2, '0');
127
+ const year = date.getFullYear();
128
+ return `${day}-${month}-${year}`;
129
+ });
130
+ // Virtual property for broker name
131
+ applicationSchema.virtual('brokerName').get(function () {
132
+ if (this.brokerId && typeof this.brokerId === 'object' && this.brokerId.firstName && this.brokerId.lastName) {
133
+ return this.brokerId.firstName + " " + this.brokerId.lastName;
134
+ }
135
+ return null;
136
+ });
137
+ applicationSchema.virtual('brokerEmail').get(function () {
138
+ return this.brokerId && typeof this.brokerId === 'object' ? this.brokerId.email : null;
139
+ });
140
+ applicationSchema.virtual('solicitorName').get(function () {
141
+ return this.solicitorId && typeof this.solicitorId === 'object' ? this.solicitorId.nameOfAccountHolder : null;
142
+ });
143
+ applicationSchema.virtual('solicitorEmail').get(function () {
144
+ return this.solicitorId && typeof this.solicitorId === 'object' ? this.solicitorId.email : null;
145
+ });
146
+ applicationSchema.virtual('brokerPhone').get(function () {
147
+ return this.brokerId && typeof this.brokerId === 'object' ? this.brokerId.mobileTelephone : null;
148
+ });
149
+ applicationSchema.virtual('solicitorPhone').get(function () {
150
+ return this.solicitorId && typeof this.solicitorId === 'object' ? this.solicitorId.telephone : null;
151
+ });
152
+ const ApplicationModel = mongoose.model("Application", applicationSchema);
153
+ export default ApplicationModel;
@@ -1,30 +1,3 @@
1
- /// <reference path="../value-objects/pound.d.ts" />
2
- /// <reference path="../value-objects/sort-code.d.ts" />
3
- /// <reference types="mongoose/types/aggregate" />
4
- /// <reference types="mongoose/types/callback" />
5
- /// <reference types="mongoose/types/collection" />
6
- /// <reference types="mongoose/types/connection" />
7
- /// <reference types="mongoose/types/cursor" />
8
- /// <reference types="mongoose/types/document" />
9
- /// <reference types="mongoose/types/error" />
10
- /// <reference types="mongoose/types/expressions" />
11
- /// <reference types="mongoose/types/helpers" />
12
- /// <reference types="mongoose/types/middlewares" />
13
- /// <reference types="mongoose/types/indexes" />
14
- /// <reference types="mongoose/types/models" />
15
- /// <reference types="mongoose/types/mongooseoptions" />
16
- /// <reference types="mongoose/types/pipelinestage" />
17
- /// <reference types="mongoose/types/populate" />
18
- /// <reference types="mongoose/types/query" />
19
- /// <reference types="mongoose/types/schemaoptions" />
20
- /// <reference types="mongoose/types/schematypes" />
21
- /// <reference types="mongoose/types/session" />
22
- /// <reference types="mongoose/types/types" />
23
- /// <reference types="mongoose/types/utility" />
24
- /// <reference types="mongoose/types/validation" />
25
- /// <reference types="mongoose/types/virtuals" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import mongoose from "mongoose";
29
2
  declare const BrokerModel: mongoose.Model<{
30
3
  createdAt: NativeDate;
@@ -1 +1 @@
1
- {"version":3,"file":"broker.model.d.ts","sourceRoot":"","sources":["../../applications/broker.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAwBhC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyC,CAAC;AAC3D,eAAe,WAAW,CAAC"}
1
+ {"version":3,"file":"broker.model.d.ts","sourceRoot":"","sources":["../../applications/broker.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAwBhC,QAAA,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAyC,CAAC;AAC3D,eAAe,WAAW,CAAC"}
@@ -0,0 +1,21 @@
1
+ import mongoose from "mongoose";
2
+ const brokerSchema = new mongoose.Schema({
3
+ brokerId: { type: String },
4
+ landlinePhone: { type: String },
5
+ mobileTelephone: { type: String },
6
+ addressPostCode: { type: String },
7
+ addressLine1: { type: String },
8
+ addressLine2: { type: String },
9
+ addressLine3: { type: String },
10
+ addressCity: { type: String },
11
+ addressCountry: { type: String },
12
+ tradingName: { type: String },
13
+ fcaNumber: { type: String },
14
+ brokerType: { type: String },
15
+ email: { type: String },
16
+ network: { type: String },
17
+ firstName: { type: String },
18
+ lastName: { type: String }
19
+ }, { timestamps: true });
20
+ const BrokerModel = mongoose.model("Broker", brokerSchema);
21
+ export default BrokerModel;
@@ -1,30 +1,3 @@
1
- /// <reference path="../value-objects/pound.d.ts" />
2
- /// <reference path="../value-objects/sort-code.d.ts" />
3
- /// <reference types="mongoose/types/aggregate" />
4
- /// <reference types="mongoose/types/callback" />
5
- /// <reference types="mongoose/types/collection" />
6
- /// <reference types="mongoose/types/connection" />
7
- /// <reference types="mongoose/types/cursor" />
8
- /// <reference types="mongoose/types/document" />
9
- /// <reference types="mongoose/types/error" />
10
- /// <reference types="mongoose/types/expressions" />
11
- /// <reference types="mongoose/types/helpers" />
12
- /// <reference types="mongoose/types/middlewares" />
13
- /// <reference types="mongoose/types/indexes" />
14
- /// <reference types="mongoose/types/models" />
15
- /// <reference types="mongoose/types/mongooseoptions" />
16
- /// <reference types="mongoose/types/pipelinestage" />
17
- /// <reference types="mongoose/types/populate" />
18
- /// <reference types="mongoose/types/query" />
19
- /// <reference types="mongoose/types/schemaoptions" />
20
- /// <reference types="mongoose/types/schematypes" />
21
- /// <reference types="mongoose/types/session" />
22
- /// <reference types="mongoose/types/types" />
23
- /// <reference types="mongoose/types/utility" />
24
- /// <reference types="mongoose/types/validation" />
25
- /// <reference types="mongoose/types/virtuals" />
26
- /// <reference types="mongoose/types/inferschematype" />
27
- /// <reference types="mongoose/types/inferrawdoctype" />
28
1
  import mongoose from "mongoose";
29
2
  declare const DocumentModel: mongoose.Model<{
30
3
  createdAt: NativeDate;
@@ -1 +1 @@
1
- {"version":3,"file":"document.model.d.ts","sourceRoot":"","sources":["../../applications/document.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAoChC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6C,CAAC;AACjE,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"document.model.d.ts","sourceRoot":"","sources":["../../applications/document.model.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAoChC,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA6C,CAAC;AACjE,eAAe,aAAa,CAAC"}