@dynamatix/gb-schemas 2.3.237 → 2.3.239

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 (252) hide show
  1. package/README.md +309 -0
  2. package/dist/applicants/applicant-additional-income.model.d.ts +13 -12
  3. package/dist/applicants/applicant-additional-income.model.d.ts.map +1 -1
  4. package/dist/applicants/applicant-additional-income.model.js +3 -0
  5. package/dist/applicants/applicant-commitment-creditCard.model.d.ts +19 -18
  6. package/dist/applicants/applicant-commitment-creditCard.model.d.ts.map +1 -1
  7. package/dist/applicants/applicant-commitment-creditCard.model.js +3 -0
  8. package/dist/applicants/applicant-commitment-loan.model.d.ts +19 -18
  9. package/dist/applicants/applicant-commitment-loan.model.d.ts.map +1 -1
  10. package/dist/applicants/applicant-commitment-loan.model.js +3 -0
  11. package/dist/applicants/applicant-commitment-mortgage.model.d.ts +19 -18
  12. package/dist/applicants/applicant-commitment-mortgage.model.d.ts.map +1 -1
  13. package/dist/applicants/applicant-commitment-mortgage.model.js +3 -0
  14. package/dist/applicants/applicant-commitment-residence.model.d.ts +31 -30
  15. package/dist/applicants/applicant-commitment-residence.model.d.ts.map +1 -1
  16. package/dist/applicants/applicant-commitment-residence.model.js +3 -0
  17. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts +19 -18
  18. package/dist/applicants/applicant-commitment-secureLoan.model.d.ts.map +1 -1
  19. package/dist/applicants/applicant-commitment-secureLoan.model.js +3 -0
  20. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts +19 -18
  21. package/dist/applicants/applicant-commitment-unsecuredLoan.model.d.ts.map +1 -1
  22. package/dist/applicants/applicant-commitment-unsecuredLoan.model.js +3 -0
  23. package/dist/applicants/applicant-credit-data.model.d.ts +3 -3
  24. package/dist/applicants/applicant-credit-report.model.d.ts +3754 -0
  25. package/dist/applicants/{applicant-income.model.d.ts.map → applicant-credit-report.model.d.ts.map} +1 -1
  26. package/dist/applicants/applicant-credit-report.model.js +116 -0
  27. package/dist/applicants/applicant-credit-report.type.d.ts +140 -0
  28. package/dist/applicants/applicant-credit-report.type.d.ts.map +1 -0
  29. package/dist/applicants/applicant-credit-report.type.js +1 -0
  30. package/dist/applicants/applicant-employment-income.model.d.ts +7 -6
  31. package/dist/applicants/applicant-employment-income.model.d.ts.map +1 -1
  32. package/dist/applicants/applicant-employment-income.model.js +3 -0
  33. package/dist/applicants/applicant-employment.model.d.ts +88 -87
  34. package/dist/applicants/applicant-employment.model.d.ts.map +1 -1
  35. package/dist/applicants/applicant-employment.model.js +19 -19
  36. package/dist/applicants/applicant-expenditure.model.d.ts +7 -0
  37. package/dist/applicants/applicant-expenditure.model.d.ts.map +1 -1
  38. package/dist/applicants/applicant-expenditure.model.js +77 -0
  39. package/dist/applicants/applicant-expenditure.type.d.ts +42 -0
  40. package/dist/applicants/applicant-expenditure.type.d.ts.map +1 -0
  41. package/dist/applicants/applicant-expenditure.type.js +1 -0
  42. package/dist/applicants/applicant-income-settings.model.d.ts.map +1 -1
  43. package/dist/applicants/applicant-income-settings.model.js +3 -0
  44. package/dist/applicants/applicant-income-settings.type.d.ts +40 -0
  45. package/dist/applicants/applicant-income-settings.type.d.ts.map +1 -0
  46. package/dist/applicants/applicant-income-settings.type.js +1 -0
  47. package/dist/applicants/applicant-income-summary.model.d.ts +73 -72
  48. package/dist/applicants/applicant-income-summary.model.d.ts.map +1 -1
  49. package/dist/applicants/applicant-income-summary.model.js +3 -0
  50. package/dist/applicants/applicant-income-summary.type.d.ts +60 -0
  51. package/dist/applicants/applicant-income-summary.type.d.ts.map +1 -0
  52. package/dist/applicants/applicant-income-summary.type.js +1 -0
  53. package/dist/applicants/applicant-pension-income.model.d.ts +19 -18
  54. package/dist/applicants/applicant-pension-income.model.d.ts.map +1 -1
  55. package/dist/applicants/applicant-pension-income.model.js +3 -0
  56. package/dist/applicants/applicant-pension-income.type.d.ts +40 -0
  57. package/dist/applicants/applicant-pension-income.type.d.ts.map +1 -0
  58. package/dist/applicants/applicant-pension-income.type.js +1 -0
  59. package/dist/applicants/applicant-property-income.model.d.ts +37 -36
  60. package/dist/applicants/applicant-property-income.model.d.ts.map +1 -1
  61. package/dist/applicants/applicant-property-income.model.js +3 -0
  62. package/dist/applicants/applicant-self-employed-income.model.d.ts +7 -6
  63. package/dist/applicants/applicant-self-employed-income.model.d.ts.map +1 -1
  64. package/dist/applicants/applicant-self-employed-income.model.js +3 -0
  65. package/dist/applicants/applicant-self-employed-income.type.d.ts +37 -0
  66. package/dist/applicants/applicant-self-employed-income.type.d.ts.map +1 -0
  67. package/dist/applicants/applicant-self-employed-income.type.js +1 -0
  68. package/dist/applicants/applicant-self-employment.model.d.ts +6 -6
  69. package/dist/applicants/applicant-self-employment.model.d.ts.map +1 -1
  70. package/dist/applicants/applicant-self-employment.model.js +4 -1
  71. package/dist/applicants/applicant-sole-trader-income.model.d.ts +7 -6
  72. package/dist/applicants/applicant-sole-trader-income.model.d.ts.map +1 -1
  73. package/dist/applicants/applicant-sole-trader-income.model.js +3 -0
  74. package/dist/applicants/applicant-sole-trader-income.type.d.ts +37 -0
  75. package/dist/applicants/applicant-sole-trader-income.type.d.ts.map +1 -0
  76. package/dist/applicants/applicant-sole-trader-income.type.js +1 -0
  77. package/dist/applicants/applicant-uk-tax-credits.model.d.ts +19 -18
  78. package/dist/applicants/applicant-uk-tax-credits.model.d.ts.map +1 -1
  79. package/dist/applicants/applicant-uk-tax-credits.model.js +3 -0
  80. package/dist/applicants/applicant-uk-tax-credits.type.d.ts +39 -0
  81. package/dist/applicants/applicant-uk-tax-credits.type.d.ts.map +1 -0
  82. package/dist/applicants/applicant-uk-tax-credits.type.js +1 -0
  83. package/dist/applicants/applicant-welcome-call.model.d.ts +288 -0
  84. package/dist/applicants/applicant-welcome-call.model.d.ts.map +1 -0
  85. package/dist/applicants/applicant-welcome-call.model.js +263 -0
  86. package/dist/applicants/applicant-welcome-call.type.d.ts +66 -0
  87. package/dist/applicants/applicant-welcome-call.type.d.ts.map +1 -0
  88. package/dist/applicants/applicant-welcome-call.type.js +1 -0
  89. package/dist/applicants/applicant.model.d.ts +49 -42
  90. package/dist/applicants/applicant.model.d.ts.map +1 -1
  91. package/dist/applicants/applicant.model.js +5 -1
  92. package/dist/applicants/applicant.type.d.ts +158 -0
  93. package/dist/applicants/applicant.type.d.ts.map +1 -0
  94. package/dist/applicants/applicant.type.js +1 -0
  95. package/dist/applicants/index.d.ts +14 -0
  96. package/dist/applicants/index.d.ts.map +1 -1
  97. package/dist/applicants/index.js +2 -0
  98. package/dist/applications/application-audit.model.d.ts +6 -6
  99. package/dist/applications/application-audit.model.d.ts.map +1 -1
  100. package/dist/applications/application-audit.model.js +3 -0
  101. package/dist/applications/application-checklist-Item.model.d.ts +6 -0
  102. package/dist/applications/application-checklist-Item.model.d.ts.map +1 -1
  103. package/dist/applications/application-checklist-Item.model.js +4 -0
  104. package/dist/applications/application-company-model.d.ts +64 -57
  105. package/dist/applications/application-company-model.d.ts.map +1 -1
  106. package/dist/applications/application-company-model.js +1 -0
  107. package/dist/applications/application-direct-debit.model.d.ts +29 -27
  108. package/dist/applications/application-direct-debit.model.d.ts.map +1 -1
  109. package/dist/applications/application-direct-debit.model.js +3 -0
  110. package/dist/applications/application-euc.model.d.ts.map +1 -1
  111. package/dist/applications/application-euc.model.js +3 -0
  112. package/dist/applications/application-fieldconfig.model.d.ts.map +1 -1
  113. package/dist/applications/application-fieldconfig.model.js +3 -0
  114. package/dist/applications/application-legal.model.d.ts.map +1 -1
  115. package/dist/applications/application-legal.model.js +3 -0
  116. package/dist/applications/application-mortgage.model.d.ts +1 -0
  117. package/dist/applications/application-mortgage.model.d.ts.map +1 -1
  118. package/dist/applications/application-mortgage.model.js +3 -0
  119. package/dist/applications/application-mortgage.type.d.ts +76 -0
  120. package/dist/applications/application-mortgage.type.d.ts.map +1 -0
  121. package/dist/applications/application-mortgage.type.js +1 -0
  122. package/dist/applications/application-note.model.d.ts +36 -24
  123. package/dist/applications/application-note.model.d.ts.map +1 -1
  124. package/dist/applications/application-note.model.js +12 -3
  125. package/dist/applications/application-note.type.d.ts +55 -0
  126. package/dist/applications/application-note.type.d.ts.map +1 -0
  127. package/dist/applications/application-note.type.js +1 -0
  128. package/dist/applications/application-offer.model.d.ts.map +1 -1
  129. package/dist/applications/application-offer.model.js +3 -0
  130. package/dist/applications/application-onboarding.model.d.ts.map +1 -1
  131. package/dist/applications/application-onboarding.model.js +3 -0
  132. package/dist/applications/application-product.model.d.ts +77 -13
  133. package/dist/applications/application-product.model.d.ts.map +1 -1
  134. package/dist/applications/application-product.model.js +16 -3
  135. package/dist/applications/application-product.type.d.ts +58 -0
  136. package/dist/applications/application-product.type.d.ts.map +1 -0
  137. package/dist/applications/application-product.type.js +1 -0
  138. package/dist/applications/application-productfeatures.model.d.ts +12 -6
  139. package/dist/applications/application-productfeatures.model.d.ts.map +1 -1
  140. package/dist/applications/application-productfeatures.model.js +5 -1
  141. package/dist/applications/application-productfeatures.type.d.ts +125 -0
  142. package/dist/applications/application-productfeatures.type.d.ts.map +1 -0
  143. package/dist/applications/application-productfeatures.type.js +1 -0
  144. package/dist/applications/application-rationale.model.d.ts +6 -12
  145. package/dist/applications/application-rationale.model.d.ts.map +1 -1
  146. package/dist/applications/application-rationale.model.js +11 -20
  147. package/dist/applications/application-rationale.type.d.ts +7 -7
  148. package/dist/applications/application-rationale.type.d.ts.map +1 -1
  149. package/dist/applications/application-risk-narrative.model.d.ts.map +1 -1
  150. package/dist/applications/application-risk-narrative.model.js +3 -0
  151. package/dist/applications/application-valuation-report.model.d.ts +1246 -0
  152. package/dist/applications/application-valuation-report.model.d.ts.map +1 -0
  153. package/dist/applications/application-valuation-report.model.js +269 -0
  154. package/dist/applications/application-valuation-report.type.d.ts +108 -0
  155. package/dist/applications/application-valuation-report.type.d.ts.map +1 -0
  156. package/dist/applications/application-valuation-report.type.js +1 -0
  157. package/dist/applications/application-valuation.model.d.ts +695 -18
  158. package/dist/applications/application-valuation.model.d.ts.map +1 -1
  159. package/dist/applications/application-valuation.model.js +33 -7
  160. package/dist/applications/application-valuation.type.d.ts +54 -0
  161. package/dist/applications/application-valuation.type.d.ts.map +1 -0
  162. package/dist/applications/application-valuation.type.js +1 -0
  163. package/dist/applications/application.model.d.ts +36 -30
  164. package/dist/applications/application.model.d.ts.map +1 -1
  165. package/dist/applications/application.model.js +17 -4
  166. package/dist/applications/applications-task.model.d.ts +171 -67
  167. package/dist/applications/applications-task.model.d.ts.map +1 -1
  168. package/dist/applications/applications-task.model.js +36 -45
  169. package/dist/applications/applications-task.type.d.ts +57 -0
  170. package/dist/applications/applications-task.type.d.ts.map +1 -0
  171. package/dist/applications/applications-task.type.js +1 -0
  172. package/dist/applications/broker.model.d.ts.map +1 -1
  173. package/dist/applications/broker.model.js +3 -0
  174. package/dist/applications/index.d.ts +10 -3
  175. package/dist/applications/index.d.ts.map +1 -1
  176. package/dist/applications/index.js +2 -3
  177. package/dist/applications/solicitor.model.d.ts +2 -0
  178. package/dist/applications/solicitor.model.d.ts.map +1 -1
  179. package/dist/applications/solicitor.model.js +3 -0
  180. package/dist/index.d.ts +1 -0
  181. package/dist/index.d.ts.map +1 -1
  182. package/dist/index.js +2 -0
  183. package/dist/product-catalogues/index.d.ts +3 -0
  184. package/dist/product-catalogues/index.d.ts.map +1 -1
  185. package/dist/product-catalogues/product-catalogue.type.d.ts +15 -0
  186. package/dist/product-catalogues/product-catalogue.type.d.ts.map +1 -0
  187. package/dist/product-catalogues/product-catalogue.type.js +1 -0
  188. package/dist/product-catalogues/product-definitions.type.d.ts +53 -0
  189. package/dist/product-catalogues/product-definitions.type.d.ts.map +1 -0
  190. package/dist/product-catalogues/product-definitions.type.js +1 -0
  191. package/dist/product-catalogues/product-variant.type.d.ts +38 -0
  192. package/dist/product-catalogues/product-variant.type.d.ts.map +1 -0
  193. package/dist/product-catalogues/product-variant.type.js +1 -0
  194. package/dist/properties/property.model.d.ts +52 -51
  195. package/dist/properties/property.model.d.ts.map +1 -1
  196. package/dist/properties/property.model.js +1 -2
  197. package/dist/properties/security.model.d.ts +6 -0
  198. package/dist/properties/security.model.d.ts.map +1 -1
  199. package/dist/properties/security.model.js +1 -0
  200. package/dist/shared/alert.model.d.ts +12 -12
  201. package/dist/shared/api-log.model.d.ts +118 -0
  202. package/dist/shared/api-log.model.d.ts.map +1 -0
  203. package/dist/shared/api-log.model.js +21 -0
  204. package/dist/shared/apprivo-sync-journey.model.d.ts +6 -6
  205. package/dist/shared/checklist.model.d.ts +6 -6
  206. package/dist/shared/index.d.ts +5 -1
  207. package/dist/shared/index.d.ts.map +1 -1
  208. package/dist/shared/index.js +4 -1
  209. package/dist/shared/job-setting.model.d.ts +6 -6
  210. package/dist/shared/lookup-group.model.d.ts +25 -25
  211. package/dist/shared/lookup-group.model.d.ts.map +1 -1
  212. package/dist/shared/lookup-group.model.js +3 -0
  213. package/dist/shared/schema-doc.model.d.ts +6 -6
  214. package/dist/shared/system-parameter.model.d.ts +6 -6
  215. package/dist/shared/task-document.model.d.ts +6 -6
  216. package/dist/shared/task.model.d.ts +6 -6
  217. package/dist/shared/{document-type-model.d.ts → webhook-event.model.d.ts} +6 -45
  218. package/dist/shared/webhook-event.model.d.ts.map +1 -0
  219. package/dist/shared/webhook-event.model.js +53 -0
  220. package/dist/shared/webhook-event.type.d.ts +15 -0
  221. package/dist/shared/webhook-event.type.d.ts.map +1 -0
  222. package/dist/shared/webhook-event.type.js +1 -0
  223. package/dist/shared/workflow-trigger.model.d.ts +32 -0
  224. package/dist/shared/workflow-trigger.model.d.ts.map +1 -0
  225. package/dist/shared/workflow-trigger.model.js +45 -0
  226. package/dist/shared/workflow-trigger.type.d.ts +59 -0
  227. package/dist/shared/workflow-trigger.type.d.ts.map +1 -0
  228. package/dist/shared/workflow-trigger.type.js +1 -0
  229. package/dist/shared/workflow.init.d.ts +21 -0
  230. package/dist/shared/workflow.init.d.ts.map +1 -0
  231. package/dist/shared/workflow.init.js +41 -0
  232. package/dist/shared/workflow.middleware.d.ts +107 -0
  233. package/dist/shared/workflow.middleware.d.ts.map +1 -0
  234. package/dist/shared/workflow.middleware.js +230 -0
  235. package/dist/shared/workflow.plugin.d.ts +46 -0
  236. package/dist/shared/workflow.plugin.d.ts.map +1 -0
  237. package/dist/shared/workflow.plugin.js +102 -0
  238. package/dist/shared/workflow.service.d.ts +39 -0
  239. package/dist/shared/workflow.service.d.ts.map +1 -0
  240. package/dist/shared/workflow.service.js +115 -0
  241. package/dist/value-objects/pound.d.ts.map +1 -1
  242. package/package.json +14 -3
  243. package/dist/applicants/applicant-income.model.d.ts +0 -2558
  244. package/dist/applicants/applicant-income.model.js +0 -82
  245. package/dist/applications/application-document.model.d.ts +0 -186
  246. package/dist/applications/application-document.model.d.ts.map +0 -1
  247. package/dist/applications/application-document.model.js +0 -35
  248. package/dist/applications/document.model.d.ts +0 -186
  249. package/dist/applications/document.model.d.ts.map +0 -1
  250. package/dist/applications/document.model.js +0 -35
  251. package/dist/shared/document-type-model.d.ts.map +0 -1
  252. package/dist/shared/document-type-model.js +0 -10
@@ -1,6 +1,9 @@
1
1
  import mongoose from "mongoose";
2
+ import { applyWorkflowPlugin } from "../shared/workflow.plugin";
2
3
  const offerSchema = new mongoose.Schema({
3
4
  date: { type: String } // The date associated with the offer
4
5
  });
6
+ // Apply workflow plugin to the schema
7
+ applyWorkflowPlugin(offerSchema, 'offer');
5
8
  const OfferModel = mongoose.model("Offer", offerSchema);
6
9
  export default OfferModel;
@@ -1 +1 @@
1
- {"version":3,"file":"application-onboarding.model.d.ts","sourceRoot":"","sources":["../../applications/application-onboarding.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAUhC,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAC7F,eAAe,0BAA0B,CAAC"}
1
+ {"version":3,"file":"application-onboarding.model.d.ts","sourceRoot":"","sources":["../../applications/application-onboarding.model.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAkBhC,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4D,CAAC;AAC7F,eAAe,0BAA0B,CAAC"}
@@ -1,9 +1,12 @@
1
1
  import mongoose from "mongoose";
2
+ import { applyWorkflowPlugin } from "../shared/workflow.plugin";
2
3
  const onboardingSchema = new mongoose.Schema({
3
4
  errors: { type: String, default: "" },
4
5
  status: { type: String, default: "" },
5
6
  statusDate: { type: String },
6
7
  warnings: { type: String, default: "" }
7
8
  });
9
+ // Apply workflow plugin to the schema
10
+ applyWorkflowPlugin(onboardingSchema, 'applicationonboarding');
8
11
  const ApplicationOnboardingModel = mongoose.model("ApplicationOnboarding", onboardingSchema);
9
12
  export default ApplicationOnboardingModel;
@@ -28,9 +28,15 @@
28
28
  /// <reference types="mongoose/types/inferrawdoctype" />
29
29
  import mongoose from "mongoose";
30
30
  declare const ProductModel: mongoose.Model<{
31
+ createdAt: NativeDate;
32
+ updatedAt: NativeDate;
33
+ } & {
31
34
  selectedProduct: string;
35
+ networkClubSubmission: boolean;
36
+ introducerSubmission: boolean;
32
37
  applicationId?: unknown;
33
38
  pageValidFlag?: unknown;
39
+ topSlicing?: unknown;
34
40
  repaymentTypeLid?: unknown;
35
41
  lendingTypeLid?: unknown;
36
42
  numberOfYearsToRepay?: unknown;
@@ -38,17 +44,26 @@ declare const ProductModel: mongoose.Model<{
38
44
  fixedAmount?: unknown;
39
45
  isFinanceRecommendedToApplicantLid?: unknown;
40
46
  procFeeRateLid?: unknown;
41
- networkClubSubmission?: unknown;
42
47
  clubNetworkNameLid?: unknown;
43
- introducerSubmission?: unknown;
44
48
  introducer?: unknown;
45
49
  bdm?: unknown;
50
+ fcr?: unknown;
51
+ fscr?: unknown;
52
+ topUpAmount?: unknown;
46
53
  tempAppFee?: unknown;
47
54
  productFeePaymentTypeLid?: unknown;
55
+ overriddenRulesApproverLid?: unknown;
56
+ overrideRuleComments?: unknown;
48
57
  }, {}, {}, {}, mongoose.Document<unknown, {}, {
58
+ createdAt: NativeDate;
59
+ updatedAt: NativeDate;
60
+ } & {
49
61
  selectedProduct: string;
62
+ networkClubSubmission: boolean;
63
+ introducerSubmission: boolean;
50
64
  applicationId?: unknown;
51
65
  pageValidFlag?: unknown;
66
+ topSlicing?: unknown;
52
67
  repaymentTypeLid?: unknown;
53
68
  lendingTypeLid?: unknown;
54
69
  numberOfYearsToRepay?: unknown;
@@ -56,17 +71,26 @@ declare const ProductModel: mongoose.Model<{
56
71
  fixedAmount?: unknown;
57
72
  isFinanceRecommendedToApplicantLid?: unknown;
58
73
  procFeeRateLid?: unknown;
59
- networkClubSubmission?: unknown;
60
74
  clubNetworkNameLid?: unknown;
61
- introducerSubmission?: unknown;
62
75
  introducer?: unknown;
63
76
  bdm?: unknown;
77
+ fcr?: unknown;
78
+ fscr?: unknown;
79
+ topUpAmount?: unknown;
64
80
  tempAppFee?: unknown;
65
81
  productFeePaymentTypeLid?: unknown;
82
+ overriddenRulesApproverLid?: unknown;
83
+ overrideRuleComments?: unknown;
66
84
  }, {}> & {
85
+ createdAt: NativeDate;
86
+ updatedAt: NativeDate;
87
+ } & {
67
88
  selectedProduct: string;
89
+ networkClubSubmission: boolean;
90
+ introducerSubmission: boolean;
68
91
  applicationId?: unknown;
69
92
  pageValidFlag?: unknown;
93
+ topSlicing?: unknown;
70
94
  repaymentTypeLid?: unknown;
71
95
  lendingTypeLid?: unknown;
72
96
  numberOfYearsToRepay?: unknown;
@@ -74,21 +98,40 @@ declare const ProductModel: mongoose.Model<{
74
98
  fixedAmount?: unknown;
75
99
  isFinanceRecommendedToApplicantLid?: unknown;
76
100
  procFeeRateLid?: unknown;
77
- networkClubSubmission?: unknown;
78
101
  clubNetworkNameLid?: unknown;
79
- introducerSubmission?: unknown;
80
102
  introducer?: unknown;
81
103
  bdm?: unknown;
104
+ fcr?: unknown;
105
+ fscr?: unknown;
106
+ topUpAmount?: unknown;
82
107
  tempAppFee?: unknown;
83
108
  productFeePaymentTypeLid?: unknown;
109
+ overriddenRulesApproverLid?: unknown;
110
+ overrideRuleComments?: unknown;
84
111
  } & {
85
112
  _id: mongoose.Types.ObjectId;
86
113
  } & {
87
114
  __v: number;
88
- }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
115
+ }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
116
+ timestamps: true;
117
+ toJSON: {
118
+ virtuals: true;
119
+ getters: true;
120
+ };
121
+ toObject: {
122
+ virtuals: true;
123
+ getters: true;
124
+ };
125
+ }, {
126
+ createdAt: NativeDate;
127
+ updatedAt: NativeDate;
128
+ } & {
89
129
  selectedProduct: string;
130
+ networkClubSubmission: boolean;
131
+ introducerSubmission: boolean;
90
132
  applicationId?: unknown;
91
133
  pageValidFlag?: unknown;
134
+ topSlicing?: unknown;
92
135
  repaymentTypeLid?: unknown;
93
136
  lendingTypeLid?: unknown;
94
137
  numberOfYearsToRepay?: unknown;
@@ -96,17 +139,26 @@ declare const ProductModel: mongoose.Model<{
96
139
  fixedAmount?: unknown;
97
140
  isFinanceRecommendedToApplicantLid?: unknown;
98
141
  procFeeRateLid?: unknown;
99
- networkClubSubmission?: unknown;
100
142
  clubNetworkNameLid?: unknown;
101
- introducerSubmission?: unknown;
102
143
  introducer?: unknown;
103
144
  bdm?: unknown;
145
+ fcr?: unknown;
146
+ fscr?: unknown;
147
+ topUpAmount?: unknown;
104
148
  tempAppFee?: unknown;
105
149
  productFeePaymentTypeLid?: unknown;
150
+ overriddenRulesApproverLid?: unknown;
151
+ overrideRuleComments?: unknown;
106
152
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
153
+ createdAt: NativeDate;
154
+ updatedAt: NativeDate;
155
+ } & {
107
156
  selectedProduct: string;
157
+ networkClubSubmission: boolean;
158
+ introducerSubmission: boolean;
108
159
  applicationId?: unknown;
109
160
  pageValidFlag?: unknown;
161
+ topSlicing?: unknown;
110
162
  repaymentTypeLid?: unknown;
111
163
  lendingTypeLid?: unknown;
112
164
  numberOfYearsToRepay?: unknown;
@@ -114,17 +166,26 @@ declare const ProductModel: mongoose.Model<{
114
166
  fixedAmount?: unknown;
115
167
  isFinanceRecommendedToApplicantLid?: unknown;
116
168
  procFeeRateLid?: unknown;
117
- networkClubSubmission?: unknown;
118
169
  clubNetworkNameLid?: unknown;
119
- introducerSubmission?: unknown;
120
170
  introducer?: unknown;
121
171
  bdm?: unknown;
172
+ fcr?: unknown;
173
+ fscr?: unknown;
174
+ topUpAmount?: unknown;
122
175
  tempAppFee?: unknown;
123
176
  productFeePaymentTypeLid?: unknown;
177
+ overriddenRulesApproverLid?: unknown;
178
+ overrideRuleComments?: unknown;
124
179
  }>, {}> & mongoose.FlatRecord<{
180
+ createdAt: NativeDate;
181
+ updatedAt: NativeDate;
182
+ } & {
125
183
  selectedProduct: string;
184
+ networkClubSubmission: boolean;
185
+ introducerSubmission: boolean;
126
186
  applicationId?: unknown;
127
187
  pageValidFlag?: unknown;
188
+ topSlicing?: unknown;
128
189
  repaymentTypeLid?: unknown;
129
190
  lendingTypeLid?: unknown;
130
191
  numberOfYearsToRepay?: unknown;
@@ -132,13 +193,16 @@ declare const ProductModel: mongoose.Model<{
132
193
  fixedAmount?: unknown;
133
194
  isFinanceRecommendedToApplicantLid?: unknown;
134
195
  procFeeRateLid?: unknown;
135
- networkClubSubmission?: unknown;
136
196
  clubNetworkNameLid?: unknown;
137
- introducerSubmission?: unknown;
138
197
  introducer?: unknown;
139
198
  bdm?: unknown;
199
+ fcr?: unknown;
200
+ fscr?: unknown;
201
+ topUpAmount?: unknown;
140
202
  tempAppFee?: unknown;
141
203
  productFeePaymentTypeLid?: unknown;
204
+ overriddenRulesApproverLid?: unknown;
205
+ overrideRuleComments?: unknown;
142
206
  }> & {
143
207
  _id: mongoose.Types.ObjectId;
144
208
  } & {
@@ -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;AA0EhC,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;AA4FhC,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA2C,CAAC;AAC9D,eAAe,YAAY,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import mongoose from "mongoose";
2
+ import { applyWorkflowPlugin } from "../shared/workflow.plugin";
2
3
  import { Pound, formatPound } from "../value-objects/pound";
3
4
  const productSchema = new mongoose.Schema({
4
5
  applicationId: {
@@ -14,13 +15,23 @@ const productSchema = new mongoose.Schema({
14
15
  fixedAmount: { type: Pound, default: 0.00, required: false, get: formatPound },
15
16
  isFinanceRecommendedToApplicantLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
16
17
  procFeeRateLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
17
- networkClubSubmission: { type: Boolean, required: true, get: (value) => (value ? "Yes" : "No") },
18
+ networkClubSubmission: { type: Boolean, required: true },
18
19
  clubNetworkNameLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
19
- introducerSubmission: { type: Boolean, required: true, get: (value) => (value ? "Yes" : "No") },
20
+ introducerSubmission: { type: Boolean, required: true },
20
21
  introducer: { type: String, default: '' },
21
22
  bdm: { type: String, required: true, default: '' },
23
+ topSlicing: { type: Boolean, default: false },
24
+ fcr: { type: Pound, default: 0.00, required: false, get: formatPound },
25
+ fscr: { type: String, default: '' },
26
+ topUpAmount: { type: Pound, default: 0.00, required: false, get: formatPound },
22
27
  tempAppFee: { type: Pound, default: 0.00, required: true, get: formatPound },
23
- productFeePaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" }
28
+ productFeePaymentTypeLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
29
+ overriddenRulesApproverLid: { type: mongoose.Schema.Types.ObjectId, ref: "Lookup" },
30
+ overrideRuleComments: { type: String, default: '' }
31
+ }, {
32
+ timestamps: true,
33
+ toJSON: { virtuals: true, getters: true },
34
+ toObject: { virtuals: true, getters: true }
24
35
  });
25
36
  // virtual property 'lendingType'
26
37
  productSchema.virtual('lendingType').get(function () {
@@ -64,5 +75,7 @@ productSchema.virtual('productFeePaymentType').get(function () {
64
75
  ? null
65
76
  : productFeePaymentType?.name || null;
66
77
  });
78
+ // Apply workflow plugin to the schema
79
+ applyWorkflowPlugin(productSchema, 'product');
67
80
  const ProductModel = mongoose.model("Product", productSchema);
68
81
  export default ProductModel;
@@ -0,0 +1,58 @@
1
+ /// <reference path="../value-objects/pound.d.ts" />
2
+ /// <reference path="../value-objects/account-number.d.ts" />
3
+ /// <reference path="../value-objects/sort-code.d.ts" />
4
+ /// <reference types="mongoose/types/aggregate" />
5
+ /// <reference types="mongoose/types/callback" />
6
+ /// <reference types="mongoose/types/collection" />
7
+ /// <reference types="mongoose/types/connection" />
8
+ /// <reference types="mongoose/types/cursor" />
9
+ /// <reference types="mongoose/types/document" />
10
+ /// <reference types="mongoose/types/error" />
11
+ /// <reference types="mongoose/types/expressions" />
12
+ /// <reference types="mongoose/types/helpers" />
13
+ /// <reference types="mongoose/types/middlewares" />
14
+ /// <reference types="mongoose/types/indexes" />
15
+ /// <reference types="mongoose/types/models" />
16
+ /// <reference types="mongoose/types/mongooseoptions" />
17
+ /// <reference types="mongoose/types/pipelinestage" />
18
+ /// <reference types="mongoose/types/populate" />
19
+ /// <reference types="mongoose/types/query" />
20
+ /// <reference types="mongoose/types/schemaoptions" />
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/schematypes" />
27
+ /// <reference types="mongoose/types/inferschematype" />
28
+ /// <reference types="mongoose/types/inferrawdoctype" />
29
+ import { Types } from "mongoose";
30
+ import { IBaseType } from "../types/base.types";
31
+ export default interface IApplicationProduct extends IBaseType {
32
+ applicationId: Types.ObjectId;
33
+ selectedProduct?: string;
34
+ lendingTypeLid?: Types.ObjectId | null;
35
+ pageValidFlag?: boolean;
36
+ repaymentTypeLid?: Types.ObjectId | null;
37
+ numberOfYearsToRepay?: number;
38
+ repaymentVehicle: string;
39
+ fixedAmount?: number;
40
+ isFinanceRecommendedToApplicantLid?: Types.ObjectId | null;
41
+ procFeeRateLid?: Types.ObjectId | null;
42
+ networkClubSubmission: boolean;
43
+ clubNetworkNameLid?: Types.ObjectId | null;
44
+ introducerSubmission: boolean;
45
+ introducer?: string;
46
+ bdm: string;
47
+ tempAppFee: number;
48
+ productFeePaymentTypeLid?: Types.ObjectId | null;
49
+ overriddenRulesApproverLid?: Types.ObjectId | null;
50
+ overrideRuleComments?: string;
51
+ lendingType?: string | null;
52
+ repaymentType?: string | null;
53
+ isFinanceRecommendedToApplicant?: string | null;
54
+ procFeeRate?: string | null;
55
+ clubNetworkName?: string | null;
56
+ productFeePaymentType?: string | null;
57
+ }
58
+ //# sourceMappingURL=application-product.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application-product.type.d.ts","sourceRoot":"","sources":["../../applications/application-product.type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,MAAM,CAAC,OAAO,WAAW,mBAAoB,SAAQ,SAAS;IAC1D,aAAa,EAAE,KAAK,CAAC,QAAQ,CAAC;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,gBAAgB,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IACzC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kCAAkC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3D,cAAc,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IACvC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kBAAkB,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IAC3C,oBAAoB,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,wBAAwB,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IACjD,0BAA0B,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;IACnD,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAG9B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,+BAA+B,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,qBAAqB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -28,7 +28,6 @@
28
28
  /// <reference types="mongoose/types/inferrawdoctype" />
29
29
  import mongoose from "mongoose";
30
30
  declare const ApplicationProductFeaturesModel: mongoose.Model<{
31
- name: string;
32
31
  applicationId: mongoose.Types.ObjectId;
33
32
  repaymentType: string;
34
33
  ltv: string;
@@ -41,6 +40,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
41
40
  variableRepayment: string;
42
41
  reversionRateWithoutBaseRate: string;
43
42
  totalReversionRate: string;
43
+ reversionRate: string;
44
44
  initialRate: string;
45
45
  fixedTerm: string;
46
46
  fixedTermEndDate: string;
@@ -101,6 +101,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
101
101
  icr: string;
102
102
  ufssProductCode: string;
103
103
  ufssInterestRateCode: string;
104
+ name?: string | null | undefined;
104
105
  calculations?: {
105
106
  ltv: string;
106
107
  rentalCoverageRatioRate: string;
@@ -149,7 +150,6 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
149
150
  } | null | undefined;
150
151
  } | null | undefined;
151
152
  }, {}, {}, {}, mongoose.Document<unknown, {}, {
152
- name: string;
153
153
  applicationId: mongoose.Types.ObjectId;
154
154
  repaymentType: string;
155
155
  ltv: string;
@@ -162,6 +162,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
162
162
  variableRepayment: string;
163
163
  reversionRateWithoutBaseRate: string;
164
164
  totalReversionRate: string;
165
+ reversionRate: string;
165
166
  initialRate: string;
166
167
  fixedTerm: string;
167
168
  fixedTermEndDate: string;
@@ -222,6 +223,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
222
223
  icr: string;
223
224
  ufssProductCode: string;
224
225
  ufssInterestRateCode: string;
226
+ name?: string | null | undefined;
225
227
  calculations?: {
226
228
  ltv: string;
227
229
  rentalCoverageRatioRate: string;
@@ -270,7 +272,6 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
270
272
  } | null | undefined;
271
273
  } | null | undefined;
272
274
  }, {}> & {
273
- name: string;
274
275
  applicationId: mongoose.Types.ObjectId;
275
276
  repaymentType: string;
276
277
  ltv: string;
@@ -283,6 +284,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
283
284
  variableRepayment: string;
284
285
  reversionRateWithoutBaseRate: string;
285
286
  totalReversionRate: string;
287
+ reversionRate: string;
286
288
  initialRate: string;
287
289
  fixedTerm: string;
288
290
  fixedTermEndDate: string;
@@ -343,6 +345,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
343
345
  icr: string;
344
346
  ufssProductCode: string;
345
347
  ufssInterestRateCode: string;
348
+ name?: string | null | undefined;
346
349
  calculations?: {
347
350
  ltv: string;
348
351
  rentalCoverageRatioRate: string;
@@ -395,7 +398,6 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
395
398
  } & {
396
399
  __v: number;
397
400
  }, mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
398
- name: string;
399
401
  applicationId: mongoose.Types.ObjectId;
400
402
  repaymentType: string;
401
403
  ltv: string;
@@ -408,6 +410,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
408
410
  variableRepayment: string;
409
411
  reversionRateWithoutBaseRate: string;
410
412
  totalReversionRate: string;
413
+ reversionRate: string;
411
414
  initialRate: string;
412
415
  fixedTerm: string;
413
416
  fixedTermEndDate: string;
@@ -468,6 +471,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
468
471
  icr: string;
469
472
  ufssProductCode: string;
470
473
  ufssInterestRateCode: string;
474
+ name?: string | null | undefined;
471
475
  calculations?: {
472
476
  ltv: string;
473
477
  rentalCoverageRatioRate: string;
@@ -516,7 +520,6 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
516
520
  } | null | undefined;
517
521
  } | null | undefined;
518
522
  }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
519
- name: string;
520
523
  applicationId: mongoose.Types.ObjectId;
521
524
  repaymentType: string;
522
525
  ltv: string;
@@ -529,6 +532,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
529
532
  variableRepayment: string;
530
533
  reversionRateWithoutBaseRate: string;
531
534
  totalReversionRate: string;
535
+ reversionRate: string;
532
536
  initialRate: string;
533
537
  fixedTerm: string;
534
538
  fixedTermEndDate: string;
@@ -589,6 +593,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
589
593
  icr: string;
590
594
  ufssProductCode: string;
591
595
  ufssInterestRateCode: string;
596
+ name?: string | null | undefined;
592
597
  calculations?: {
593
598
  ltv: string;
594
599
  rentalCoverageRatioRate: string;
@@ -637,7 +642,6 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
637
642
  } | null | undefined;
638
643
  } | null | undefined;
639
644
  }>, {}> & mongoose.FlatRecord<{
640
- name: string;
641
645
  applicationId: mongoose.Types.ObjectId;
642
646
  repaymentType: string;
643
647
  ltv: string;
@@ -650,6 +654,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
650
654
  variableRepayment: string;
651
655
  reversionRateWithoutBaseRate: string;
652
656
  totalReversionRate: string;
657
+ reversionRate: string;
653
658
  initialRate: string;
654
659
  fixedTerm: string;
655
660
  fixedTermEndDate: string;
@@ -710,6 +715,7 @@ declare const ApplicationProductFeaturesModel: mongoose.Model<{
710
715
  icr: string;
711
716
  ufssProductCode: string;
712
717
  ufssInterestRateCode: string;
718
+ name?: string | null | undefined;
713
719
  calculations?: {
714
720
  ltv: string;
715
721
  rentalCoverageRatioRate: 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;AA6GhC,QAAA,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAsE,CAAC;AAC5G,eAAe,+BAA+B,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import mongoose from "mongoose";
2
+ import { applyWorkflowPlugin } from "../shared/workflow.plugin";
2
3
  const feeSchema = new mongoose.Schema({
3
4
  feeType: { type: String, required: true },
4
5
  description: { type: String, required: true },
@@ -36,13 +37,14 @@ const calculationsSchema = new mongoose.Schema({
36
37
  });
37
38
  const productFeaturesSchema = new mongoose.Schema({
38
39
  applicationId: { type: mongoose.Schema.Types.ObjectId, ref: "Application", required: true },
39
- name: { type: String, required: true },
40
+ name: { type: String, required: false },
40
41
  clientAdvance: { type: String, required: true },
41
42
  ltv: { type: String, required: true },
42
43
  repayment: { type: String, required: true },
43
44
  variableRepayment: { type: String, required: true },
44
45
  reversionRateWithoutBaseRate: { type: String, default: null },
45
46
  totalReversionRate: { type: String, default: null },
47
+ reversionRate: { type: String, default: null },
46
48
  initialRate: { type: String, required: true },
47
49
  fixedTerm: { type: String, required: true },
48
50
  fixedTermEndDate: { type: String, default: null },
@@ -92,5 +94,7 @@ const productFeaturesSchema = new mongoose.Schema({
92
94
  stressedPaymentRate: { type: String, default: null },
93
95
  calculations: calculationsSchema
94
96
  });
97
+ // Apply workflow plugin to the schema
98
+ applyWorkflowPlugin(productFeaturesSchema, 'applicationproductfeatures');
95
99
  const ApplicationProductFeaturesModel = mongoose.model("ApplicationProductFeatures", productFeaturesSchema);
96
100
  export default ApplicationProductFeaturesModel;
@@ -0,0 +1,125 @@
1
+ /// <reference path="../value-objects/pound.d.ts" />
2
+ /// <reference path="../value-objects/account-number.d.ts" />
3
+ /// <reference path="../value-objects/sort-code.d.ts" />
4
+ /// <reference types="mongoose/types/aggregate" />
5
+ /// <reference types="mongoose/types/callback" />
6
+ /// <reference types="mongoose/types/collection" />
7
+ /// <reference types="mongoose/types/connection" />
8
+ /// <reference types="mongoose/types/cursor" />
9
+ /// <reference types="mongoose/types/document" />
10
+ /// <reference types="mongoose/types/error" />
11
+ /// <reference types="mongoose/types/expressions" />
12
+ /// <reference types="mongoose/types/helpers" />
13
+ /// <reference types="mongoose/types/middlewares" />
14
+ /// <reference types="mongoose/types/indexes" />
15
+ /// <reference types="mongoose/types/models" />
16
+ /// <reference types="mongoose/types/mongooseoptions" />
17
+ /// <reference types="mongoose/types/pipelinestage" />
18
+ /// <reference types="mongoose/types/populate" />
19
+ /// <reference types="mongoose/types/query" />
20
+ /// <reference types="mongoose/types/schemaoptions" />
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/schematypes" />
27
+ /// <reference types="mongoose/types/inferschematype" />
28
+ /// <reference types="mongoose/types/inferrawdoctype" />
29
+ import { Types } from "mongoose";
30
+ import { IBaseType } from "../types/base.types";
31
+ interface IFee {
32
+ feeType: string;
33
+ description: string;
34
+ feeAmount: string;
35
+ rate?: string;
36
+ addedToLoan?: string;
37
+ allowOverride?: string;
38
+ additionalData?: any;
39
+ }
40
+ interface ICashflowPeriod {
41
+ from?: string | null;
42
+ to?: string | null;
43
+ instalmentAmount?: string | null;
44
+ instalmentInterest?: string | null;
45
+ instalmentCapitalRepaid?: string | null;
46
+ otherCosts?: string;
47
+ outstandingCapital?: string | null;
48
+ }
49
+ interface ICalculations {
50
+ ltv?: string | null;
51
+ rentalCoverageRatioRate?: string | null;
52
+ bankContributionRate?: string | null;
53
+ bankInitialShareRate?: string | null;
54
+ totalAmountPayable?: string | null;
55
+ fixedMonthlyPayment?: string | null;
56
+ fixedMonthlyCapital?: string | null;
57
+ fixedMonthlyInterest?: string | null;
58
+ variableMonthlyPayment?: string | null;
59
+ summaryTotal?: string | null;
60
+ reimbursementPerPound?: string | null;
61
+ stressedPayment?: string | null;
62
+ stressedPaymentRate?: string | null;
63
+ rentalCoverage?: string | null;
64
+ rentalCoverageWithoutTopUp?: string | null;
65
+ }
66
+ export default interface IApplicationProductFeatures extends IBaseType {
67
+ applicationId: Types.ObjectId;
68
+ name: string;
69
+ clientAdvance: string;
70
+ ltv: string;
71
+ repayment: string;
72
+ variableRepayment: string;
73
+ reversionRateWithoutBaseRate?: string | null;
74
+ totalReversionRate?: string | null;
75
+ initialRate: string;
76
+ fixedTerm: string;
77
+ fixedTermEndDate?: string | null;
78
+ baseRate?: string | null;
79
+ productRate?: string | null;
80
+ apr?: string | null;
81
+ rentalCoverage?: string | null;
82
+ repaymentType?: string | null;
83
+ applicationCategory?: string | null;
84
+ securityType?: string | null;
85
+ erc?: string | null;
86
+ loanType?: string | null;
87
+ maxLtvLimit?: string | null;
88
+ reimbursement?: string | null;
89
+ reimbursementPerPound?: string | null;
90
+ stressedApr?: string | null;
91
+ stressedRate?: string | null;
92
+ stressedRepayment?: string | null;
93
+ liborFloorRate?: string | null;
94
+ totalTermInMonths?: string | null;
95
+ chargeType?: string;
96
+ productCategory?: string;
97
+ ercCode?: string;
98
+ variableTerm?: string | null;
99
+ totalFeePayable?: string | null;
100
+ dipIssueDate?: string | null;
101
+ estimatedCompletionDate?: string | null;
102
+ dipExpiryDate?: string | null;
103
+ fixedRepaymentUntillDate?: string | null;
104
+ rentalReviewDate?: string | null;
105
+ totalReimbursementWithFee?: string | null;
106
+ finalRentPayment?: string | null;
107
+ clientDeposit?: string | null;
108
+ firstRentPayment?: string | null;
109
+ fees?: IFee[];
110
+ ercFeatures?: any;
111
+ cashflowPeriods?: {
112
+ totalNoOfPayments?: string | null;
113
+ fixed?: ICashflowPeriod;
114
+ variable?: ICashflowPeriod;
115
+ total?: ICashflowPeriod;
116
+ };
117
+ icr?: string | null;
118
+ ufssProductCode?: string | null;
119
+ ufssInterestRateCode?: string | null;
120
+ stressedPayment?: string | null;
121
+ stressedPaymentRate?: string | null;
122
+ calculations?: ICalculations;
123
+ }
124
+ export {};
125
+ //# sourceMappingURL=application-productfeatures.type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application-productfeatures.type.d.ts","sourceRoot":"","sources":["../../applications/application-productfeatures.type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAEhD,UAAU,IAAI;IACV,OAAO,EAAE,MAAM,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